Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go samples #10155

Merged
merged 4 commits into from
Apr 6, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
allow go generator to skip aliases
  • Loading branch information
HugoMario committed Apr 4, 2020
commit 73220d30a976424df418aa1834e6b3b42b03951c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ public int compare(String o1, String o2) {
continue;
}
Map<String, Object> modelTemplate = (Map<String, Object>) ((List<Object>) models.get("models")).get(0);
if (isJavaCodegen(config.getName())) {
if (isAliasVerifierGenerator(config.getName())) {
// Special handling of aliases only applies to Java
if (modelTemplate != null && modelTemplate.containsKey("model")) {
CodegenModel codegenModel = (CodegenModel) modelTemplate.get("model");
Expand Down Expand Up @@ -1112,9 +1112,11 @@ private Map<String, SecurityScheme> getAuthMethods(List<SecurityRequirement> sec
return authMethods;
}

private boolean isJavaCodegen(String name) {
private boolean isAliasVerifierGenerator(String name) {
return name.equalsIgnoreCase("java")
|| name.equalsIgnoreCase("inflector");
|| name.equalsIgnoreCase("inflector")
|| name.equalsIgnoreCase("go")
|| name.equalsIgnoreCase("go-server");
}

private Boolean getCustomOptionBooleanValue(String option) {
Expand Down