DEV Community

Discussion on: Another way for a Symfony API to ingest POST requests - No Bundle

zajca profile image
Martin Zajíc

There is one issue, when payload has wrong property type, or missing property or it's null, it will end up with Type error thus 500 error. This is because you have typed props and request is mapped to object and than validated. Better is to validate raw payload and than map request to object, but it's more work and you can't use class metadata for validation.