Open abbotware opened 5 years ago
Interestingly enough, Swashbuckle seems to not support this directly either, but there is a mechanism to at least override the behavior: https://github.com/domaindrivendev/Swashbuckle/issues/457
Maybe this is more for NJsonSchema ?
I just came across this doc page: https://github.com/RSuter/NJsonSchema/wiki/JsonSchemaGenerator and it seems like what I am asking about is not supported?
As an FYI - [JsonSchema(Name = "Override")] is definitely working for me
NJS/NSwag uses the newtonsoft.json contract resolver to get property names so that the schema matches the actual serialization.. if there is a DataContract attribute on the class and a DataMember on the property i’d say this should work
hmm.. so you mean this could be Newtonsoft issue then?
This is what I have discovered:
[DataContract(Name="Override")] - Class level - doesn't work [DataMember(Name="Override")] - Property level - works
[JsonSchema(Name = "Override")] - Class or Property - works
[DataContract(Name="Override")] - Class level - doesn't work
Ah yes, this is probably something which has to be handled by NJsonSchema manually to be supported...
Is DataContract(Name="Override") supported?
This is similar to #1302 and #6, but at the class name level.