-
Notifications
You must be signed in to change notification settings - Fork 218
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
URI Pattern Validation and Conflict Resolution design doc #1539
Conversation
I think this addresses the problem well, thank you! I have no questions so far, just a couple spelling change suggestions. |
Co-authored-by: Jakub Kozłowski <[email protected]>
Co-authored-by: Jakub Kozłowski <[email protected]>
hi @sugmanue this looks good, but I just wonder - wouldn't it be simple enough to assign an optional numeric priority to each conflicting route, so that api owners could solve any issue with the order of their routes. I would just say that the default priority is 0 if not provided explicitly, and only if there is a collision on the same route and priority, then the api is invalid... |
I feel like doing priority with numbers is like good old having well-defined rules seems more principled. |
+1 on that, and also opens up the possibility of subtle ways of introducing API breaking modes by changing this value. |
I respect that you want to define rules, everyone loves rules, but with that approach I would just be worried that some api's will not be able to use it unless they add an The question is if you prefer to have api writers use workarounds such as x-id=OPNAME - which is also not a backward compatible addition because older clients will not send it. |
@sugmanue , @kubukoz , thank you for the replies! The point I still wanted to make is that using rules that reside "outside" the api definition, in a meta schema, is not going to be more backward compatible because changes to the rules could be implemented at different times for clients vs servers, which will introduce incompatibility. Adding the routing order as information inside the api definition is actually more stable, and means the api definition is self-contained and described the api behavior as a configuration. So if I keep the api definition in my sources I can track the changes of routing as well. Which I see as a better api design than externalizing the routing as rules. That said, I understand that a priority could sounds too simple and therefore not sophisticated enough, although I think that such simplicity is usually a good sign, and while z-index is criticized it still provides a pragmatic solution to those non common collision cases. Two others ways to define such an order:
Thanks. Guy |
This looks great, Manuel! I looked at the S3 Smithy model, and I think all of it can be represented by this proposal except for CopyObject which appears to use headers for routing, and assigning number based priorities to routes wouldn't help here. IMO, header-based routing wouldn't be worth the complexity nor something we'd want to proliferate. Smithy validation errors without x-id
The thing we'd need to make more explicitly supported is placing dynamic query strings in the URI in addition to input parameters. This would remove the
Smithy validation allows this right now, but it's currently undefined behavior. It would be nice to add statements around if/how this works in the proposal. |
@mtdowling you can see the summary of unsupported s3 routing cases in this comment - for example in the case you mentioned about
|
@guymguym: The way I think it could (and maybe even already) works is that servers would route based on static query string parameters regardless of if they have a value (e.g., |
Any update on this? |
@zeyad001 I been busy working on something else, sorry about that. I will update the document and post a updated revision soon and move it from there. |
Issue #, if available: #1512 #1029
Description of changes:
Design proposal to change the way we validate URI patterns to allow conflicting ones while also specifying how the servers must route ambiguous requests.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.