-
Notifications
You must be signed in to change notification settings - Fork 9.1k
v3.2: improve wording for servers object and url #4734
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
Open
karenetheridge
wants to merge
1
commit into
OAI:v3.2-dev
Choose a base branch
from
karenetheridge:ether/server-url-default
base: v3.2-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Super-nitpick: I think template variable substitution has to take place before relative URI-reference resolution, so perhaps reverse these?
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.
Why?
And, how? If the URI is relative (it hasn't been resolved to an absolute URI yet) then trying to match it against an absolute URI from the HTTP request will fail. You need the whole thing to match against.
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.
Because it's possible to write a templatized URI reference that will resolve differently depending on how the template is filled out. For example, I don't believe we forbid
/
in expanded server URL variables like we do in path ones, and even if we do forbid it, there are at least several different ways this could play out:{start}/foo
simple/foo
(relative path reference)example.com/foo
(scheme-relative refrence)https://example.com/foo
(full URI)/absolute/foo
(absolute path, assuming/
is valid)You can't tell how to resolve the reference until the variables have been expanded.
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.
Again though, you can't match a URI to a template pattern, to figure out what the values of those template variables should be, until the entire pattern is present.
Clearly the entire concept of server urls needs to be rethought, or some extra restrictions added, to make this actually workable in reality.
Uh oh!
There was an error while loading. Please reload this page.
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.
While thinking through this more I also realized that server urls (and path templates too) should probably be ascii-only (even more restrictive than that actually as the list of permitted characters is a subset of ascii) if we ever expect them to match against a URI - i.e. all other characters should be %-url-encoded. We lost this when we removed the
"format": "uri-reference"
on server urls in order to accomodate{
and}
.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.
@karenetheridge I'm happy to drop the point as I don't have time in the next few weeks to delve into that level of detail. And really, the issue here is the ambiguity of the process and not the word order, which is not written in a way that forces one order or the other. It might be that different scenarios work better with different orders.
Anyway, I'm withdrawing any objection, TSC feel free to merge with two approvals.
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.
@handrews If you can concoct some examples of OAD snippets + HTTP request URIs that should match in a certain way (or not match), I can run them through my code and reason through how they behave; I am struggling to find concrete examples that would demonstrate the ambiguity here.
(I'm also still pondering whether we need to explicitly state that path templates and server url templates MUST (SHOULD?) be url-encoded (sans the un-encoded curly braces of course) or not in order to be sure of proper matching. Something to spin off into a discussion perhaps.)