Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update wording in transaction extension #310

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 27 additions & 20 deletions ogcapi-features/extensions/transaction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,54 @@ work to get it incorporated.

When the body is a partial Item:

- Shall only create a new resource.
- Shall return 409 if an Item exists for the same collection and id values.
- Shall populate the `collection` field in the Item from the URI.
- Shall return 201 and a Location header with the URI of the newly added resource for a successful operation.
- Must only create a new resource.
- Must have an id field.
- Must return 409 if an Item exists for the same collection and id field values.
- Must populate the `collection` field in the Item from the URI.
- Must return 201 and a Location header with the URI of the newly added resource for a successful operation.
- May return the content of the newly added resource for a successful operation.

When the body is a partial ItemCollection:

- Shall only create a new resource.
- Shall return 409 if an Item exists for any of the same collection and id values.
- Shall populate the `collection` field in each Item from the URI.
- Shall return 201 without a Location header.
- May create only some of the Items in the ItemCollection.
- Must only create a new resource.
- Each Item in the ItemCollection must have an id field.
- Must return 409 if an Item exists for any of the same collection and id values.
- Must populate the `collection` field in each Item from the URI.
- Must return 201 without a Location header.
- May create only some of the Items in the ItemCollection. Implementations are not
required to implement all-or-none sematics for this operation. For example, if an
ItemCollection contains two Items and one is successfully created and the other
fails to be created, the server is not required to then delete the successfully
created one. When only some of the Items in the ItemCollection are created, the
server should communicate this failure back to the client with an error status code.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be defined which error code should be used when only a partial update happened?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can. It could be any problem. I think the point here is that it's not atomic, and you may have partial updates, and that the server isn't required to enforce atomicity.


All cases:

- Shall return 202 if the operation is queued for asynchronous execution.
- Must return 202 if the operation is queued for asynchronous execution.

### PUT

- Shall populate the `id` and `collection` fields in the Item from the URI.
- Shall return 200 or 204 for a successful operation.
- Must populate the `id` and `collection` fields in the Item from the URI.
- Must return 200 or 204 for a successful operation.
- If 200 status code is returned, the server shall return the content of the updated resource for a successful operation.
- Shall return 202 if the operation is queued for asynchronous execution.
- Shall return 404 if no Item exists for this resource URI.
- Must return 202 if the operation is queued for asynchronous execution.
- Must return 404 if no Item exists for this resource URI.
- If the `id` or `collection` fields are different from those in the URI, status code 400 shall be returned.

### PATCH

- Shall populate the `id` and `collection` fields in the Item from the URI.
- Shall return 200 or 204 for a successful operation.
- Must populate the `id` and `collection` fields in the Item from the URI.
- Must return 200 or 204 for a successful operation.
- If status code 200 is returned, the server shall return the content of the updated resource for a successful operation.
- May return the content of the updated resource for a successful operation.
- Shall return 202 if the operation is queued for asynchronous execution.
- Shall return 404 if no Item exists for this resource URI.
- Must return 202 if the operation is queued for asynchronous execution.
- Must return 404 if no Item exists for this resource URI.
- If the `id` or `collection` fields are different from those in the URI, status code 400 shall be returned.

PATCH is compliant with [RFC 7386](https://tools.ietf.org/html/rfc7386).

### DELETE

- Shall return 200 or 204 for a successful operation.
- Shall return a 202 if the operation is queued for asynchronous execution.
- Must return 200 or 204 for a successful operation.
- Must return a 202 if the operation is queued for asynchronous execution.
- May return a 404 if no Item existed prior to the delete operation. Returning a 200 or 204 is also valid in this situation.