I do have my .net data classes, containing a few decimal fields (for example quantity
). I generate an openapi.json out of it running dotnet swagger.
...
"quantity": {
"type": "number",
"format": "double"
},
...
As you can see it produces a type "number" with format "double". And nswag creates a client, where the field is a double too.
Can I configure somehow to set format as decimal? When I edit the openapi.json manually, the nswag creation produces a decimal as expected.
I tried to add this annotation, but it doesn't change anything: [JsonSchema(JsonObjectType.Number, Format = "decimal")]