yahehe / Nancy.Swagger

Nancy plugin for generated API documentation in Swagger format.
MIT License
133 stars 60 forks source link

DateTimeOffset as string in Model #123

Open farfush opened 7 years ago

farfush commented 7 years ago

Hi All,

Once again, thanks for the great library. Have question. What do you think about adding CLR DateTimeOffset type as string-date-time to swagger primitives mapping? https://github.com/yahehe/Nancy.Swagger/blob/a29dfc2bdedf7b47e577f6d68666f4ae9f43b96b/src/Swagger.ObjectModel/Primitive.cs#L28

For swagger, this type should be treated the same as regular DateTime.

Thoughts? If you accept such a change - I will love to send a PR.

Cheers

jnallard commented 7 years ago

I don't see anything wrong with it.

(You could also add a SwaggerTypeMapping from DateTimeOffset to DateTime in the meantime)

yahehe commented 7 years ago

Sounds good to me!