swagger-api / swagger-api/swagger-ui

Date example show incorrect result

Open
#5,744 13 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Q&A (please complete the following information)
  • OS: macOS
  • Browser:chrome
  • Version: 78
  • Method of installation: dist assets
  • Swagger-UI version: 3.24.3 and http://editor.swagger.io/
  • Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration

Example Swagger/OpenAPI definition:

 properties:
        checkInDate:
          title: Date in ISO8201 format
          type: string
          format: date
          example: 2019-02-01
Describe the bug you're encountering

Following the specification i should see correct example in UI "checkInDate": "2019-02-01" but instead i see "checkInDate": {}

In schema block i see:
example: OrderedMap {}

Expected behavior

Correct property example in dto object in request body

"checkInDate": "2019-02-01"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the supplied OpenAPI 3.0 schema in Swagger UI 3.24.3 using the dist assets or editor, then inspect the schema block and request-body example rendering. Done means the date example appears as "checkInDate": "2019-02-01" rather than an empty object.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.