OpenAPI.NET.CSharpAnnotations icon indicating copy to clipboard operation
OpenAPI.NET.CSharpAnnotations copied to clipboard

Specifying format on properties?

Open ChlorideCull opened this issue 5 years ago • 2 comments

I can't find any way to set a format such as "date" on a property, as defined in the OAS 3.0 spec.

It's automatically set to "date-time" on DateTime objects, but I want to set it to "date" as that's the format that the JsonConverter I have on the property converts it to.

ChlorideCull avatar Sep 13 '19 13:09 ChlorideCull

@ChlorideCull Yes we currently do not have a way to specify "date" this needs to be fixed. I will get back to you on the ETA for the fix.

Shwetap05 avatar Sep 24 '19 18:09 Shwetap05

@Shwetap05 did you have a chance to get an ETA on this? I've stumbled upon a similar case where I use a string field to circumvent the issue, had some other issues longer down the pipe, so would prefer to just mark date as a format.

Just to show the impact this currently have, I'll add my case here as well. For some reason it detects yyyy-MM-dd as a date in strings, this then behaves as datetime, whom is quite wrong for my application. Have a look yourself.

Our current docs. image

The class image

Example generated from code. image

christopher-bonitz avatar Feb 19 '20 10:02 christopher-bonitz