Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Property examples are converted to the wrong date format #85

Open
mthaak opened this issue Feb 1, 2023 · 0 comments
Open

Property examples are converted to the wrong date format #85

mthaak opened this issue Feb 1, 2023 · 0 comments

Comments

@mthaak
Copy link

mthaak commented Feb 1, 2023

Version: 4.0.4

I have a property with this specification in index.yml:

endDate:
  description: End date of the data point (inclusive).
  example: 2022-01-31
  type: string
  format: date

When running swagger-cli bundle openapi/index.yml --type json -o openapi/openapi-spec.json the resulting JSON file contains:

"endDate": {
  "description": "End date of the data point (inclusive).",
  "example": "2022-01-31T00:00:00.000Z",
  "type": "string",
  "format": "date"
},

Note how the example is converted to a full ISO-8601 datetime string.

This is breaking validation in another tool I'm using. Because if format: date, then the example must be an ISO-8601 date like 2023-01-01.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant