-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix overriding imports #702
Conversation
@@ -1368,7 +1368,7 @@ private ModelsMap postProcessModelsMap(ModelsMap objs) { | |||
modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); | |||
} | |||
|
|||
model.getVendorExtensions().putIfAbsent("x-py-model-imports", modelsToImport); | |||
model.getVendorExtensions().put("x-py-model-imports", modelsToImport); |
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.
The method putIfAbsent
does nothing because the value is set in AbstractPythonCodegen.java at line 1022, which is called by PythonNextgenCustomClientGenerator.java at line 1085.
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.
The other parts will be fixed in #703.
Thank you! Let me approve this change after #704 is merged, and run the new job by fetching the change into this PR. If there is no extra changes(= this change doesn't forget committing some files), it's ok for me. |
This wil be merged after #702. ## Changes As mentioned in #702 (comment), `putIfAbsent` does not overwrite values, so it is meaningless. This change is intended to correct all instances where it is used, although it currently does not affect the generated codes. --------- Co-authored-by: Yuta Kasai <[email protected]>
This resolves #698.