Antoine Bluchet
Antoine Bluchet
> The only way I can think to get around this would be to validate myself in the transformer. Exactly, I noted this "issue" today as well. I did it...
The transformer should only transform the `Input` to the `Entity` that represents the end resource (eg tagged with @ApiResource). The DataPersister should handle the persistence for this entity indeed.
Would you be able to give some stack trace? I need to know from where this error comes.
Override the IriConverter with your own that does nothing I guess :p.
> So, is there any solution to this design problem? Using disable_type_enforcement just makes API platform throw another exception, still without an ability to validate input with the incorrect type....
Mhh but validation errors do throw a 400 ?! https://github.com/api-platform/core/blob/345612c913e1aca6da4f4aa1cd885421ca6385ff/src/Bridge/Symfony/Validator/EventListener/ValidationExceptionListener.php Or the issue here is tight to PHP types where a 500 is thrown because of a php error not...
If you have ways to improve this, please feel free to contribute on https://github.com/api-platform/core !
It's in our pipes but I can't give you a timeline. We thought about it and we have high demand on that feature but it's not possible yet. > Could...
Should be possible, we may accept a patch to the core (there is a branch for mongodb support for example).
You should be able to do this on your side, use it in Dataproviders/persisters :).