-
Notifications
You must be signed in to change notification settings - Fork 107
Description
Hi,
I still having the same problem as (#74 )
I'am having problems using Newtonsoft as the json serializer with problem details.
When this package returns the problem details the Extensions property is serialzied as "Extensions": {...} and not to the parent.
My Web API is built withNET 6
i'm using Hellang.Middleware.ProblemDetails vs 6.5.1
example of response
{
"error": {
"code": "xxxxxxx",
"message": "TEST EXCEPTION"
},
"type": "https://httpstatuses.io/422",
"title": "Bad Request",
"status": 422,
"detail": null,
"instance": "/api/v2/",
"extensions": {
"traceId": "00-c7eeff3ccf1f649acb783983201da96d-b6eab3d064ab8984-00",
"timestamp": "2023-09-21T20:14:36.2960678+02:00"
}
}
when I JSON serializer xx the problem does not arise, and the response is like this
{
"error": {
"code": "xxxxxxx",
"message": "TEST EXCEPTION"
},
"type": "https://httpstatuses.io/422",
"title": "Bad Request",
"status": 422,
"detail": null,
"instance": "/api/v2/",
"traceId": "00-c7eeff3ccf1f649acb783983201da96d-b6eab3d064ab8984-00",
"timestamp": "2023-09-21T20:14:36.2960678+02:00"
}
is there any solution to keep using Newtonsoft ?