Skip to content

Commit 07d6014

Browse files
authored
docs: update the OpenAPI spec to match the actual response format of 409 errors (#2389)
I haven't verified all possible response formats but these changes bring the documentation in line with what we have in the tests under `test/electric/plug/serve_shape_plug_test.exs`.
1 parent 97ff87b commit 07d6014

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

website/electric-api.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ paths:
7070
in the stream.
7171
7272
Note that when `offset` is not `-1` then you must also provide
73-
a `shape_handle`.
73+
the shape's `handle`.
7474
- name: live
7575
in: query
7676
schema:
@@ -380,24 +380,21 @@ paths:
380380
schema:
381381
type: string
382382
description: Relative path for syncing the latest version of the requested shape.
383+
electric-handle:
384+
schema:
385+
type: string
386+
description: Handle of the new shape that must be used in client requests from now on.
383387
content:
384388
application/json:
385389
schema:
386390
type: object
387391
properties:
388-
message:
389-
type: string
390-
description: Error message
391-
shape_handle:
392-
type: string
393-
description: The latest shape handle the client should sync.
394-
offset:
395-
type: string
396-
description: The offset from where to sync the given shape_handle.
392+
headers:
393+
type: object
394+
description: Cache control headers
397395
example:
398-
message: "The shape associated with this shape_handle and offset was not found. Resync to fetch the latest shape"
399-
shape_handle: "2494_84241"
400-
offset: "-1"
396+
headers:
397+
control: "must-refetch"
401398
"429":
402399
description:
403400
Too many requests. The server is busy with other requests, potentially

0 commit comments

Comments
 (0)