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

Example times/dates in OpenAPI changed by Redoc #947

Closed
ElizabethM-fourth opened this issue Jun 19, 2019 · 2 comments
Closed

Example times/dates in OpenAPI changed by Redoc #947

ElizabethM-fourth opened this issue Jun 19, 2019 · 2 comments

Comments

@ElizabethM-fourth
Copy link

ElizabethM-fourth commented Jun 19, 2019

Hello,
I have some fields in a response that use a time format. ReDoc is changing the examples in the output. Here's the OpenAPI file:

    ContainerName:
      type: string
      description: Internal filename.
      example: 2018-03-12
    ModifiedDateTime:
      type: string
      description: The day and time the file was last modified in Fourth, in ISO 8601 format.
      example: 2018-03-12T12:43:53

And attached is a screenshot showing how ReDoc is "reinterpreting" my example.

why-redoc-why

This shouldn't happen - the example should obviously show as written, so as to be accurate.

Please let me know if this is something that can/will be resolved.

Thanks, Elizabeth

@RomanHotsiy
Copy link
Member

Wrap you examples in quotes:

    ContainerName:
      type: string
      description: Internal filename.
      example: "2018-03-12"
    ModifiedDateTime:
      type: string
      description: The day and time the file was last modified in Fourth, in ISO 8601 format.
      example: "2018-03-12T12:43:53"

That's caused by yaml special treatment of time strings. There is nothing Redoc can do here.

@ElizabethM-fourth
Copy link
Author

Wrap you examples in quotes:

    ContainerName:
      type: string
      description: Internal filename.
      example: "2018-03-12"
    ModifiedDateTime:
      type: string
      description: The day and time the file was last modified in Fourth, in ISO 8601 format.
      example: "2018-03-12T12:43:53"

That's caused by yaml special treatment of time strings. There is nothing Redoc can do here.

Thanks for the fast reply!

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

No branches or pull requests

2 participants