forked from loafle/openapi-generator-original
Fix issue #7262 with the parameter name in the path. The problem was that camelCase naming was forced only in this part of the code when everywhere else it is configurable. (#7313)
This commit is contained in:
parent
6c2a583bcd
commit
0a9c6f56c8
@ -1,7 +1,6 @@
|
||||
package io.swagger.codegen.languages;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.StringBuffer;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -258,11 +257,9 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
}
|
||||
|
||||
// Prep a string buffer where we're going to set up our new version of the string.
|
||||
StringBuffer pathBuffer = new StringBuffer();
|
||||
|
||||
// Set up other variables for tracking the current state of the string.
|
||||
StringBuilder pathBuffer = new StringBuilder();
|
||||
StringBuilder parameterName = new StringBuilder();
|
||||
int insideCurly = 0;
|
||||
boolean foundUnderscore = false;
|
||||
|
||||
// Iterate through existing string, one character at a time.
|
||||
for (int i = 0; i < op.path.length(); i++) {
|
||||
@ -279,23 +276,13 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode
|
||||
insideCurly--;
|
||||
|
||||
// Add the more complicated component instead of just the brace.
|
||||
pathBuffer.append(toVarName(parameterName.toString()));
|
||||
pathBuffer.append("))}");
|
||||
break;
|
||||
case '_':
|
||||
// If we're inside the curly brace, the following character will need to be uppercase.
|
||||
// Otherwise, just add the character.
|
||||
if (insideCurly > 0) {
|
||||
foundUnderscore = true;
|
||||
} else {
|
||||
pathBuffer.append(op.path.charAt(i));
|
||||
}
|
||||
parameterName.setLength(0);
|
||||
break;
|
||||
default:
|
||||
// If we previously found an underscore, we need an uppercase letter.
|
||||
// Otherwise, just add the character.
|
||||
if (foundUnderscore) {
|
||||
pathBuffer.append(Character.toUpperCase(op.path.charAt(i)));
|
||||
foundUnderscore = false;
|
||||
if (insideCurly > 0) {
|
||||
parameterName.append(op.path.charAt(i));
|
||||
} else {
|
||||
pathBuffer.append(op.path.charAt(i));
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.0
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.0
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.0
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.0
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.0
|
Loading…
x
Reference in New Issue
Block a user