-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
spec: allow to select rel and media types #54
Conversation
This looks great! Definitely meets my use-case and then some. I also like that structured headers is used for this! |
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.
Looks promising!
One comment comes to mind on both hreflang
and type
, for both you have:
If this parameter is provided, the server
SHOULD
preload only relations matched by the provided selector
In #46 I was however rather asking for a way to overload the Accept type.
Example for GET /content/objects/{contentId}
you can set different Accept and get different representations:
- application/vnd.ez.api.Content+xml
- application/vnd.ez.api.Content+json
- application/vnd.ez.api.ContentInfo+xml
- application/vnd.ez.api.ContentInfo+json
This can furthermore be extended to be able to add more data to the response for instance (custom use cases).
So to enable that I would expect Accept
for Preload requests to to be set in the following order:
- If the Preload/Fields header has a type override for the given selector, use this
- If the matched link in the document has a type, use this
- Lastly reuse Accept from the current ("parent") request
Co-authored-by: Grégoire Hébert <[email protected]>
Co-authored-by: André R. <[email protected]>
Co-authored-by: André R. <[email protected]>
@andrerom unfortunately I think that it's fundamentally incompatible with the other goad of this change which is to add selection capabilities similar to what the |
In 3e54822 I added a clarification regarding content negotiation: servers should try to guess the best possible value for the |
dda02a0
to
2a587a0
Compare
2a587a0
to
8dc23de
Compare
rel
parameter@andrerom could you review this change? It should address the eZ Publish's use case (closes #46).
@evert as discussed during API Days Interface, this change to the spec should allow to cover the use cases also covered by your Prefer-Push I-D. Would you mind to take a look?
Thanks!