Skip to content

Commit

Permalink
fix: forbid using function overload in one Class in case of unpredict…
Browse files Browse the repository at this point in the history
…able bugs
  • Loading branch information
杨乾军 authored and yangqianjun committed Nov 2, 2020
1 parent 7b1e127 commit cf09fd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3143,6 +3143,7 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera
if(uniqueName.equals(op.operationId)) {
uniqueName = co.operationId + "_" + counter;
counter ++;
throw new RuntimeException("it's dangerous to overload \"" + op.nickname + "\", with path " + op.path);
}
}
if(!co.operationId.equals(uniqueName)) {
Expand Down Expand Up @@ -3956,6 +3957,7 @@ public void setIgnoreFilePathOverride(final String ignoreFileOverride) {

public boolean convertPropertyToBoolean(String propertyKey) {
boolean booleanValue = false;

if (additionalProperties.containsKey(propertyKey)) {
booleanValue = Boolean.valueOf(additionalProperties.get(propertyKey).toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ protected Map<String, Object> processOperations(CodegenConfig config, String tag
if (opIds.contains(opId)) {
counter++;
op.nickname += "_" + counter;
throw new RuntimeException("it's dangerous to overload \"" + op.nickname + "\", with path " + op.path);
}
opIds.add(opId);
}
Expand Down

0 comments on commit cf09fd3

Please sign in to comment.