GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: support Java 8 date/time formats per OpenAPI Formats Registry (#5172) by kuntal1461 · Pull Request #5184 · swagger-api/swagger-core Conversation
Contributor
DescriptionFixes #5172 Java 8 introduced What was wrong
Why not just fix everything as the default?
What this PR doesFixed by default (no user action required):
Opt-in via
// Add once at application startup to get fully correct OpenAPI Formats Registry mappings PrimitiveType.enableJava8Formats(); This follows the same opt-in pattern already established by
Migration pathNew schema model classes (swagger-models)
Each follows the same structure as the existing Type of Change
Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
…gistry (swagger-api#5172) - Add DateTimeLocalSchema, TimeSchema, TimeLocalSchema, DurationSchema model classes - Map java.time.OffsetTime → format "time" by default (was incorrect complex object) - Map java.time.Duration → format "duration" by default (was incorrect complex object) - Add PrimitiveType.enableJava8Formats() opt-in to map: java.time.LocalDateTime → "date-time-local" java.time.LocalTime → "time-local" - Deprecate enablePartialTime() in favour of enableJava8Formats() - Add Java8DateFormatsTest and TestObjectJava8Dates covering default and opt-in behaviour LocalDateTime and LocalTime are opt-in only to preserve backward compatibility. The default will change in the next major version. Authored-By: Kuntal Maity <[email protected]>
|
There was an error while loading. Please reload this page.
|
@kuntal1461 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This one also fixes: #4404 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@kuntal1461 thanks for the PR! We really appreciate you taking the time to contribute to the project. Great work! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
upgrade swagger-core from 2.2.53 to 2.2.54 swagger-core now resolves java.time.Duration, LocalTime and OffsetTime itself (swagger-api/swagger-core#5184), so the corresponding entries of initExtraSchemas can be dropped.
swagger-core now resolves java.time.Duration, LocalTime and OffsetTime itself (swagger-api/swagger-core#5184), so the corresponding entries of initExtraSchemas can be dropped.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
[Feature]: Support for Java 8 date formats
There was an error while loading. Please reload this page.