-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat(134): make etag not required #240
Conversation
making etag a require field will force the user to perform a Get of the resource first to retrieve the etag - this can cause friction for simple clients like command-line interfaces or curl-ing a resource, and makes the behavior of the standard method inconsistent across resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guidance relates specifically to PUT and PATCH requests, for which it can be entirely reasonable to require specification of a target ETag in every request.
I'm definitely open to discussing this, so thanks for posting! Is it really reasonable to require that the user specify it on a resource-by-resource basis? What if the user doesn't really care about concurrency control for the resource? My main concern with this requirement is that clients will then be forced to be more complex. A simple update in a shell script now requires performing a |
If you have a specific example where an etag being required (not just optional) significantly improves the usability of the resource, that would be very helpful. |
This is mostly moot, since e.g. And for a concrete example, I would probably use precisely that kind of strategy for interactions that "publish" or "promote" a resource to a wider audience and/or maturity level, and also on any updates that apply to a resource required to have a linear change history (such as a document that in a more primitive or physical environment would be protected by checkout procedures). I would also expect it in e.g. an inventory system, for which lost updates can be especially problematic. |
Sorry, I forgot to call out one detail earlier. This is referring specifically to how etags are applied to the Update (Patch) on resources. It does not modify https://aep.dev/154/, which discusses the usage of etags overall (although potentially there's some deduplication worth doing in https://aep.dev/154/#condition-headers).
I think these are good examples. My primary motivation for not requiring the field was to simplify the clients we are creating. However, I guess ultimately it's irrelevant whether the field itself is required or not because even if there's partial resource or operation support, the clients will have to eventually add functionality to interface with APIs and operations that support them anyway. So I'll probably close this. However I will probably open a separate issue to propose removing the etag parameter as a value required on write and instead replace it with 154's behavior around Thoughts? |
server-computed value, and **must** fail with an `ABORTED` error otherwise. The | ||
`update_mask` field in the request does not affect the behavior of the `etag` | ||
field, as it is not a field _being_ updated. | ||
- The `etag` field **must** be [optional][]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale for saying that APIs cannot make etags required for any resource?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a discussion on the overall pr here: #240 (comment).
There's some good back and forth there, but I'll close this issue since I don't think it actually achieves my goal of making full clients easier to author.
Closing, but please check out #241 as another opportunity to standardize behavior a bit. |
making etag a require field will force the user
to perform a Get of the resource first to retrieve the etag - this can cause friction for simple clients like command-line interfaces or curl-ing a resource, and makes the behavior of the standard method inconsistent across resources.
🍱 Types of changes
What types of changes does your code introduce to AEP? Put an
x
in the boxesthat apply
📋 Your checklist for this pull request
Please review the AEP Style and Guidance for
contributing to this repository.
General
references AEPs
correctly.
(usually
prettier -w .
)