You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading from 4.x to 5.4.0 (including enabling Newtonsoft serializer support) model object fields marked with [JsonRequired] are marked as nullable in the swagger.json (and shown as nullable in the UI).
[JsonProperty(Required = Required.Always)]``` works as expected (these fields are not marked as nullable).
Code:
public class TestDto {
[JsonRequired]
public String jsonRequired;
[JsonProperty(Required = Required.Always)]
public String jsonProperty;
}
After upgrading from 4.x to 5.4.0 (including enabling Newtonsoft serializer support) model object fields marked with
[JsonRequired]
are marked as nullable in the swagger.json (and shown as nullable in the UI).[JsonProperty(Required = Required.Always)]``` works as expected (these fields are not marked as nullable).
Code:
swagger.json:
For now I've worked around this issue by converting all our models to use the JsonProperty approach.
The text was updated successfully, but these errors were encountered: