Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -258,11 +257,9 @@ public Map<String, Object> postProcessOperations(Map<String, Object> operations)
}

// 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++) {
Expand All @@ -279,23 +276,13 @@ public Map<String, Object> postProcessOperations(Map<String, Object> operations)
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));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
2.3.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
2.3.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
2.3.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
2.3.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0-SNAPSHOT
2.3.0