Skip to content

WIP: Ability to remove the item operation#2954

Closed
soyuka wants to merge 1 commit into
api-platform:masterfrom
soyuka:remove-item-operation
Closed

WIP: Ability to remove the item operation#2954
soyuka wants to merge 1 commit into
api-platform:masterfrom
soyuka:remove-item-operation

Conversation

@soyuka

@soyuka soyuka commented Jul 26, 2019

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets lots? #2796
License MIT
Doc PR na

This is a proposal to make resources work without a defined GET item operation. When it fails we should fallback to a blank IRI instead of resulting in a 400 error.

Note that I think that we should make this behavior configurable. If we decide that it should be the default behavior maybe a configuration to keep the old behavior?
About the implementation:

  • I'd like to put this further down the stack so that we can use the CachedRouteResolver with these (performance issue)
  • I thought about adding a new getSafeIriFromItem that never throws (means to add a new interface that extends the current one)

This definitely breaks some current behavior but I think that it also makes ApiPlatform less strict regarding this item operation. The only solution for now is to decorate the IriConverter with our own where it patches these kind of Resources. Also, by using a blank iri we enforce a good practice regarding JSON-LD.

@teohhanhui

teohhanhui commented Aug 1, 2019

Copy link
Copy Markdown
Contributor

For the record, the correct term is blank node identifier, not "blank IRI" 😛

But yeah, this seems like the right way forward.

@lukasluecke

Copy link
Copy Markdown
Contributor

@soyuka Any update on this? I think it would be really great to easily be able to completely disable the REST API if you're only interested in GraphQL. Leaving it enabled forces me to duplicate security related configuration at the moment 😕

@soyuka

soyuka commented Sep 13, 2019

Copy link
Copy Markdown
Member Author

@soyuka Any update on this? I think it would be really great to easily be able to completely disable the REST API if you're only interested in GraphQL. Leaving it enabled forces me to duplicate security related configuration at the moment confused

I need to continue working on this, I can make a priority out of this next week!

@lukasluecke

Copy link
Copy Markdown
Contributor

@soyuka Thank you very much, that would be awesome 🎉

@teohhanhui

Copy link
Copy Markdown
Contributor

@soyuka I think we should close this in favour of (an implementation of) #3051.

@soyuka

soyuka commented Sep 18, 2019

Copy link
Copy Markdown
Member Author

Superseeded by #3079 although blank node identifiers may still be an interesting feature.

@dunglas dunglas closed this Oct 1, 2019
@soyuka
soyuka deleted the remove-item-operation branch October 1, 2019 17:10
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.

4 participants