Allow an input and an output for a given resource class#2235
Allow an input and an output for a given resource class#2235dunglas merged 1 commit intoapi-platform:masterfrom
Conversation
b43fc65 to
493ff05
Compare
|
You have to add these two new keys in the |
493ff05 to
2debd03
Compare
2debd03 to
10b1920
Compare
dunglas
left a comment
There was a problem hiding this comment.
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) |
Uh oh!
There was an error while loading. Please reload this page.