Closed tvperez76 closed 4 years ago
JsonProperty
is a Newtonsoft attribute which leads me to believe you're still using the Newtonsoft serializer as opposed to the new serializer System.Text.Json
that ships with ASP.NET Core 3.0. If this is the case, you'll need to install a separate Swashbuckle package and explicitly opt-in to honor the Newtonsoft attributes. See https://github.com/domaindrivendev/Swashbuckle.AspNetCore#systemtextjson-stj-vs-newtonsoft
That's correct. However, I am not using ASP.NET Core 3.0, so that's not really an option. So, are we to conclude that v.5.0.0 will not support ASP.NET Core 2.2 or earlier? Or, that we need to specifically invoke the AddSwaggerGenNewtonsoftSupport() method, regardless of the ASP.NET Core version we're using?
Yes you need to invoke it regardless
Thank you for the information. I recommend that this be explicitly stated in the documentation, as to remove any ambiguity as to the applicability of the AddSwaggerGenNewtonsoftSupport() method in non-ASP.NET Core 3.0 hosts.
Propertiy names set by JsonPropertyAttributes are ignored whenever its class is used with [FromBody] Post Method. This only appears to happen with v5.0.0-rc5 version of Swashbuckle.AspNetCore library. All others appear to be working well.
Version v.5.0.0-rc5:
Version v.5.0.0-rc4: