Skip to content

The IRI for a resource is generated from an itemOperation #449

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

Merged
merged 2 commits into from
Apr 20, 2018

Conversation

jonag
Copy link
Contributor

@jonag jonag commented Mar 23, 2018

From my experience, I always need to define a GET operation for the item to generate the IRI, not a collection operation. This line of code seems to confirm that.

@dunglas
Copy link
Member

dunglas commented Mar 23, 2018

I think this change isn't accurate:

  • the first item operation is used to generate the URL of an item
  • the first collection operated is used to generate the URL of a collection

Maybe can you update your PR to rewrite it like that?

@jonag
Copy link
Contributor Author

jonag commented Mar 24, 2018

Indeed, I missed the part where the collectionOperation is used. I have updated my PR with your suggestion.
Is the new phrasing OK or do you prefer something like that

Note: By default API Platform uses the first GET operations defined in itemOperations and collectionOperations to generate respectively the IRI of an item and of a collection for a resource class.

to avoid the repetition?

@dunglas dunglas merged commit cce2976 into api-platform:2.2 Apr 20, 2018
@dunglas
Copy link
Member

dunglas commented Apr 20, 2018

Thanks @jonag

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.

2 participants