File tree Expand file tree Collapse file tree
modules/openapi-generator/src/test
java/org/openapitools/codegen/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -552,6 +552,24 @@ public void testSupportedSecuritySchemesJersey() {
552552 .contains ("@Pattern" , "import jakarta.validation.constraints.*" );
553553 }
554554
555+ @ Test public void testJersey3JacksonWithTypeFormat () {
556+ final Path output = newTempFolder ();
557+ final CodegenConfigurator configurator = new CodegenConfigurator ()
558+ .setGeneratorName ("java" )
559+ .setLibrary (JERSEY3 )
560+ .addAdditionalProperty (CodegenConstants .MODEL_PACKAGE , "xyz.abcdef.model" )
561+ .addAdditionalProperty (JavaClientCodegen .USE_JAKARTA_EE , true )
562+ .addAdditionalProperty (CodegenConstants .SERIALIZATION_LIBRARY , JavaClientCodegen .SERIALIZATION_LIBRARY_JACKSON )
563+ .setInputSpec ("src/test/resources/3_1/java/java-type-with-format.yaml" )
564+ .setOutputDir (output .toString ().replace ("\\ " , "/" ));
565+
566+ List <File > files = new DefaultGenerator ().opts (configurator .toClientOptInput ()).generate ();
567+
568+ validateJavaSourceFiles (files );
569+ assertThat (output .resolve ("src/main/java/xyz/abcdef/model/DataResponse.java" )).content ()
570+ .contains ("TRUE(Boolean.valueOf(\" true\" ))" );
571+ }
572+
555573 @ Test public void testJdkHttpClientWithAndWithoutDiscriminator () {
556574 final Path output = newTempFolder ();
557575 final CodegenConfigurator configurator = new CodegenConfigurator ()
Original file line number Diff line number Diff line change 1+ openapi : 3.1.0
2+ info :
3+ version : 1.0.0
4+ description : Specification to reproduce incorrectly generated Java code when using formats
5+ title : FormatTest Api
6+ paths :
7+ /format-test :
8+ get :
9+ tags :
10+ - test
11+ responses :
12+ ' 200 ' :
13+ description : OK
14+ content :
15+ application/json :
16+ schema :
17+ $ref : " #/components/schemas/data-response"
18+ components :
19+ schemas :
20+ data-response :
21+ type : object
22+ title : Response
23+ properties :
24+ id :
25+ type : string
26+ flag :
27+ type : boolean
28+ enum :
29+ - true
You can’t perform that action at this time.
0 commit comments