swagger-api / swagger-api/swagger-ui

string($datetime) as DatePicker

Open
#8,292 0 comments 9 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

When a date comes as a string input and at the same time considering the different ways people type in a string-date. It's just meant to go wrong - especially when the correct date is everything to retrieve data.

My suggestion is that a very simple solution could be implemented. Add class"form-control" and type="date" to the input-tag.
2022-11-10 15_24_32-Window

Which will give:

2022-11-10 15_24_24-Swagger UI

And clicking the calender icon:

2022-11-10 15_29_21-Swagger UI

Thank you 👍🏻

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

Start by locating the DatePicker rendering path for string($datetime) inputs in Swagger UI and inspect the generated input element. Verify the change by opening the affected schema in Swagger UI and confirming that the control uses a date picker and preserves the expected date value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.