Skip to content

Commit f51c2ff

Browse files
committed
fix: un-default RESOLVE_INLINE_ENUMS and put it into the test call
1 parent f4f57d9 commit f51c2ff

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ public GoClientCodegen() {
113113
outputFolder = "generated-code/go";
114114
embeddedTemplateDir = templateDir = "go";
115115

116-
// We need inline enums to be resolved to a separate model
117-
inlineSchemaOption.put("RESOLVE_INLINE_ENUMS", "true");
118-
119116
apiTemplateFiles.put("api.mustache", ".go");
120117
modelTemplateFiles.put("model.mustache", ".go");
121118
apiTestTemplateFiles.put("api_test.mustache", ".go");

modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientCodegenTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void testMultipleRequiredPropertiesHasSameOneOfObject() throws IOExceptio
174174
files.forEach(File::deleteOnExit);
175175

176176
Path docFile = Paths.get(output + "/docs/PetAPI.md");
177-
TestUtils.assertFileContains(docFile, "openapiclient.pet{Cat: openapiclient.NewCat(openapiclient.cat_attr(\"CAT\"))}, openapiclient.pet{Cat: openapiclient.NewCat(openapiclient.cat_attr(\"CAT\"))}, openapiclient.pet{Cat: openapiclient.NewCat(openapiclient.cat_attr(\"CAT\"))}");
177+
TestUtils.assertFileContains(docFile, "openapiclient.pet{Cat: openapiclient.NewCat(\"Attr_example\")}, openapiclient.pet{Cat: openapiclient.NewCat(\"Attr_example\")}, openapiclient.pet{Cat: openapiclient.NewCat(\"Attr_example\")}");
178178
}
179179

180180
@Test
@@ -406,6 +406,7 @@ public void testInlineEnums_issue9567() throws Exception {
406406
.setGeneratorName("go")
407407
.setInputSpec("src/test/resources/bugs/issue_9567.yaml")
408408
.setOutputDir(output.getAbsolutePath().replace("\\", "/"))
409+
.addInlineSchemaOption("RESOLVE_INLINE_ENUMS", "true")
409410
.addAdditionalProperty(GoClientCodegen.WITH_GO_MOD, false);
410411

411412
DefaultGenerator generator = new DefaultGenerator();

0 commit comments

Comments
 (0)