Repository navigation
Fix java11 date library configuration - #1434
Open
theaprince001 wants to merge 1 commit into
Open
theaprince001 wants to merge 1 commit into
theaprince001 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Thank you for contributing to swagger-codegen-generators!
Description
Fixes the handling of
dateLibrary=java11in Java generators.Previously, although
java11was listed as a supported date library option, selecting it did not correctly configure the Java 11 date and time mappings. As a result, generated models could continue using legacyjava.util.Datetypes instead of Java Time API types.This PR:
dateLibrary=java11inAbstractJavaCodegen.date→LocalDateDateTime→OffsetDateTimejava.timeimport mappings.SpringCodegento enable its Java 11-specific configuration whendateLibrary=java11is selected.Fixes: #1433
Type of Change
Checklist
How to Test
Configure a Java generator with:
Verify that generated model properties use:
LocalDatefor OpenAPIformat: dateOffsetDateTimefor OpenAPIformat: date-timeTests added/updated cover:
AbstractJavaCodegenJava 11 date-library mappings.The relevant tests were executed individually in IntelliJ IDEA and passed.
Note: Maven compilation succeeded, but the existing Maven/Surefire configuration discovered zero tests during
mvn test. This PR does not modify the unrelated test-discovery configuration.Screenshots / Additional Context
No screenshots are required. The changes are covered by automated tests.