We did something quite similar in our project with API Platform 3 and the development process was very painful. Hopefully, we succeed with DTO / processor approach but it took much time to understand how it works with a lack of documentation. One of the weirdest things was that we had to expose entity resource and output DTO for this entity as a resource too (GET item only) to make it work. Then, to create the one resource from those two (dto and entity) you have to use the same shortName and uriTemplate to fix openapi schema I didn`t try stateOptions and it might solve this issue. But in general, it is very far from DTO system of "my dreams" :)
We did something quite similar in our project with API Platform 3 and the development process was very painful. Hopefully, we succeed with DTO / processor approach but it took much time to understand how it works with a lack of documentation.
One of the weirdest things was that we had to expose entity resource and output DTO for this entity as a resource too (GET item only) to make it work.
Then, to create the one resource from those two (dto and entity) you have to use the same shortName and uriTemplate to fix openapi schema
I didn`t try stateOptions and it might solve this issue.
But in general, it is very far from DTO system of "my dreams" :)
Aussi passionnant que les sf casts !
So do you put now the security annotations on the DTO in this case or still the entity cause this is what the Provider/Processor is calling?
Forward to 2024, this is still not documented anywhere.
Most (if not all) of it is in the 3 tutorials on SymfonyCasts. I learned this stuff from there, in lack of a better alternative.