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

String parameter with format date or date-time should fallback to current date if no example or default is defined. #6791

Open
mathis-m opened this issue Jan 7, 2021 · 0 comments

Comments

@mathis-m
Copy link
Contributor

mathis-m commented Jan 7, 2021

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.0
info:
  version: "{version}"
  title: String parameter with format date or date-time does not render properly
paths:
  /test:
    get:
      parameters: 
        - in: query
          name: afterDate
          schema:
            type: string
            format: date
        - in: query
          name: afterDateTime
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: ""

Describe the bug you're encountering

Should use current date for example value. #5061 (comment)

To reproduce...

Create string schema with format date or date-time and use it as parameter schema.
Steps to reproduce the behavior:

  1. Go to https://editor.swagger.io
  2. Paste yaml
  3. See placeholder not current date,

Expected behavior

Renders current date as default fallback.

@mathis-m mathis-m closed this as completed Jan 7, 2021
@mathis-m mathis-m changed the title String parameter with format date or date-time does not render properly String parameter with format date or date-time should fallback to current date if no example or default is defined. Jan 7, 2021
@mathis-m mathis-m reopened this Jan 7, 2021
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

Successfully merging a pull request may close this issue.

1 participant