-
-
Notifications
You must be signed in to change notification settings - Fork 888
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
Allow an input and an output for a given resource class #2235
Conversation
soyuka
commented
Oct 4, 2018
•
edited by dunglas
Loading
edited by dunglas
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | may fix some issues |
License | MIT |
Doc PR | api-platform/docs#703 |
b43fc65
to
493ff05
Compare
You have to add these two new keys in the |
493ff05
to
2debd03
Compare
2debd03
to
10b1920
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.
Some minor comments, but awesome!
In my implementation, in order to keep the documentation in sync, I added a new attribute to Let me know what you think. |
Oh, and most important thing... Thanks for all the hard work you too do for this project! I'm like 4 api platform projects in and I'm loving it more and more! |
2e68ca3
to
dacc266
Compare
dacc266
to
06142c9
Compare
2574806
to
cb5421a
Compare
Thanks Antoine! |
Not bad 😉 |
This looks great, but still not clear the transition between
And
Is input/output only resource level or it can be applied for operation as well? Is it still possible to use Input/Data in the subscriber on POST_VALIDATE event or it works only in the data persister? What would be the correct yaml syntax? This didn't work, at least wasn't relfected in swagger:
|
@karser, from what I can tell, these can be applied at the resource level or at the operation level (which freaking rocks) |
It looks like we'll need to update the swagger documentation generator to take into account these changes as well. |
It should be available yes, if not lmk I'll fix it.
In fact, the input class is mainly used to know how the (de)normalizer should work. As the
I need to update the swagger documentation to reflect the changes. These are attributes first guess would be:
Note that you can use either the input, the output or both. |
Thanks, I'll try it within today |
I tried added outputClass in attributes and it still works (at least api tests don't fail) but swagger part is still not displaying the outputClass. |
I totally missed this feature. And I really love this feature. I will be able to remove custom code \o/ Thanks. Just a side note not related: You really need a blog (I'm not talking about https://api-platform.com/news/). Something like Symfony "Living on the Edge |
@lyrixx I try to write a blog post for every releases with an explanation of new features like this one: https://dunglas.fr/category/programmation/php/api-platform/ This feature hasn't been released yet, it's why there are no blog posts about it yet. However having a proper blog, or maybe a Planet, would be nice. We'll do it at some point. |
I am curious, what is Planet? :) |
Basically a RSS feeds aggregator: https://en.wikipedia.org/wiki/Planet_(software) |