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

Use a format for Date when relevant. #1531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbarnach
Copy link
Member

Description

Implement a better generation of the OpenAPI date type through the use of format for String.
It is defined by: https://swagger.io/docs/specification/data-models/data-types/#string

Use date-time for iso8601.
Use date-time for custom RFC3339 date-time.
Use date for custom RFC3339 full-date.

Motivation and Context

There has been issues reported with the date serialization with Kitura (#1529 )
The proper generation should allow for a better mocup generation also, which is always important when making your own server.

How Has This Been Tested?

The tests for Date in OpenAPI have been extended to include:

  • iso8601 case if the platform supports it.
  • The standard RFC3339 date time case through a date formatter.
  • The standard RFC3339 full date (date only, no time) case through a date formatter.

Checklist:

  • If applicable, I have updated the documentation accordingly. <- I haven't found any specific documentation, but this is a better respect of the standard, so I assume this is implicit?
  • If applicable, I have added tests to cover my changes.

Use `date-time` for iso8601.
Use `date-time` for custom RFC3339 `date-time`.
Use `date` for custom RFC3339 `full-date`.
@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 4 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mbarnach mbarnach linked an issue Oct 13, 2020 that may be closed by this pull request
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 this pull request may close these issues.

Exported OpenApi uses unexpected type for date.
2 participants