Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format:date with example renders time in addition to date #5215

Open
ilya-spv opened this issue Mar 4, 2019 · 1 comment
Open

Format:date with example renders time in addition to date #5215

ilya-spv opened this issue Mar 4, 2019 · 1 comment

Comments

@ilya-spv
Copy link

ilya-spv commented Mar 4, 2019

Q&A (please complete the following information)

  • OS: Windows
  • Browser: Chrome
  • Version: 72
  • Method of installation: visual studio code extension (openapi-designer)
  • Swagger-UI version: [e.g. 3.21.0]
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

I use a visual studio extension to render things on the fly (openapi-designer) and have checked that it uses the latest version of swagger-ui

Example Swagger/OpenAPI definition:

startDate:
   type: string
   format: date
   example: 2018-12-25

Describe the bug you're encountering

There was recently a pull request to make automatic example if it is not present. That works fine, but when I have my own example, then the rendered date for some reason includes timestamp as well:

"startDate": "2018-12-25T00:00:00.000Z",

To reproduce...

  1. Render YAML with type: string and format: date
  2. Open an example value in the browser

Expected behavior

Expected to see only date in example

"startDate": "2018-12-25",
@shockey
Copy link
Contributor

shockey commented Mar 6, 2019

Indeed, the specification is pretty clear on this.

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

No branches or pull requests

3 participants