Manweill / swagger-axios-codegen

swagger client to use axios and typescript
MIT License
306 stars 83 forks source link

fix: expose string types without a format specification #160

Closed MartinLoeper closed 2 years ago

MartinLoeper commented 2 years ago

It is not required for a type to carry an additional format spec. We are trying to import a swagger API document which does not assign a specific format to its string typed attributes.

Primitives have an optional modifier property: format.

see: https://swagger.io/specification/#data-types see also table in spec stating that: The formats defined by the OAS are: string without any format

Manweill commented 2 years ago

in swagger 2.0, it work?

arkraft commented 2 years ago

Hi Manweill, this was a mistake added by me. I initially wanted to use the format and make it configurable. Like you can use "date" for a Date transformation without time and "date-time" if you need both.

This PR is not breaking, it just removes the requirement for the format option in the swagger file. The format was not even used for the generation of the decorators. So it is required to be there but does not change anything. The PR solves this issue