-
-
Notifications
You must be signed in to change notification settings - Fork 296
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
Hyper-schema: "Allow"/acceptable methods link attribute #73
Comments
I think this is a good idea, but there are some wrinkles that would have to be discussed. GET, PUT, and DELETE have very specific semantics, so there is no reason we need to do anything more than express that those methods are available. The caveat with PUT is that the Hyper-Schema MUST include JSON Schema validation constraints to describe the resource. If it doesn't, there is nothing to tell a client the structure the server expects with a PUT operation. This wouldn't work if you just wanted to send the just the LDO part of the Hyper-Schema instead of the full thing. I think I'm ok with this, but it is a little awkward. I'll have to think about it some more. Then there is POST. Any time you are doing a POST, you need to describe what input you expect using a JSON Schema. What would the LDO look like in this case. Here's one option. {
"href": "/foo",
"allow": ["GET", "PUT", "DELETE", "POST"],
"schema": { ... }
} That would be awkward because "schema" only applies to POST, but that isn't clear. Another option would be {
"href": "/foo",
"allow": [
"GET",
"PUT",
"DELETE",
["POST", { ... schema ... }]
]
} This makes it clear that the schema applies only to POST, but there might be a better way. Then there is the link building functionality that was previously handled by the presence of GET and a "schema". How would you describe link building? That might be a completely different issue, but it will have to fit in here somewhere at some point. |
If you mean encoding input into the URI for the link, it should be done as proposed in issue #52 (extended templating) which allows for more flexible URI encoding (not just the query string). There should be a mechanism analogous to that proposal's |
@awwright Is If it's an LDO keyword, does it only apply to self? If not, schema authors would need to duplicate for all links that point to the same resource, which seems bad. Then again |
If PR #383 gets accepted for draft-07, I plan to close this as it is a solution to the general problem. There has been some suggestion of also having an If it turns out not to be sufficient, we should open a new issue based on the draft-07 feedback rathe than leaving this sitting open confusing anyone who stumbles across it. |
As noted, in the previous comment, let's see how |
The current "method" keyword doesn't quite have the semantics we're looking for.
Change the definition or replace with a keyword that lists allowable HTTP methods, instead (as a hint).
The text was updated successfully, but these errors were encountered: