intelligentplant / ProblemDetails.WebApi

Adds RFC 7807 support to ASP.NET 4.x Web API applications.
Apache License 2.0
1 stars 3 forks source link

Use JSON media type formatter serializer settings for property names #8

Closed icnocop closed 1 year ago

icnocop commented 1 year ago

Hi.

Thank you for ProblemDetails.WebApi.

I noticed the property name values in the JsonProperty attributes decorated on the properties in the ProblemDetails class are lowercase.

This isn't consistent with other JSON property names my Web API returns on other endpoints if the configured JSON serializer uses a pascal case naming strategy.

I expected the property names to be serialized depending on the JSON media type formatter serializer settings.

Thank you.

wazzamatazz commented 1 year ago

Hi, thanks for getting in touch.

The property names currently follow the problem details JSON object as described in the RFC 7807 specification here exactly.

I'll look at using the configured serializer settings instead, but changing the case of the property names will make it non-compliant with the spec.

icnocop commented 1 year ago

Thank you for the insights.

If the changes will cause the results to not be compliant with the spec, then it probably doesn't make sense to make the changes.

I will close this issue.

Thank you!