forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(OpenAPITools#1423): [JAVA] generating Map with jaxrs-reasteasy do…
…es not import (OpenAPITools#1426) * fix(OpenAPITools#1423): [JAVA] generating Map with jaxrs-reasteasy does not import the hashmap OpenAPITools#1423 * fix(OpenAPITools#1423): fix ensure-up-to-date issues for jaxrs-resteasy joda samples OpenAPITools#1423
- Loading branch information
1 parent
04ea8a0
commit 06e94ee
Showing
14 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
30 changes: 30 additions & 0 deletions
30
...est/java/org/openapitools/codegen/java/jaxrs/JavaJaxrsResteasyServerCodegenModelTest.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package org.openapitools.codegen.java.jaxrs; | ||
|
||
import static org.testng.Assert.assertEquals; | ||
import static org.testng.Assert.assertTrue; | ||
|
||
import java.util.Collections; | ||
|
||
import org.openapitools.codegen.CodegenModel; | ||
import org.openapitools.codegen.languages.JavaResteasyServerCodegen; | ||
import org.testng.annotations.Test; | ||
|
||
import io.swagger.v3.oas.models.media.MapSchema; | ||
import io.swagger.v3.oas.models.media.Schema; | ||
|
||
public class JavaJaxrsResteasyServerCodegenModelTest { | ||
|
||
@Test(description = "convert a simple java model with java8 types") | ||
public void mapModelTest() { | ||
final Schema model = new Schema() | ||
.description("A model with a map") | ||
.addProperties("map", new MapSchema()); | ||
|
||
final JavaResteasyServerCodegen codegen = new JavaResteasyServerCodegen(); | ||
final CodegenModel cm = codegen.fromModel("sample", model, Collections.singletonMap("sample", model)); | ||
|
||
assertEquals(cm.vars.get(0).baseType, "Map"); | ||
assertTrue(cm.imports.contains("HashMap")); | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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