Skip to content

Commit a9313e7

Browse files
AriehSchneierclaude
andcommitted
Fix GoClientOptionsTest for generateTypeAliasesForDedupedSchemas option
Added the new configuration option to the test suite: - Added GENERATE_TYPE_ALIASES_FOR_DEDUPED_SCHEMAS_VALUE constant - Added option to createOptions() map - Added verification in GoClientOptionsTest This fixes the CI failure where the test was validating that all CLI options are properly tested. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent c8c67cc commit a9313e7

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ protected void verifyOptions() {
5454
verify(clientCodegen).setWithGoMod(GoClientOptionsProvider.WITH_GO_MOD_VALUE);
5555
verify(clientCodegen).setGenerateMarshalJSON(GoClientOptionsProvider.GENERATE_MARSHAL_JSON_VALUE);
5656
verify(clientCodegen).setGenerateUnmarshalJSON(GoClientOptionsProvider.GENERATE_UNMARSHAL_JSON_VALUE);
57+
verify(clientCodegen).setGenerateTypeAliasesForDedupedSchemas(GoClientOptionsProvider.GENERATE_TYPE_ALIASES_FOR_DEDUPED_SCHEMAS_VALUE);
5758
verify(clientCodegen).setUseDefaultValuesForRequiredVars(GoClientOptionsProvider.USE_DEFAULT_VALUES_FOR_REQUIRED_VARS_VALUE);
5859
verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(GoClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE));
5960
}

modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class GoClientOptionsProvider implements OptionsProvider {
3939
public static final boolean WITH_GO_MOD_VALUE = true;
4040
public static final boolean GENERATE_MARSHAL_JSON_VALUE = true;
4141
public static final boolean GENERATE_UNMARSHAL_JSON_VALUE = true;
42+
public static final boolean GENERATE_TYPE_ALIASES_FOR_DEDUPED_SCHEMAS_VALUE = true;
4243
public static final boolean USE_DEFAULT_VALUES_FOR_REQUIRED_VARS_VALUE = true;
4344
public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false";
4445

@@ -64,6 +65,7 @@ public Map<String, String> createOptions() {
6465
.put(CodegenConstants.WITH_GO_MOD, "true")
6566
.put(CodegenConstants.GENERATE_MARSHAL_JSON, "true")
6667
.put(CodegenConstants.GENERATE_UNMARSHAL_JSON, "true")
68+
.put(CodegenConstants.GENERATE_TYPE_ALIASES_FOR_DEDUPED_SCHEMAS, "true")
6769
.put("generateInterfaces", "true")
6870
.put("structPrefix", "true")
6971
.put(CodegenConstants.USE_DEFAULT_VALUES_FOR_REQUIRED_VARS, "true")

0 commit comments

Comments
 (0)