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

Decommission python client generator #15486

Merged
merged 3 commits into from
May 14, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions CI/circle_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ elif [ "$NODE_INDEX" = "3" ]; then
#sudo make altinstall
pyenv install --list
pyenv install 3.7.12
pyenv install 2.7.14
#pyenv install 2.7.14 #python2 no longer supported
pyenv global 3.7.12

# Install node@stable (for angular 6)
Expand All @@ -78,10 +78,10 @@ elif [ "$NODE_INDEX" = "4" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci.node4' defined in pom.xml ..."

#mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
(cd samples/openapi3/client/petstore/python && make test)
#(cd samples/openapi3/client/petstore/python && make test)
# comment out due to ModuleNotFoundError: No module named 'urllib3.request'
#(cd samples/openapi3/client/petstore/python-prior && make test)
(cd samples/openapi3/client/3_0_3_unit_test/python && make test)
#(cd samples/openapi3/client/3_0_3_unit_test/python && make test)

else
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
Expand Down
6 changes: 0 additions & 6 deletions bin/configs/python-features-dynamic-servers.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions bin/configs/python.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions bin/configs/python_3_0_3_unit_test.yaml

This file was deleted.

1 change: 0 additions & 1 deletion docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ The following generators are available:
* [php](generators/php.md)
* [php-dt (beta)](generators/php-dt.md)
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
* [python-nextgen](generators/python-nextgen.md)
* [r](generators/r.md)
* [ruby](generators/ruby.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.config.GlobalSettings;
import org.openapitools.codegen.examples.ExampleGenerator;
import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.languages.RustServerCodegen;
import org.openapitools.codegen.meta.FeatureSet;
import org.openapitools.codegen.meta.GeneratorMetadata;
Expand Down Expand Up @@ -651,9 +650,7 @@ public Map<String, ModelsMap> updateAllModels(Map<String, ModelsMap> objs) {
removeSelfReferenceImports(cm);

if (!this.getLegacyDiscriminatorBehavior()) {
// skip cleaning up mapped models for python client generator
// which uses its own logic
cm.addDiscriminatorMappedModelsImports(!(this instanceof PythonClientCodegen));
cm.addDiscriminatorMappedModelsImports(true);
}
}
}
Expand Down Expand Up @@ -3777,14 +3774,13 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo

Schema original = null;
// check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level
if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1 && !(this instanceof PythonClientCodegen)) {
if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1) {
if (p.getAllOf().get(0) instanceof Schema) {
original = p;
p = (Schema) p.getAllOf().get(0);
} else {
LOGGER.error("Unknown type in allOf schema. Please report the issue via openapi-generator's Github issue tracker.");
}

}

CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.api.TemplateFileType;
import org.openapitools.codegen.ignore.CodegenIgnoreProcessor;
import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import org.openapitools.codegen.model.ApiInfoMap;
Expand Down Expand Up @@ -546,9 +545,8 @@ void generateModels(List<File> files, List<ModelMap> allModels, List<String> unu
ModelMap modelTemplate = modelList.get(0);
if (modelTemplate != null && modelTemplate.getModel() != null) {
CodegenModel m = modelTemplate.getModel();
if (m.isAlias && !(config instanceof PythonClientCodegen)) {
if (m.isAlias) {
// alias to number, string, enum, etc, which should not be generated as model
// for PythonClientCodegen, all aliases are generated as models
continue; // Don't create user-defined classes for aliases
}
}
Expand Down
Loading