api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.38k stars 846 forks source link

Support for JsonProblem (RFC 7807) Extension Member #6414

Closed gquemener closed 3 weeks ago

gquemener commented 3 weeks ago

Hello,

As far as I have seen, the current state of ApiPlatform limits the schema of the serialized exception to the following properties:

The RFC mentions that this schema could contain extra information (named "extension members") and gives the example of an "account" field.

Is this supported by ApiPlatform ? (We are still using version 2.7)

Thanks.

soyuka commented 3 weeks ago

In API Platform 3.1/3.2 and forward you can put whatever you want in an error https://api-platform.com/docs/guides/error-resource/

On 2.7 you should create your own normalizer. Also this is not a bug, nor a feature request, use either the Discussions, slack or contact us at contact@les-tilleuls.coop.

gquemener commented 3 weeks ago

Thanks for taking the time answering.

I did not find the mentioned guide while browsing the doc :+1:

Also, sorry about the noise, I'll go through a different channel next time.