One of my company's applications import packages that contain models that become responses from our API
using Newtonsoft.Json;
public class Foo
{
[JsonProperty("bar"]
public string Bar { get; set;}
}
We have for our own models migrated to System.Text.Json
, which uses [JsonPropertyName("foobaz")]
Swagger picks up the correct formatting for our own models automatically, but not for the imported packages.
If we add AddSwaggerGenNewtonsoftSupport
in program.cs, it picks it up for the imported models, but not for our models.
Is there any way to tell swagger to handle both?