-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
Add stateless ApiResource attribute #3436
Conversation
cc70388
to
d38dad2
Compare
I think the default cannot be WDYT @dunglas? |
We could detect the version of |
We could as well use Furthermore, what I meant is just telling the developer that he is using |
Uhh, yeah, I forgot this is the HttpKernel we're talking about. Lol...
Personally, I think it's fine to just do nothing. It should be documented that this feature requires Symfony 5.1 |
8579990
to
e24f18e
Compare
src/Metadata/Resource/Factory/ExtractorResourceMetadataFactory.php
Outdated
Show resolved
Hide resolved
src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
Outdated
Show resolved
Hide resolved
ba015b2
to
b33df4b
Compare
Ok, using the current approach, stateless priority will be handled as the following:
Same goes for subresources. |
src/Bridge/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
Outdated
Show resolved
Hide resolved
b33df4b
to
9bf4d1d
Compare
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.
Missing deprecation: #3436 (comment)
3560f84
to
ec288b4
Compare
src/Metadata/Resource/Factory/OperationResourceMetadataFactory.php
Outdated
Show resolved
Hide resolved
I think there are some fundamental problems with the current implementation... This needs work. |
And sorry for the earlier confusion, there's no explicit |
41374d0
to
ccd2c90
Compare
No worries! I should have been aware of that. The new implementation is much cleaner now, thanks. |
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.
Could you rebase please?
ccd2c90
to
9c2cf7b
Compare
9c2cf7b
to
3c80345
Compare
In Symfony 5.1, it will be possible to declare routes as stateless (symfony/symfony#35732)
For stateless routes, kernel will either throw an exception (debug enabled) or log a warning (debug disabled) on session usage.
As API Platform shouldn't use session (according to REST architecture constraints), this PR proposes to add an ApiResource attribute in order to declare related routes as stateless:
stateless
false
will be the default in order to prevent BC break (and we could set it attrue
in the next major)One question still remains. API Plateform could be on top of older version of Symfony (4.x, 5.0.x).
How to handle it ?
WDYT ?