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

Better handling of operationID starting with numbers #691

Merged
merged 12 commits into from
Aug 1, 2018
Prev Previous commit
Next Next commit
defer camelize in operationid
wing328 committed Aug 1, 2018
commit c18634e0030411e12aa59c8a7b24a3a4d8505a5e
Original file line number Diff line number Diff line change
@@ -606,7 +606,7 @@ public String toOperationId(String operationId) {
// operationId starts with a number
if (operationId.matches("^\\d.*")) {
LOGGER.warn(operationId + " (starting with a number) cannot be used as method name. Renamed to " + camelize(sanitizeName("call_" + operationId)));
operationId = camelize("call_" + operationId);
operationId = "call_" + operationId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not sanitizing here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure to understand, this is just about adding the call_ prefix. The value will be sanitized on line 612: return camelize(sanitizeName(operationId));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my bad, didnt see that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmini is correct. It was already sanitized a few lines above and that's the reason why I didn't call the function sanitize again when the operationId starts with a number.

}

return camelize(sanitizeName(operationId));