Skip to content
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

Merged
merged 6 commits into from
Jul 14, 2020
Merged

Conversation

dunglas
Copy link
Owner

@dunglas dunglas commented Jul 8, 2020

@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!

@evert
Copy link

evert commented Jul 8, 2020

This looks great! Definitely meets my use-case and then some. I also like that structured headers is used for this!

spec/vulcain.md Outdated Show resolved Hide resolved
Copy link
Contributor

@andrerom andrerom left a 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:

  1. If the Preload/Fields header has a type override for the given selector, use this
  2. If the matched link in the document has a type, use this
  3. Lastly reuse Accept from the current ("parent") request

spec/vulcain.md Outdated Show resolved Hide resolved
spec/vulcain.md Outdated Show resolved Hide resolved
dunglas and others added 3 commits July 14, 2020 12:01
Co-authored-by: Grégoire Hébert <[email protected]>
Co-authored-by: André R. <[email protected]>
Co-authored-by: André R. <[email protected]>
@dunglas
Copy link
Owner Author

dunglas commented Jul 14, 2020

@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 Prefer-Push header allows. Maybe could we add another attribute for this use case (overloadtype? overloadaccept?), but I wonder if it's not too specific. Maybe could we do as in the Web Linking RFC and allow custom attributes as an extension. The eZ would be able to pass its own attribute for this use case?

@dunglas
Copy link
Owner Author

dunglas commented Jul 14, 2020

In 3e54822 I added a clarification regarding content negotiation: servers should try to guess the best possible value for the Accept and Accept-Language request headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting accepted media-type on Preload & Fields pushes
4 participants