-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Python] fix api file name & api var name #11051
Conversation
331fcc1
to
d3c4c54
Compare
org.openapitools.codegen.languages.AbstractPythonCodegen#toApiFilename
this method has some problem
i want modify it to :
but it is incompatible with some situation, |
call for review @taxpon @frol @mbohlool @cbornet @kenjones-cisco @tomplus @Jyhess @spacether |
same to toApiFilename, toApiVarName method also need modify |
377a31a
to
8167527
Compare
@@ -691,10 +688,7 @@ public String toApiName(String name) { | |||
|
|||
@Override | |||
public String toApiVarName(String name) { | |||
if (name.length() == 0) { | |||
return "default_api"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when name length is 0 with your update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after update, it will call method: toApiName(name)
public String toApiName(String name) {
if (name.length() == 0) {
return "DefaultApi";
}
return camelize(apiNamePrefix + "_" + name + "_" + apiNameSuffix);
}
this method will get default name where name length is 0
This PR changes the api file names, making it a breaking change. |
@spacether i can wait for 6.0.0 branch |
UPDATE: I've changed the target branch to 6.0.x |
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x