From a29a38db0ad7fc8d42a533145c8a489d97702fb5 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 30 Oct 2026 20:34:47 +0100 Subject: add support to insert values at list index --- docs/openapi.yaml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'docs/openapi.yaml') diff --git a/docs/openapi.yaml b/docs/openapi.yaml index 5ccafb8..09d0bc6 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -129,6 +129,54 @@ paths: description: Writing failed. '503': description: Node is not ready. + post: + tags: [Store] + summary: Insert into a list + description: | + Inserts the value (as `PUT` takes it) into the list at the path: at `index`, + the items from there on moving up one, or at the end without one (or with + `-1`). One request is one Automerge change. To add a key to a map, `PUT` it. + parameters: + - name: index + in: query + required: false + description: Where, from 0 to the list's length (that's the end); `-1` is the end too. + schema: + type: integer + minimum: -1 + requestBody: + required: true + content: + application/json: + schema: {} + text/plain: + schema: + type: string + responses: + '201': + description: Inserted, and where. + content: + application/json: + schema: + type: object + required: [index] + properties: + index: + type: integer + '400': + description: Invalid path, index, malformed JSON or invalid UTF-8. + '401': + $ref: '#/components/responses/Unauthorized' + '403': + description: As for `PUT`. + '404': + description: Nothing at this path. + '409': + description: Not a list there, or the index is past its end (the message says which, and the length). + '415': + description: Content-Type is neither `application/json` nor `text/plain` (absent means JSON). + '503': + description: Node is not ready. delete: tags: [Store] summary: Delete a value -- cgit v1.3.1