diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index bf978974033..ba74896a1ed 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -329,134 +329,72 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { @Override public String toModelImport(String name) { - // name looks like cat.Cat - String moduleName = name.split("\\.")[0]; - // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - return "from " + modelPackage() + " import "+ moduleName; - } - - private String robustImport(String name) { - // name looks like cat.Cat - String moduleName = name.split("\\.")[0]; - // https://exceptionshub.com/circular-or-cyclic-imports-in-python.html - String modelImport = "try:\n from " + modelPackage() + - " import " + moduleName+ "\nexcept ImportError:\n " + - moduleName + " = sys.modules[\n '" + modelPackage() + "." + moduleName + "']"; - return modelImport; - } - - private String getPythonClassName(String name) { - // name looks like cat.Cat or Cat - String[] pieces = name.split("\\."); - if (pieces.length == 1) { - return pieces[0]; - } - return pieces[1]; - } - - private void fixOperationImports(Set imports) { - if (imports.size() == 0) { - return; - } - String[] modelNames = imports.toArray(new String[0]); - imports.clear(); - // loops through imports and converts them all from 'module.Class' to 'from models.module import module' - for (String modelName : modelNames) { - // if a modelName lacks the module (Pet) then we convert it to pet.Pet - if (modelName.indexOf(".") == -1) { - modelName = toModelName(modelName); - } - imports.add(toModelImport(modelName)); - } + // name looks like Cat + return "from " + modelPackage() + "." + toModelFilename(name) + " import "+ name; } @Override @SuppressWarnings("static-method") public Map postProcessOperationsWithModels(Map objs, List allModels) { + // fix the imports that each model has, add the module reference to the model + // loops through imports and converts them all + // from 'Pet' to 'from petstore_api.model.pet import Pet' + HashMap val = (HashMap)objs.get("operations"); ArrayList operations = (ArrayList) val.get("operation"); ArrayList> imports = (ArrayList>)objs.get("imports"); - imports.clear(); for (CodegenOperation operation : operations) { - fixOperationImports(operation.imports); - for (String thisImport : operation.imports) { - HashMap higherImport = new HashMap(); - higherImport.put("import", thisImport); - if (!imports.contains(higherImport)) { - imports.add(higherImport); - } + if (operation.imports.size() == 0) { + continue; + } + String[] modelNames = operation.imports.toArray(new String[0]); + operation.imports.clear(); + for (String modelName : modelNames) { + operation.imports.add(toModelImport(modelName)); } } return objs; } - private void fixModelImports(Set imports) { - // loops through imports and converts them all from 'module.Class' to 'import models.module as module' - if (imports.size() == 0) { - return; - } - String[] modelNames = imports.toArray(new String[0]); - imports.clear(); - for (String modelName : modelNames) { - imports.add(robustImport(modelName)); - } - } - /** * Override with special post-processing for all models. */ @SuppressWarnings({"static-method", "unchecked"}) public Map postProcessAllModels(Map objs) { + super.postProcessAllModels(objs); + // loop through all models and delete ones where type!=object and the model has no validations and enums // we will remove them because they are not needed Map modelSchemasToRemove = new HashMap(); - for (Map.Entry entry : objs.entrySet()) { - Map inner = (Map) entry.getValue(); - List> models = (List>) inner.get("models"); - for (Map mo : models) { - CodegenModel cm = (CodegenModel) mo.get("model"); - // make sure discriminator models are included in imports - CodegenDiscriminator discriminator = cm.discriminator; - if (discriminator != null) { - Set mappedModels = discriminator.getMappedModels(); - for (CodegenDiscriminator.MappedModel mappedModel : mappedModels) { - String otherModelName = mappedModel.getModelName(); - cm.imports.add(otherModelName); - } - } - - // add imports for anyOf, allOf, oneOf - ArrayList> composedSchemaSets = new ArrayList>(); - composedSchemaSets.add(cm.allOf); - composedSchemaSets.add(cm.anyOf); - composedSchemaSets.add(cm.oneOf); - for (Set importSet : composedSchemaSets) { - for (String otherModelName : importSet) { - if (!languageSpecificPrimitives.contains(otherModelName)) { - cm.imports.add(otherModelName); - } - } - } - - Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name); - CodegenProperty modelProperty = fromProperty("value", modelSchema); - - // import complex type from additional properties - // TODO can I remove this? DOes it exist in defaultcodegen? - if (cm.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { - cm.imports.add(modelProperty.items.complexType); - } - - // fix the imports that each model has, change them to absolute - fixModelImports(cm.imports); + for (Object objModel: objs.values()) { + HashMap hmModel = (HashMap) objModel; + List> models = (List>) hmModel.get("models"); + for (Map model : models) { + CodegenModel cm = (CodegenModel) model.get("model"); + // remove model if it is a primitive with no validations if (cm.isEnum || cm.isAlias) { + Schema modelSchema = ModelUtils.getSchema(this.openAPI, cm.name); + CodegenProperty modelProperty = fromProperty("_value", modelSchema); if (!modelProperty.isEnum && !modelProperty.hasValidation && !cm.isArrayModel) { // remove these models because they are aliases and do not have any enums or validations modelSchemasToRemove.put(cm.name, modelSchema); + continue; } } + + // fix model imports + if (cm.imports.size() == 0) { + continue; + } + String[] modelNames = cm.imports.toArray(new String[0]); + cm.imports.clear(); + for (String modelName : modelNames) { + cm.imports.add(toModelImport(modelName)); + String globalImportFixer = "globals()['" + modelName + "'] = " + modelName; + cm.imports.add(globalImportFixer); + } } } @@ -550,9 +488,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { if (modelProp.isPrimitiveType && (modelProp.hasValidation || modelProp.isEnum)) { String simpleDataType = result.dataType; result.dataType = toModelName(modelName); - result.baseType = getPythonClassName(result.dataType); - imports.remove(modelName); - imports.add(result.dataType); + result.baseType = result.dataType; // set the example value if (modelProp.isEnum) { String value = modelProp._enum.get(0).toString(); @@ -560,9 +496,6 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { } else { result.example = result.dataType + "(" + result.example + ")"; } - } else if (!result.isPrimitiveType) { - // fix the baseType for the api docs so the .md link to the class's documentation file is correct - result.baseType = getPythonClassName(result.baseType); } return result; } @@ -591,7 +524,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { if (responseSchema != null) { CodegenProperty cp = fromProperty("response", responseSchema); if (cp.complexType != null) { - String modelName = getPythonClassName(cp.complexType); + String modelName = cp.complexType; Schema modelSchema = ModelUtils.getSchema(this.openAPI, modelName); if (modelSchema != null && !"object".equals(modelSchema.getType())) { CodegenProperty modelProp = fromProperty("response", modelSchema); @@ -604,19 +537,16 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { if (cp.isEnum == true || cp.hasValidation == true) { // this model has validations and/or enums so we will generate it Schema sc = ModelUtils.getSchemaFromResponse(response); - newBaseType = ModelUtils.getSimpleRef(sc.get$ref()); + newBaseType = toModelName(ModelUtils.getSimpleRef(sc.get$ref())); } } } CodegenResponse result = super.fromResponse(responseCode, response); if (newBaseType != null) { - result.dataType = toModelName(newBaseType); + result.dataType = newBaseType; // baseType is used to set the link to the model .md documentation - result.baseType = getPythonClassName(newBaseType); - } else if (!result.primitiveType) { - // fix the baseType for the api docs so the .md link to the class's documentation file is correct - result.baseType = getPythonClassName(result.baseType); + result.baseType = newBaseType; } return result; @@ -734,28 +664,18 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { public void postProcessModelProperty(CodegenModel model, CodegenProperty p) { postProcessPattern(p.pattern, p.vendorExtensions); // set property.complexType so the model docs will link to the ClassName.md - if (p.complexType != null && !languageSpecificPrimitives.contains(p.complexType)) { - p.complexType = getPythonClassName(p.complexType); - } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { + if (p.complexType == null && p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { // fix ListContainers - p.complexType = getPythonClassName(p.mostInnerItems.complexType); - } - // if a model has a property that is of type self, remove the module name from the dataType - if (p.complexType != null && p.dataType.contains(model.classname)) { - String classNameNoModule = getPythonClassName(model.classname); - p.dataType = p.dataType.replace(model.classname, classNameNoModule); + p.complexType = p.mostInnerItems.complexType; } } @Override public void postProcessParameter(CodegenParameter p) { postProcessPattern(p.pattern, p.vendorExtensions); - // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives if (p.baseType != null && languageSpecificPrimitives.contains(p.baseType)){ + // set baseType to null so the api docs will not point to a model for languageSpecificPrimitives p.baseType = null; - } else if (p.isListContainer && p.mostInnerItems.complexType != null && !languageSpecificPrimitives.contains(p.mostInnerItems.complexType)) { - // fix ListContainers - p.baseType = getPythonClassName(p.mostInnerItems.complexType); } } @@ -810,6 +730,18 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { } } + /** + * Sets the value of the 'model.parent' property in CodegenModel + * We have a custom version of this function so we can add the dataType on the ArrayModel + */ + @Override + protected void addParentContainer(CodegenModel model, String name, Schema schema) { + super.addParentContainer(model, name, schema); + + List referencedModelNames = new ArrayList(); + model.dataType = getTypeString(schema, "", "", referencedModelNames); + } + /** * Convert OAS Model object to Codegen Model object * @@ -906,22 +838,11 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { } } - // use this to store the model name like Cat - // we can't use result.name because that is used to lookup models in the spec - // we can't use result.classname because that stores cat.Cat - // we can't use result.classVarName because that stores the variable for making example instances - result.unescapedDescription = simpleModelName(name); - // this block handles models which have the python base class ModelSimple // which are responsible for storing validations, enums, and an unnamed value Schema modelSchema = ModelUtils.getSchema(this.openAPI, result.name); CodegenProperty modelProperty = fromProperty("_value", modelSchema); - // import complex type from additional properties - if (result.additionalPropertiesType != null && modelProperty.items != null && modelProperty.items.complexType != null) { - result.imports.add(modelProperty.items.complexType); - } - Boolean isPythonModelSimpleModel = (result.isEnum || result.isArrayModel || result.isAlias && modelProperty.hasValidation); if (isPythonModelSimpleModel) { // In python, classes which inherit from our ModelSimple class store one value, @@ -941,12 +862,6 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { result.defaultValue = modelProperty.defaultValue; } } else { - if (result.isArrayModel && modelProperty.dataType != null && result.dataType == null) { - // needed for array models with complex types - result.dataType = modelProperty.dataType; - result.arrayModelType = getPythonClassName(result.arrayModelType); - } - if (result.defaultValue == null) { result.hasRequired = true; } @@ -973,7 +888,7 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { } cp.isPrimitiveType = false; String modelName = propertyToModelName.get(cp.name); - cp.complexType = getPythonClassName(modelName); + cp.complexType = modelName; cp.dataType = modelName; cp.isEnum = false; cp.hasValidation = false; @@ -1061,6 +976,18 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { return oasType; } + public Boolean modelWillBeMade(Schema s) { + // only invoke this on $refed schemas + if (ModelUtils.isComposedSchema(s) || ModelUtils.isArraySchema(s) || ModelUtils.isObjectSchema(s)) { + return true; + } + CodegenProperty cp = fromProperty("_model", s); + if (cp.isEnum || cp.hasValidation) { + return true; + } + return false; + } + /** * Return a string representation of the Python types for the specified OAS schema. * Primitive types in the OAS specification are implemented in Python using the corresponding @@ -1091,12 +1018,12 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { // The input schema is a reference. If the resolved schema is // a composed schema, convert the name to a Python class. Schema s = ModelUtils.getReferencedSchema(this.openAPI, p); - if (s instanceof ComposedSchema) { - String modelName = ModelUtils.getSimpleRef(p.get$ref()); + if (modelWillBeMade(s)) { + String modelName = toModelName(ModelUtils.getSimpleRef(p.get$ref())); if (referencedModelNames != null) { referencedModelNames.add(modelName); } - return prefix + toModelName(modelName) + fullSuffix; + return prefix + modelName + fullSuffix; } } if (isAnyTypeSchema(p)) { @@ -1246,55 +1173,4 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { p.example = example; } - - private String simpleModelName(String name) { - // this returns a model name like Cat - String modelName = sanitizeName(name); - // remove dollar sign - modelName = modelName.replaceAll("$", ""); - - // model name cannot use reserved keyword, e.g. return - if (isReservedWord(modelName)) { - LOGGER.warn(modelName + " (reserved word) cannot be used as model name. Renamed to " + camelize("model_" + modelName)); - modelName = "model_" + modelName; // e.g. return => ModelReturn (after camelize) - } - - // model name starts with number - if (modelName.matches("^\\d.*")) { - LOGGER.warn(modelName + " (model name starts with number) cannot be used as model name. Renamed to " + camelize("model_" + modelName)); - modelName = "model_" + modelName; // e.g. 200Response => Model200Response (after camelize) - } - - if (!StringUtils.isEmpty(modelNamePrefix)) { - modelName = modelNamePrefix + "_" + modelName; - } - - if (!StringUtils.isEmpty(modelNameSuffix)) { - modelName = modelName + "_" + modelNameSuffix; - } - - // camelize the model name - // phone_number => PhoneNumber - return camelize(modelName); - } - - - @Override - public String toModelFilename(String name) { - // underscore the model file name - // PhoneNumber => phone_number - return underscore(dropDots(simpleModelName(name))); - } - - @Override - public String toModelName(String name) { - // we have a custom version of this function so we can support circular references in python 2 and 3 - return toModelFilename(name)+"."+simpleModelName(name); - } - - @Override - public String toModelDocFilename(String name) { - // this is used to generate the model's .md documentation file - return simpleModelName(name); - } } diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index b996e676d11..d3844fd15fa 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -47,7 +47,7 @@ Class | Method | HTTP request | Description ## Documentation For Models -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{unescapedDescription}}}.md) +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) {{/model}}{{/models}} ## Documentation For Authorization diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache index abe69dc0350..5a2f25f8754 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/__init__models.mustache @@ -13,6 +13,6 @@ {{#models}} {{#model}} -from {{modelPackage}}.{{classFilename}} import {{unescapedDescription}} +from {{modelPackage}}.{{classFilename}} import {{classname}} {{/model}} {{/models}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache index ad7d5ddb31b..1a181b824d1 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model.mustache @@ -24,7 +24,11 @@ from {{packageName}}.model_utils import ( # noqa: F401 {{#models}} {{#model}} {{#imports}} -{{{.}}} +{{#-first}} + +def lazy_import(): +{{/-first}} + {{{.}}} {{/imports}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache index 5186e6621fb..ed121c5bfe8 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache @@ -64,20 +64,41 @@ {{/optionalVars}} } - additional_properties_type = {{#additionalPropertiesType}}({{{additionalPropertiesType}}},) # noqa: E501{{/additionalPropertiesType}}{{^additionalPropertiesType}}None{{/additionalPropertiesType}} +{{#additionalPropertiesType}} + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} + return ({{{additionalPropertiesType}}},) # noqa: E501 +{{/additionalPropertiesType}} +{{^additionalPropertiesType}} + additional_properties_type = None +{{/additionalPropertiesType}} _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} return { {{#isAlias}} 'value': ({{{dataType}}},), @@ -98,7 +119,20 @@ @cached_property def discriminator(): - {{^discriminator}}return None{{/discriminator}}{{#discriminator}}val = { +{{^discriminator}} + return None +{{/discriminator}} +{{#discriminator}} +{{#mappedModels}} +{{#-first}} +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} +{{/-first}} +{{/mappedModels}} + val = { {{#mappedModels}} '{{mappingName}}': {{{modelName}}}, {{/mappedModels}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache index 7e9e86cbfc2..dd61b23c793 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_composed.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelComposed): +class {{classname}}(ModelComposed): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -35,6 +35,11 @@ class {{unescapedDescription}}(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading +{{#imports}} +{{#-first}} + lazy_import() +{{/-first}} +{{/imports}} return { 'anyOf': [ {{#anyOf}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache index 21254c55d17..af130c66a74 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_normal.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelNormal): +class {{classname}}(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache index 1623ca5f6e0..0b7d1860ddf 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/model_simple.mustache @@ -1,4 +1,4 @@ -class {{unescapedDescription}}(ModelSimple): +class {{classname}}(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index ab30c2dcb0f..400cfe3509d 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -33,9 +33,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java index c627add9424..6b04f30cb6e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientExperimentalTest.java @@ -40,19 +40,19 @@ public class PythonClientExperimentalTest { codegen.setOpenAPI(openAPI); final CodegenModel simpleName = codegen.fromModel("v1beta3.Binding", openAPI.getComponents().getSchemas().get("v1beta3.Binding")); Assert.assertEquals(simpleName.name, "v1beta3.Binding"); - Assert.assertEquals(simpleName.classname, "v1beta3_binding.V1beta3Binding"); + Assert.assertEquals(simpleName.classname, "V1beta3Binding"); Assert.assertEquals(simpleName.classVarName, "v1beta3_binding"); codegen.setOpenAPI(openAPI); final CodegenModel compoundName = codegen.fromModel("v1beta3.ComponentStatus", openAPI.getComponents().getSchemas().get("v1beta3.ComponentStatus")); Assert.assertEquals(compoundName.name, "v1beta3.ComponentStatus"); - Assert.assertEquals(compoundName.classname, "v1beta3_component_status.V1beta3ComponentStatus"); + Assert.assertEquals(compoundName.classname, "V1beta3ComponentStatus"); Assert.assertEquals(compoundName.classVarName, "v1beta3_component_status"); final String path = "/api/v1beta3/namespaces/{namespaces}/bindings"; final Operation operation = openAPI.getPaths().get(path).getPost(); final CodegenOperation codegenOperation = codegen.fromOperation(path, "get", operation, null); - Assert.assertEquals(codegenOperation.returnType, "v1beta3_binding.V1beta3Binding"); + Assert.assertEquals(codegenOperation.returnType, "V1beta3Binding"); Assert.assertEquals(codegenOperation.returnBaseType, "V1beta3Binding"); } @@ -71,7 +71,7 @@ public class PythonClientExperimentalTest { final CodegenModel cm = codegen.fromModel("sample", schema); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 3); @@ -119,7 +119,7 @@ public class PythonClientExperimentalTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 2); @@ -159,7 +159,7 @@ public class PythonClientExperimentalTest { final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); @@ -176,48 +176,60 @@ public class PythonClientExperimentalTest { @Test(description = "convert a model with complex property") public void complexPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") - .addProperties("children", new Schema().$ref("#/definitions/Children")); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .addProperties("children", new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); - Assert.assertEquals(property1.dataType, "children.Children"); + Assert.assertEquals(property1.dataType, "Children"); Assert.assertEquals(property1.name, "children"); - Assert.assertEquals(property1.baseType, "children.Children"); + Assert.assertEquals(property1.baseType, "Children"); Assert.assertFalse(property1.required); Assert.assertFalse(property1.isContainer); } @Test(description = "convert a model with complex list property") public void complexListPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") .addProperties("children", new ArraySchema() - .items(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .items(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "[children.Children]"); + Assert.assertEquals(property1.dataType, "[Children]"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "list"); Assert.assertEquals(property1.containerType, "array"); @@ -227,25 +239,31 @@ public class PythonClientExperimentalTest { @Test(description = "convert a model with complex map property") public void complexMapPropertyTest() { + final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); + OpenAPI openAPI = TestUtils.createOpenAPI(); final Schema model = new Schema() .description("a sample model") .addProperties("children", new MapSchema() - .additionalProperties(new Schema().$ref("#/definitions/Children"))); - final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + .additionalProperties(new Schema().$ref("#/components/schemas/Children"))); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a sample model"); Assert.assertEquals(cm.vars.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("children.Children")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); final CodegenProperty property1 = cm.vars.get(0); Assert.assertEquals(property1.baseName, "children"); Assert.assertEquals(property1.complexType, "Children"); - Assert.assertEquals(property1.dataType, "{str: (children.Children,)}"); + Assert.assertEquals(property1.dataType, "{str: (Children,)}"); Assert.assertEquals(property1.name, "children"); Assert.assertEquals(property1.baseType, "dict"); Assert.assertEquals(property1.containerType, "map"); @@ -257,38 +275,48 @@ public class PythonClientExperimentalTest { // should not start with 'null'. need help from the community to investigate further @Test(description = "convert an array model") public void arrayModelTest() { - final Schema model = new ArraySchema() - //.description() - .items(new Schema().$ref("#/definitions/Children")) - .description("an array model"); final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema model = new ArraySchema() + .items(new Schema().$ref("#/components/schemas/Children")) + .description("an array model"); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", model); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); + final CodegenModel cm = codegen.fromModel("sample", model); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.classVarName, "sample"); Assert.assertEquals(cm.description, "an array model"); Assert.assertEquals(cm.vars.size(), 0); // the array model has no vars Assert.assertEquals(cm.parent, "list"); Assert.assertEquals(cm.imports.size(), 1); - Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("children.Children")).size(), 1); + Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("Children")).size(), 1); } // should not start with 'null'. need help from the community to investigate further @Test(description = "convert a map model") public void mapModelTest() { - final Schema model = new Schema() - .description("a map model") - .additionalProperties(new Schema().$ref("#/definitions/Children")); final DefaultCodegen codegen = new PythonClientExperimentalCodegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); + OpenAPI openAPI = TestUtils.createOpenAPI(); + final Schema sample = new Schema() + .description("a map model") + .additionalProperties(new Schema().$ref("#/components/schemas/Children")); + final Schema children = new Schema() + .type("object") + .addProperties("number", new Schema().type("integer")); + openAPI.getComponents().addSchemas("sample", sample); + openAPI.getComponents().addSchemas("Children", children); codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); + final CodegenModel cm = codegen.fromModel("sample", sample); Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "sample.Sample"); + Assert.assertEquals(cm.classname, "Sample"); Assert.assertEquals(cm.description, "a map model"); Assert.assertEquals(cm.vars.size(), 0); Assert.assertEquals(cm.parent, null); diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index c265bc3767b..a935fc478b1 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -50,7 +50,7 @@ import time import petstore_api from pprint import pprint from petstore_api.api import another_fake_api -from petstore_api.model import client +from petstore_api.model.client import Client # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. configuration = petstore_api.Configuration( @@ -63,7 +63,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model try: # To test special tags @@ -122,69 +122,69 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [additional_properties_any_type.AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) - - [additional_properties_array.AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) - - [additional_properties_boolean.AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) - - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [additional_properties_integer.AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) - - [additional_properties_number.AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) - - [additional_properties_object.AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) - - [additional_properties_string.AdditionalPropertiesString](docs/AdditionalPropertiesString.md) - - [animal.Animal](docs/Animal.md) - - [animal_farm.AnimalFarm](docs/AnimalFarm.md) - - [api_response.ApiResponse](docs/ApiResponse.md) - - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [array_test.ArrayTest](docs/ArrayTest.md) - - [capitalization.Capitalization](docs/Capitalization.md) - - [cat.Cat](docs/Cat.md) - - [cat_all_of.CatAllOf](docs/CatAllOf.md) - - [category.Category](docs/Category.md) - - [child.Child](docs/Child.md) - - [child_all_of.ChildAllOf](docs/ChildAllOf.md) - - [child_cat.ChildCat](docs/ChildCat.md) - - [child_cat_all_of.ChildCatAllOf](docs/ChildCatAllOf.md) - - [child_dog.ChildDog](docs/ChildDog.md) - - [child_dog_all_of.ChildDogAllOf](docs/ChildDogAllOf.md) - - [child_lizard.ChildLizard](docs/ChildLizard.md) - - [child_lizard_all_of.ChildLizardAllOf](docs/ChildLizardAllOf.md) - - [class_model.ClassModel](docs/ClassModel.md) - - [client.Client](docs/Client.md) - - [dog.Dog](docs/Dog.md) - - [dog_all_of.DogAllOf](docs/DogAllOf.md) - - [enum_arrays.EnumArrays](docs/EnumArrays.md) - - [enum_class.EnumClass](docs/EnumClass.md) - - [enum_test.EnumTest](docs/EnumTest.md) - - [file.File](docs/File.md) - - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [format_test.FormatTest](docs/FormatTest.md) - - [grandparent.Grandparent](docs/Grandparent.md) - - [grandparent_animal.GrandparentAnimal](docs/GrandparentAnimal.md) - - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [list.List](docs/List.md) - - [map_test.MapTest](docs/MapTest.md) - - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [model200_response.Model200Response](docs/Model200Response.md) - - [model_return.ModelReturn](docs/ModelReturn.md) - - [name.Name](docs/Name.md) - - [number_only.NumberOnly](docs/NumberOnly.md) - - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) - - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [order.Order](docs/Order.md) - - [parent.Parent](docs/Parent.md) - - [parent_all_of.ParentAllOf](docs/ParentAllOf.md) - - [parent_pet.ParentPet](docs/ParentPet.md) - - [pet.Pet](docs/Pet.md) - - [player.Player](docs/Player.md) - - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) - - [string_enum.StringEnum](docs/StringEnum.md) - - [tag.Tag](docs/Tag.md) - - [type_holder_default.TypeHolderDefault](docs/TypeHolderDefault.md) - - [type_holder_example.TypeHolderExample](docs/TypeHolderExample.md) - - [user.User](docs/User.md) - - [xml_item.XmlItem](docs/XmlItem.md) + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [Child](docs/Child.md) + - [ChildAllOf](docs/ChildAllOf.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ChildDog](docs/ChildDog.md) + - [ChildDogAllOf](docs/ChildDogAllOf.md) + - [ChildLizard](docs/ChildLizard.md) + - [ChildLizardAllOf](docs/ChildLizardAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [Grandparent](docs/Grandparent.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [Order](docs/Order.md) + - [Parent](docs/Parent.md) + - [ParentAllOf](docs/ParentAllOf.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Player](docs/Player.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) ## Documentation For Authorization diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md index d27928ab752..754b2f3ada4 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesAnyType.md @@ -1,4 +1,4 @@ -# additional_properties_any_type.AdditionalPropertiesAnyType +# AdditionalPropertiesAnyType ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md index 6eac3ace2ec..61ac566c14d 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesArray.md @@ -1,4 +1,4 @@ -# additional_properties_array.AdditionalPropertiesArray +# AdditionalPropertiesArray ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md index b403323c553..f2567f064cf 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesBoolean.md @@ -1,4 +1,4 @@ -# additional_properties_boolean.AdditionalPropertiesBoolean +# AdditionalPropertiesBoolean ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md index 4b232aa174a..4a9d1dd133c 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -1,4 +1,4 @@ -# additional_properties_class.AdditionalPropertiesClass +# AdditionalPropertiesClass ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md index 461419e0375..fe0ba709c8e 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesInteger.md @@ -1,4 +1,4 @@ -# additional_properties_integer.AdditionalPropertiesInteger +# AdditionalPropertiesInteger ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md index e0e328aed8e..bec81854b95 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesNumber.md @@ -1,4 +1,4 @@ -# additional_properties_number.AdditionalPropertiesNumber +# AdditionalPropertiesNumber ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md index 36026fe72f8..3fcf2c9299d 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesObject.md @@ -1,4 +1,4 @@ -# additional_properties_object.AdditionalPropertiesObject +# AdditionalPropertiesObject ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md index 41594fd730d..bbe0b1cbbbb 100644 --- a/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md +++ b/samples/client/petstore/python-experimental/docs/AdditionalPropertiesString.md @@ -1,4 +1,4 @@ -# additional_properties_string.AdditionalPropertiesString +# AdditionalPropertiesString ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Animal.md b/samples/client/petstore/python-experimental/docs/Animal.md index fda84ee28ee..e59166a62e8 100644 --- a/samples/client/petstore/python-experimental/docs/Animal.md +++ b/samples/client/petstore/python-experimental/docs/Animal.md @@ -1,4 +1,4 @@ -# animal.Animal +# Animal ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/client/petstore/python-experimental/docs/AnimalFarm.md index c9976c7ddab..0717b5d7df1 100644 --- a/samples/client/petstore/python-experimental/docs/AnimalFarm.md +++ b/samples/client/petstore/python-experimental/docs/AnimalFarm.md @@ -1,9 +1,9 @@ -# animal_farm.AnimalFarm +# AnimalFarm ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[animal.Animal]**](Animal.md) | | +**value** | [**[Animal]**](Animal.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 8b25ae16871..b476f17c965 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **call_123_test_special_tags** -> client.Client call_123_test_special_tags(body) +> Client call_123_test_special_tags(body) To test special tags @@ -20,7 +20,7 @@ To test special tags and operation ID starting with number import time import petstore_api from petstore_api.api import another_fake_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -33,7 +33,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -48,11 +48,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/ApiResponse.md b/samples/client/petstore/python-experimental/docs/ApiResponse.md index 8f7ffa46134..8fc302305ab 100644 --- a/samples/client/petstore/python-experimental/docs/ApiResponse.md +++ b/samples/client/petstore/python-experimental/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# api_response.ApiResponse +# ApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md index ab82c8c556d..1a68df0090b 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly +# ArrayOfArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md index b8ffd843c8d..b8a760f56dc 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_number_only.ArrayOfNumberOnly +# ArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ArrayTest.md b/samples/client/petstore/python-experimental/docs/ArrayTest.md index 22f198440e7..b94f23fd227 100644 --- a/samples/client/petstore/python-experimental/docs/ArrayTest.md +++ b/samples/client/petstore/python-experimental/docs/ArrayTest.md @@ -1,11 +1,11 @@ -# array_test.ArrayTest +# ArrayTest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Capitalization.md b/samples/client/petstore/python-experimental/docs/Capitalization.md index d402f2a571a..85d88d239ee 100644 --- a/samples/client/petstore/python-experimental/docs/Capitalization.md +++ b/samples/client/petstore/python-experimental/docs/Capitalization.md @@ -1,4 +1,4 @@ -# capitalization.Capitalization +# Capitalization ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Cat.md b/samples/client/petstore/python-experimental/docs/Cat.md index 1d7b5b26d71..8bdbf9b3bcc 100644 --- a/samples/client/petstore/python-experimental/docs/Cat.md +++ b/samples/client/petstore/python-experimental/docs/Cat.md @@ -1,4 +1,4 @@ -# cat.Cat +# Cat ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/CatAllOf.md b/samples/client/petstore/python-experimental/docs/CatAllOf.md index 653bb0aa353..35434374fc9 100644 --- a/samples/client/petstore/python-experimental/docs/CatAllOf.md +++ b/samples/client/petstore/python-experimental/docs/CatAllOf.md @@ -1,4 +1,4 @@ -# cat_all_of.CatAllOf +# CatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Category.md b/samples/client/petstore/python-experimental/docs/Category.md index bb122d910fc..33b2242d703 100644 --- a/samples/client/petstore/python-experimental/docs/Category.md +++ b/samples/client/petstore/python-experimental/docs/Category.md @@ -1,4 +1,4 @@ -# category.Category +# Category ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Child.md b/samples/client/petstore/python-experimental/docs/Child.md index bc3c7f3922d..28c29d3d761 100644 --- a/samples/client/petstore/python-experimental/docs/Child.md +++ b/samples/client/petstore/python-experimental/docs/Child.md @@ -1,4 +1,4 @@ -# child.Child +# Child ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildAllOf.md b/samples/client/petstore/python-experimental/docs/ChildAllOf.md index 9d2e42e1894..47774b92a66 100644 --- a/samples/client/petstore/python-experimental/docs/ChildAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildAllOf.md @@ -1,4 +1,4 @@ -# child_all_of.ChildAllOf +# ChildAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildCat.md b/samples/client/petstore/python-experimental/docs/ChildCat.md index 8f5ea4b2ced..328b1b4b591 100644 --- a/samples/client/petstore/python-experimental/docs/ChildCat.md +++ b/samples/client/petstore/python-experimental/docs/ChildCat.md @@ -1,4 +1,4 @@ -# child_cat.ChildCat +# ChildCat ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md index 2e84f31081f..f48345511c1 100644 --- a/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildCatAllOf.md @@ -1,4 +1,4 @@ -# child_cat_all_of.ChildCatAllOf +# ChildCatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildDog.md b/samples/client/petstore/python-experimental/docs/ChildDog.md index 2680d987a45..233f420409b 100644 --- a/samples/client/petstore/python-experimental/docs/ChildDog.md +++ b/samples/client/petstore/python-experimental/docs/ChildDog.md @@ -1,4 +1,4 @@ -# child_dog.ChildDog +# ChildDog ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md b/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md index c7dded9a6df..a366fb735c0 100644 --- a/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildDogAllOf.md @@ -1,4 +1,4 @@ -# child_dog_all_of.ChildDogAllOf +# ChildDogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildLizard.md b/samples/client/petstore/python-experimental/docs/ChildLizard.md index 97b8891a27e..9a8b7524c9f 100644 --- a/samples/client/petstore/python-experimental/docs/ChildLizard.md +++ b/samples/client/petstore/python-experimental/docs/ChildLizard.md @@ -1,4 +1,4 @@ -# child_lizard.ChildLizard +# ChildLizard ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md b/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md index 517f1260b96..a9f166b9f56 100644 --- a/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ChildLizardAllOf.md @@ -1,4 +1,4 @@ -# child_lizard_all_of.ChildLizardAllOf +# ChildLizardAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ClassModel.md b/samples/client/petstore/python-experimental/docs/ClassModel.md index 3f5d0075c1b..657d51a944d 100644 --- a/samples/client/petstore/python-experimental/docs/ClassModel.md +++ b/samples/client/petstore/python-experimental/docs/ClassModel.md @@ -1,4 +1,4 @@ -# class_model.ClassModel +# ClassModel Model for testing model with \"_class\" property ## Properties diff --git a/samples/client/petstore/python-experimental/docs/Client.md b/samples/client/petstore/python-experimental/docs/Client.md index 4c7ce57f750..88e99384f92 100644 --- a/samples/client/petstore/python-experimental/docs/Client.md +++ b/samples/client/petstore/python-experimental/docs/Client.md @@ -1,4 +1,4 @@ -# client.Client +# Client ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Dog.md b/samples/client/petstore/python-experimental/docs/Dog.md index ec98b99dcec..81de5678072 100644 --- a/samples/client/petstore/python-experimental/docs/Dog.md +++ b/samples/client/petstore/python-experimental/docs/Dog.md @@ -1,4 +1,4 @@ -# dog.Dog +# Dog ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/DogAllOf.md b/samples/client/petstore/python-experimental/docs/DogAllOf.md index da3c29557df..36d3216f7b3 100644 --- a/samples/client/petstore/python-experimental/docs/DogAllOf.md +++ b/samples/client/petstore/python-experimental/docs/DogAllOf.md @@ -1,4 +1,4 @@ -# dog_all_of.DogAllOf +# DogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumArrays.md b/samples/client/petstore/python-experimental/docs/EnumArrays.md index c2f22d45047..e0b5582e9d5 100644 --- a/samples/client/petstore/python-experimental/docs/EnumArrays.md +++ b/samples/client/petstore/python-experimental/docs/EnumArrays.md @@ -1,4 +1,4 @@ -# enum_arrays.EnumArrays +# EnumArrays ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumClass.md b/samples/client/petstore/python-experimental/docs/EnumClass.md index 4a29732d861..6e7ecf355ff 100644 --- a/samples/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/client/petstore/python-experimental/docs/EnumClass.md @@ -1,4 +1,4 @@ -# enum_class.EnumClass +# EnumClass ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/EnumTest.md b/samples/client/petstore/python-experimental/docs/EnumTest.md index 24b09db3344..22dd3d5f48d 100644 --- a/samples/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/client/petstore/python-experimental/docs/EnumTest.md @@ -1,4 +1,4 @@ -# enum_test.EnumTest +# EnumTest ## Properties Name | Type | Description | Notes @@ -7,7 +7,7 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**string_enum** | [**string_enum.StringEnum**](StringEnum.md) | | [optional] +**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index b50d11670aa..804344787fc 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -23,7 +23,7 @@ Method | HTTP request | Description # **array_model** -> animal_farm.AnimalFarm array_model() +> AnimalFarm array_model() @@ -35,7 +35,7 @@ Test serialization of ArrayModel import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import animal_farm +from petstore_api.model.animal_farm import AnimalFarm from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -48,7 +48,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) + body = AnimalFarm() # AnimalFarm | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -63,11 +63,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] + **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -[**animal_farm.AnimalFarm**](AnimalFarm.md) +[**AnimalFarm**](AnimalFarm.md) ### Authorization @@ -160,7 +160,7 @@ this route creates an XmlItem import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import xml_item +from petstore_api.model.xml_item import XmlItem from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -173,7 +173,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - xml_item = xml_item.XmlItem() # xml_item.XmlItem | XmlItem Body + xml_item = XmlItem() # XmlItem | XmlItem Body # example passing only required values which don't have defaults set try: @@ -187,7 +187,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xml_item** | [**xml_item.XmlItem**](XmlItem.md)| XmlItem Body | + **xml_item** | [**XmlItem**](XmlItem.md)| XmlItem Body | ### Return type @@ -210,7 +210,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **number_with_validations** -> number_with_validations.NumberWithValidations number_with_validations() +> NumberWithValidations number_with_validations() @@ -222,7 +222,7 @@ Test serialization of outer number types import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import number_with_validations +from petstore_api.model.number_with_validations import NumberWithValidations from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -235,7 +235,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) + body = NumberWithValidations(3.4) # NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -250,11 +250,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] + **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) +[**NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -273,7 +273,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **object_model_with_ref_props** -> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() +> ObjectModelWithRefProps object_model_with_ref_props() @@ -285,7 +285,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import object_model_with_ref_props +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -298,7 +298,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) + body = ObjectModelWithRefProps() # ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -313,11 +313,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] + **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -398,7 +398,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **string_enum** -> string_enum.StringEnum string_enum() +> StringEnum string_enum() @@ -410,7 +410,7 @@ Test serialization of outer enum import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import string_enum +from petstore_api.model.string_enum import StringEnum from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -423,7 +423,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) + body = StringEnum("placed") # StringEnum | Input enum (optional) # example passing only required values which don't have defaults set # and optional values @@ -438,11 +438,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] + **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -[**string_enum.StringEnum**](StringEnum.md) +[**StringEnum**](StringEnum.md) ### Authorization @@ -473,7 +473,7 @@ For this test, the body for this request much reference a schema named `File`. import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import file_schema_test_class +from petstore_api.model.file_schema_test_class import FileSchemaTestClass from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -486,7 +486,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + body = FileSchemaTestClass() # FileSchemaTestClass | # example passing only required values which don't have defaults set try: @@ -499,7 +499,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -532,7 +532,7 @@ No authorization required import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -546,7 +546,7 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - body = user.User() # user.User | + body = User() # User | # example passing only required values which don't have defaults set try: @@ -560,7 +560,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **str**| | - **body** | [**user.User**](User.md)| | + **body** | [**User**](User.md)| | ### Return type @@ -583,7 +583,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> client.Client test_client_model(body) +> Client test_client_model(body) To test \"client\" model @@ -595,7 +595,7 @@ To test \"client\" model import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -623,11 +623,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index aad73f70f5c..134d05a959f 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **test_classname** -> client.Client test_classname(body) +> Client test_classname(body) To test class name in snake case @@ -21,7 +21,7 @@ To test class name in snake case import time import petstore_api from petstore_api.api import fake_classname_tags_123_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -48,7 +48,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) - body = client.Client() # client.Client | client model + body = Client() # Client | client model # example passing only required values which don't have defaults set try: @@ -63,11 +63,11 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**client.Client**](Client.md)| client model | + **body** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/File.md b/samples/client/petstore/python-experimental/docs/File.md index 2847323a098..f17ba0057d0 100644 --- a/samples/client/petstore/python-experimental/docs/File.md +++ b/samples/client/petstore/python-experimental/docs/File.md @@ -1,4 +1,4 @@ -# file.File +# File Must be named `File` for test. ## Properties diff --git a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md index 807350c62f2..d0a8bbaaba9 100644 --- a/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md +++ b/samples/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -1,10 +1,10 @@ -# file_schema_test_class.FileSchemaTestClass +# FileSchemaTestClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file** | [**file.File**](File.md) | | [optional] -**files** | [**[file.File]**](File.md) | | [optional] +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/FormatTest.md b/samples/client/petstore/python-experimental/docs/FormatTest.md index 0f0e2f7cfe1..083b0bd4c98 100644 --- a/samples/client/petstore/python-experimental/docs/FormatTest.md +++ b/samples/client/petstore/python-experimental/docs/FormatTest.md @@ -1,4 +1,4 @@ -# format_test.FormatTest +# FormatTest ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Grandparent.md b/samples/client/petstore/python-experimental/docs/Grandparent.md index 66f49333838..e98808ee538 100644 --- a/samples/client/petstore/python-experimental/docs/Grandparent.md +++ b/samples/client/petstore/python-experimental/docs/Grandparent.md @@ -1,4 +1,4 @@ -# grandparent.Grandparent +# Grandparent ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md index 8a6679f3895..2a9d89c76d9 100644 --- a/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md +++ b/samples/client/petstore/python-experimental/docs/GrandparentAnimal.md @@ -1,4 +1,4 @@ -# grandparent_animal.GrandparentAnimal +# GrandparentAnimal ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md index f2194e269ed..f731a42eab5 100644 --- a/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -1,4 +1,4 @@ -# has_only_read_only.HasOnlyReadOnly +# HasOnlyReadOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/List.md b/samples/client/petstore/python-experimental/docs/List.md index 28e2ec05968..11f4f3a05f3 100644 --- a/samples/client/petstore/python-experimental/docs/List.md +++ b/samples/client/petstore/python-experimental/docs/List.md @@ -1,4 +1,4 @@ -# list.List +# List ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/MapTest.md b/samples/client/petstore/python-experimental/docs/MapTest.md index 9fc13abebdc..ad561b7220b 100644 --- a/samples/client/petstore/python-experimental/docs/MapTest.md +++ b/samples/client/petstore/python-experimental/docs/MapTest.md @@ -1,4 +1,4 @@ -# map_test.MapTest +# MapTest ## Properties Name | Type | Description | Notes @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 87cda996e76..1484c0638d8 100644 --- a/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,11 @@ -# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass +# MixedPropertiesAndAdditionalPropertiesClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] -**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/Model200Response.md b/samples/client/petstore/python-experimental/docs/Model200Response.md index 90f5c2c025d..40d0d7828e1 100644 --- a/samples/client/petstore/python-experimental/docs/Model200Response.md +++ b/samples/client/petstore/python-experimental/docs/Model200Response.md @@ -1,4 +1,4 @@ -# model200_response.Model200Response +# Model200Response Model for testing model name starting with number ## Properties diff --git a/samples/client/petstore/python-experimental/docs/ModelReturn.md b/samples/client/petstore/python-experimental/docs/ModelReturn.md index 3be9912b753..65ec73ddae7 100644 --- a/samples/client/petstore/python-experimental/docs/ModelReturn.md +++ b/samples/client/petstore/python-experimental/docs/ModelReturn.md @@ -1,4 +1,4 @@ -# model_return.ModelReturn +# ModelReturn Model for testing reserved words ## Properties diff --git a/samples/client/petstore/python-experimental/docs/Name.md b/samples/client/petstore/python-experimental/docs/Name.md index 777b79a3d8b..807b76afc6e 100644 --- a/samples/client/petstore/python-experimental/docs/Name.md +++ b/samples/client/petstore/python-experimental/docs/Name.md @@ -1,4 +1,4 @@ -# name.Name +# Name Model for testing model name same as property name ## Properties diff --git a/samples/client/petstore/python-experimental/docs/NumberOnly.md b/samples/client/petstore/python-experimental/docs/NumberOnly.md index ea1a09d2934..93a0fde7b93 100644 --- a/samples/client/petstore/python-experimental/docs/NumberOnly.md +++ b/samples/client/petstore/python-experimental/docs/NumberOnly.md @@ -1,4 +1,4 @@ -# number_only.NumberOnly +# NumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md index b6eb738a2a8..402eb8325bc 100644 --- a/samples/client/petstore/python-experimental/docs/NumberWithValidations.md +++ b/samples/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -1,4 +1,4 @@ -# number_with_validations.NumberWithValidations +# NumberWithValidations ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index 6c308497b60..9a94ef8f61c 100644 --- a/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md +++ b/samples/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,10 +1,10 @@ -# object_model_with_ref_props.ObjectModelWithRefProps +# ObjectModelWithRefProps a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] +**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/client/petstore/python-experimental/docs/Order.md b/samples/client/petstore/python-experimental/docs/Order.md index 9569ea55e55..c21210a3bd5 100644 --- a/samples/client/petstore/python-experimental/docs/Order.md +++ b/samples/client/petstore/python-experimental/docs/Order.md @@ -1,4 +1,4 @@ -# order.Order +# Order ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Parent.md b/samples/client/petstore/python-experimental/docs/Parent.md index 2437d3c81ac..f4c237bb989 100644 --- a/samples/client/petstore/python-experimental/docs/Parent.md +++ b/samples/client/petstore/python-experimental/docs/Parent.md @@ -1,4 +1,4 @@ -# parent.Parent +# Parent ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ParentAllOf.md b/samples/client/petstore/python-experimental/docs/ParentAllOf.md index 6a27f70d4ad..c76c615cc35 100644 --- a/samples/client/petstore/python-experimental/docs/ParentAllOf.md +++ b/samples/client/petstore/python-experimental/docs/ParentAllOf.md @@ -1,4 +1,4 @@ -# parent_all_of.ParentAllOf +# ParentAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ParentPet.md b/samples/client/petstore/python-experimental/docs/ParentPet.md index 12bfa5c7fe5..2c9775e7e16 100644 --- a/samples/client/petstore/python-experimental/docs/ParentPet.md +++ b/samples/client/petstore/python-experimental/docs/ParentPet.md @@ -1,4 +1,4 @@ -# parent_pet.ParentPet +# ParentPet ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Pet.md b/samples/client/petstore/python-experimental/docs/Pet.md index a1ea5598e86..ce09d401c89 100644 --- a/samples/client/petstore/python-experimental/docs/Pet.md +++ b/samples/client/petstore/python-experimental/docs/Pet.md @@ -1,4 +1,4 @@ -# pet.Pet +# Pet ## Properties Name | Type | Description | Notes @@ -6,8 +6,8 @@ Name | Type | Description | Notes **name** | **str** | | **photo_urls** | **[str]** | | **id** | **int** | | [optional] -**category** | [**category.Category**](Category.md) | | [optional] -**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index 287cbc2f7dc..642615e5ab2 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -27,7 +27,7 @@ Add a new pet to the store import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -50,7 +50,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + body = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -64,7 +64,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -169,7 +169,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **find_pets_by_status** -> [pet.Pet] find_pets_by_status(status) +> [Pet] find_pets_by_status(status) Finds Pets by status @@ -182,7 +182,7 @@ Multiple status values can be provided with comma separated strings import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -224,7 +224,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -244,7 +244,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **find_pets_by_tags** -> [pet.Pet] find_pets_by_tags(tags) +> [Pet] find_pets_by_tags(tags) Finds Pets by tags @@ -257,7 +257,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -299,7 +299,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -319,7 +319,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_pet_by_id** -> pet.Pet get_pet_by_id(pet_id) +> Pet get_pet_by_id(pet_id) Find pet by ID @@ -332,7 +332,7 @@ Returns a single pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -378,7 +378,7 @@ Name | Type | Description | Notes ### Return type -[**pet.Pet**](Pet.md) +[**Pet**](Pet.md) ### Authorization @@ -410,7 +410,7 @@ Update an existing pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -433,7 +433,7 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - body = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + body = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: @@ -447,7 +447,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -555,7 +555,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file** -> api_response.ApiResponse upload_file(pet_id) +> ApiResponse upload_file(pet_id) uploads an image @@ -566,7 +566,7 @@ uploads an image import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -623,7 +623,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization @@ -642,7 +642,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file_with_required_file** -> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) +> ApiResponse upload_file_with_required_file(pet_id, required_file) uploads an image (required) @@ -653,7 +653,7 @@ uploads an image (required) import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -708,7 +708,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/Player.md b/samples/client/petstore/python-experimental/docs/Player.md index 34adf5302a0..17ea34ab204 100644 --- a/samples/client/petstore/python-experimental/docs/Player.md +++ b/samples/client/petstore/python-experimental/docs/Player.md @@ -1,4 +1,4 @@ -# player.Player +# Player ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md index 252641787c3..6bc1447c1d7 100644 --- a/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -1,4 +1,4 @@ -# read_only_first.ReadOnlyFirst +# ReadOnlyFirst ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/client/petstore/python-experimental/docs/SpecialModelName.md index 312539af45e..022ee19169c 100644 --- a/samples/client/petstore/python-experimental/docs/SpecialModelName.md +++ b/samples/client/petstore/python-experimental/docs/SpecialModelName.md @@ -1,4 +1,4 @@ -# special_model_name.SpecialModelName +# SpecialModelName ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index 33db4f14ee3..c2780733ed5 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -146,7 +146,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_order_by_id** -> order.Order get_order_by_id(order_id) +> Order get_order_by_id(order_id) Find purchase order by ID @@ -158,7 +158,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +from petstore_api.model.order import Order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -190,7 +190,7 @@ Name | Type | Description | Notes ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization @@ -211,7 +211,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> order.Order place_order(body) +> Order place_order(body) Place an order for a pet @@ -221,7 +221,7 @@ Place an order for a pet import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +from petstore_api.model.order import Order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -234,7 +234,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = store_api.StoreApi(api_client) - body = order.Order() # order.Order | order placed for purchasing the pet + body = Order() # Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: @@ -249,11 +249,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**order.Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization diff --git a/samples/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md index 2eb94fd9a73..2fbf3b3767d 100644 --- a/samples/client/petstore/python-experimental/docs/StringBooleanMap.md +++ b/samples/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -1,4 +1,4 @@ -# string_boolean_map.StringBooleanMap +# StringBooleanMap ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/StringEnum.md b/samples/client/petstore/python-experimental/docs/StringEnum.md index 7b720683b6e..fbedcd04bce 100644 --- a/samples/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# string_enum.StringEnum +# StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/Tag.md b/samples/client/petstore/python-experimental/docs/Tag.md index 827e9db83e3..fb8be02da16 100644 --- a/samples/client/petstore/python-experimental/docs/Tag.md +++ b/samples/client/petstore/python-experimental/docs/Tag.md @@ -1,4 +1,4 @@ -# tag.Tag +# Tag ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md index 001509eba5f..21d125a8e5f 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderDefault.md @@ -1,4 +1,4 @@ -# type_holder_default.TypeHolderDefault +# TypeHolderDefault a model to test optional properties with server defaults ## Properties diff --git a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md index a681dc9440c..b74c520d447 100644 --- a/samples/client/petstore/python-experimental/docs/TypeHolderExample.md +++ b/samples/client/petstore/python-experimental/docs/TypeHolderExample.md @@ -1,4 +1,4 @@ -# type_holder_example.TypeHolderExample +# TypeHolderExample a model to test required properties with an example and length one enum ## Properties diff --git a/samples/client/petstore/python-experimental/docs/User.md b/samples/client/petstore/python-experimental/docs/User.md index 52ff07af296..443ac123fdc 100644 --- a/samples/client/petstore/python-experimental/docs/User.md +++ b/samples/client/petstore/python-experimental/docs/User.md @@ -1,4 +1,4 @@ -# user.User +# User ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index db41065fafd..912611a0cd3 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -27,7 +27,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -40,7 +40,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = user.User() # user.User | Created user object + body = User() # User | Created user object # example passing only required values which don't have defaults set try: @@ -54,7 +54,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**user.User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -87,7 +87,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -100,7 +100,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = [user.User()] # [user.User] | List of user object + body = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: @@ -114,7 +114,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[user.User]**](User.md)| List of user object | + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -147,7 +147,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -160,7 +160,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - body = [user.User()] # [user.User] | List of user object + body = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: @@ -174,7 +174,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**[user.User]**](User.md)| List of user object | + **body** | [**[User]**](User.md)| List of user object | ### Return type @@ -259,7 +259,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_user_by_name** -> user.User get_user_by_name(username) +> User get_user_by_name(username) Get user by user name @@ -269,7 +269,7 @@ Get user by user name import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -301,7 +301,7 @@ Name | Type | Description | Notes ### Return type -[**user.User**](User.md) +[**User**](User.md) ### Authorization @@ -452,7 +452,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -466,7 +466,7 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - body = user.User() # user.User | Updated user object + body = User() # User | Updated user object # example passing only required values which don't have defaults set try: @@ -481,7 +481,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **str**| name that need to be deleted | - **body** | [**user.User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/client/petstore/python-experimental/docs/XmlItem.md b/samples/client/petstore/python-experimental/docs/XmlItem.md index 0228e238165..d30ca436229 100644 --- a/samples/client/petstore/python-experimental/docs/XmlItem.md +++ b/samples/client/petstore/python-experimental/docs/XmlItem.md @@ -1,4 +1,4 @@ -# xml_item.XmlItem +# XmlItem ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 3afdf63dfac..29cc147fd32 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class AnotherFakeApi(object): @@ -53,7 +53,7 @@ class AnotherFakeApi(object): >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ class AnotherFakeApi(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -106,7 +106,7 @@ class AnotherFakeApi(object): self.call_123_test_special_tags = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/another-fake/dummy', 'operation_id': 'call_123_test_special_tags', @@ -134,7 +134,7 @@ class AnotherFakeApi(object): }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py index 756329652dd..597af85596c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -23,14 +23,14 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import animal_farm -from petstore_api.model import xml_item -from petstore_api.model import number_with_validations -from petstore_api.model import object_model_with_ref_props -from petstore_api.model import string_enum -from petstore_api.model import file_schema_test_class -from petstore_api.model import user -from petstore_api.model import client +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.client import Client +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.user import User +from petstore_api.model.xml_item import XmlItem class FakeApi(object): @@ -60,7 +60,7 @@ class FakeApi(object): Keyword Args: - body (animal_farm.AnimalFarm): Input model. [optional] + body (AnimalFarm): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -82,7 +82,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - animal_farm.AnimalFarm + AnimalFarm If the method is called asynchronously, returns the request thread. """ @@ -109,7 +109,7 @@ class FakeApi(object): self.array_model = Endpoint( settings={ - 'response_type': (animal_farm.AnimalFarm,), + 'response_type': (AnimalFarm,), 'auth': [], 'endpoint_path': '/fake/refs/arraymodel', 'operation_id': 'array_model', @@ -135,7 +135,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (animal_farm.AnimalFarm,), + (AnimalFarm,), }, 'attribute_map': { }, @@ -280,7 +280,7 @@ class FakeApi(object): >>> result = thread.get() Args: - xml_item (xml_item.XmlItem): XmlItem Body + xml_item (XmlItem): XmlItem Body Keyword Args: _return_http_data_only (bool): response data without head status @@ -361,7 +361,7 @@ class FakeApi(object): }, 'openapi_types': { 'xml_item': - (xml_item.XmlItem,), + (XmlItem,), }, 'attribute_map': { }, @@ -401,7 +401,7 @@ class FakeApi(object): Keyword Args: - body (number_with_validations.NumberWithValidations): Input number as post body. [optional] + body (NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -423,7 +423,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - number_with_validations.NumberWithValidations + NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -450,7 +450,7 @@ class FakeApi(object): self.number_with_validations = Endpoint( settings={ - 'response_type': (number_with_validations.NumberWithValidations,), + 'response_type': (NumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/number', 'operation_id': 'number_with_validations', @@ -476,7 +476,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (number_with_validations.NumberWithValidations,), + (NumberWithValidations,), }, 'attribute_map': { }, @@ -511,7 +511,7 @@ class FakeApi(object): Keyword Args: - body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] + body (ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -533,7 +533,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - object_model_with_ref_props.ObjectModelWithRefProps + ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -560,7 +560,7 @@ class FakeApi(object): self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), + 'response_type': (ObjectModelWithRefProps,), 'auth': [], 'endpoint_path': '/fake/refs/object_model_with_ref_props', 'operation_id': 'object_model_with_ref_props', @@ -586,7 +586,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (object_model_with_ref_props.ObjectModelWithRefProps,), + (ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -731,7 +731,7 @@ class FakeApi(object): Keyword Args: - body (string_enum.StringEnum): Input enum. [optional] + body (StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -753,7 +753,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - string_enum.StringEnum + StringEnum If the method is called asynchronously, returns the request thread. """ @@ -780,7 +780,7 @@ class FakeApi(object): self.string_enum = Endpoint( settings={ - 'response_type': (string_enum.StringEnum,), + 'response_type': (StringEnum,), 'auth': [], 'endpoint_path': '/fake/refs/enum', 'operation_id': 'string_enum', @@ -806,7 +806,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (string_enum.StringEnum,), + (StringEnum,), }, 'attribute_map': { }, @@ -841,7 +841,7 @@ class FakeApi(object): >>> result = thread.get() Args: - body (file_schema_test_class.FileSchemaTestClass): + body (FileSchemaTestClass): Keyword Args: _return_http_data_only (bool): response data without head status @@ -922,7 +922,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (file_schema_test_class.FileSchemaTestClass,), + (FileSchemaTestClass,), }, 'attribute_map': { }, @@ -958,7 +958,7 @@ class FakeApi(object): Args: query (str): - body (user.User): + body (User): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1045,7 +1045,7 @@ class FakeApi(object): 'query': (str,), 'body': - (user.User,), + (User,), }, 'attribute_map': { 'query': 'query', @@ -1082,7 +1082,7 @@ class FakeApi(object): >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -1106,7 +1106,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -1135,7 +1135,7 @@ class FakeApi(object): self.test_client_model = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/fake', 'operation_id': 'test_client_model', @@ -1163,7 +1163,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index c069a60b04f..634f9f13103 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class FakeClassnameTags123Api(object): @@ -53,7 +53,7 @@ class FakeClassnameTags123Api(object): >>> result = thread.get() Args: - body (client.Client): client model + body (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ class FakeClassnameTags123Api(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -106,7 +106,7 @@ class FakeClassnameTags123Api(object): self.test_classname = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [ 'api_key_query' ], @@ -136,7 +136,7 @@ class FakeClassnameTags123Api(object): }, 'openapi_types': { 'body': - (client.Client,), + (Client,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py index 4ae5987ba00..66611a73f3c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -23,8 +23,8 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import pet -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.pet import Pet class PetApi(object): @@ -53,7 +53,7 @@ class PetApi(object): >>> result = thread.get() Args: - body (pet.Pet): Pet object that needs to be added to the store + body (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -136,7 +136,7 @@ class PetApi(object): }, 'openapi_types': { 'body': - (pet.Pet,), + (Pet,), }, 'attribute_map': { }, @@ -318,7 +318,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -347,7 +347,7 @@ class PetApi(object): self.find_pets_by_status = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'petstore_auth' ], @@ -446,7 +446,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -475,7 +475,7 @@ class PetApi(object): self.find_pets_by_tags = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'petstore_auth' ], @@ -567,7 +567,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - pet.Pet + Pet If the method is called asynchronously, returns the request thread. """ @@ -596,7 +596,7 @@ class PetApi(object): self.get_pet_by_id = Endpoint( settings={ - 'response_type': (pet.Pet,), + 'response_type': (Pet,), 'auth': [ 'api_key' ], @@ -662,7 +662,7 @@ class PetApi(object): >>> result = thread.get() Args: - body (pet.Pet): Pet object that needs to be added to the store + body (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -745,7 +745,7 @@ class PetApi(object): }, 'openapi_types': { 'body': - (pet.Pet,), + (Pet,), }, 'attribute_map': { }, @@ -937,7 +937,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -966,7 +966,7 @@ class PetApi(object): self.upload_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], @@ -1076,7 +1076,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -1107,7 +1107,7 @@ class PetApi(object): self.upload_file_with_required_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], diff --git a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py index cc86ddc91c3..7e6b6cba1c8 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import order +from petstore_api.model.order import Order class StoreApi(object): @@ -299,7 +299,7 @@ class StoreApi(object): async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -328,7 +328,7 @@ class StoreApi(object): self.get_order_by_id = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order/{order_id}', 'operation_id': 'get_order_by_id', @@ -398,7 +398,7 @@ class StoreApi(object): >>> result = thread.get() Args: - body (order.Order): order placed for purchasing the pet + body (Order): order placed for purchasing the pet Keyword Args: _return_http_data_only (bool): response data without head status @@ -422,7 +422,7 @@ class StoreApi(object): async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -451,7 +451,7 @@ class StoreApi(object): self.place_order = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order', 'operation_id': 'place_order', @@ -479,7 +479,7 @@ class StoreApi(object): }, 'openapi_types': { 'body': - (order.Order,), + (Order,), }, 'attribute_map': { }, diff --git a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py index 51d595d3f39..92dae02b424 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import user +from petstore_api.model.user import User class UserApi(object): @@ -53,7 +53,7 @@ class UserApi(object): >>> result = thread.get() Args: - body (user.User): Created user object + body (User): Created user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -134,7 +134,7 @@ class UserApi(object): }, 'openapi_types': { 'body': - (user.User,), + (User,), }, 'attribute_map': { }, @@ -166,7 +166,7 @@ class UserApi(object): >>> result = thread.get() Args: - body ([user.User]): List of user object + body ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -247,7 +247,7 @@ class UserApi(object): }, 'openapi_types': { 'body': - ([user.User],), + ([User],), }, 'attribute_map': { }, @@ -279,7 +279,7 @@ class UserApi(object): >>> result = thread.get() Args: - body ([user.User]): List of user object + body ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -360,7 +360,7 @@ class UserApi(object): }, 'openapi_types': { 'body': - ([user.User],), + ([User],), }, 'attribute_map': { }, @@ -531,7 +531,7 @@ class UserApi(object): async_req (bool): execute request asynchronously Returns: - user.User + User If the method is called asynchronously, returns the request thread. """ @@ -560,7 +560,7 @@ class UserApi(object): self.get_user_by_name = Endpoint( settings={ - 'response_type': (user.User,), + 'response_type': (User,), 'auth': [], 'endpoint_path': '/user/{username}', 'operation_id': 'get_user_by_name', @@ -856,7 +856,7 @@ class UserApi(object): Args: username (str): name that need to be deleted - body (user.User): Updated user object + body (User): Updated user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -943,7 +943,7 @@ class UserApi(object): 'username': (str,), 'body': - (user.User,), + (User,), }, 'attribute_map': { 'username': 'username', diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py index ff57e565fa8..b1f844846c7 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_any_type.py @@ -61,15 +61,21 @@ class AdditionalPropertiesAnyType(ModelNormal): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesAnyType(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesAnyType(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_any_type.AdditionalPropertiesAnyType - a model defined in OpenAPI + """AdditionalPropertiesAnyType - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py index c42ce98aeeb..ca203ae6269 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_array.py @@ -61,15 +61,21 @@ class AdditionalPropertiesArray(ModelNormal): validations = { } - additional_properties_type = ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesArray(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesArray(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_array.AdditionalPropertiesArray - a model defined in OpenAPI + """AdditionalPropertiesArray - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py index ff1f44523bd..c5d5aadbc25 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_boolean.py @@ -61,15 +61,21 @@ class AdditionalPropertiesBoolean(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesBoolean(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesBoolean(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_boolean.AdditionalPropertiesBoolean - a model defined in OpenAPI + """AdditionalPropertiesBoolean - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index c52c9dd3b83..029cdcbb05f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -68,8 +68,8 @@ class AdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ class AdditionalPropertiesClass(ModelNormal): def discriminator(): return None + attribute_map = { 'map_string': 'map_string', # noqa: E501 'map_number': 'map_number', # noqa: E501 @@ -120,7 +121,7 @@ class AdditionalPropertiesClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + """AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py index 31ab33a95b1..e5e6fbd3f5b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_integer.py @@ -61,15 +61,21 @@ class AdditionalPropertiesInteger(ModelNormal): validations = { } - additional_properties_type = (int,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesInteger(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesInteger(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_integer.AdditionalPropertiesInteger - a model defined in OpenAPI + """AdditionalPropertiesInteger - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py index 8f8f580c7aa..96e73426096 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_number.py @@ -61,15 +61,21 @@ class AdditionalPropertiesNumber(ModelNormal): validations = { } - additional_properties_type = (float,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (float,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesNumber(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesNumber(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_number.AdditionalPropertiesNumber - a model defined in OpenAPI + """AdditionalPropertiesNumber - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py index 954b6b96578..e07853f983b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_object.py @@ -61,15 +61,21 @@ class AdditionalPropertiesObject(ModelNormal): validations = { } - additional_properties_type = ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesObject(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesObject(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_object.AdditionalPropertiesObject - a model defined in OpenAPI + """AdditionalPropertiesObject - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py index 65a67199030..963b28c2280 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/additional_properties_string.py @@ -61,15 +61,21 @@ class AdditionalPropertiesString(ModelNormal): validations = { } - additional_properties_type = (str,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (str,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +89,7 @@ class AdditionalPropertiesString(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +107,7 @@ class AdditionalPropertiesString(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_string.AdditionalPropertiesString - a model defined in OpenAPI + """AdditionalPropertiesString - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/client/petstore/python-experimental/petstore_api/model/animal.py index 7f1257e2ab4..39aaa93227c 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog class Animal(ModelNormal): @@ -78,13 +74,14 @@ class Animal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -92,9 +89,10 @@ class Animal(ModelNormal): @cached_property def discriminator(): + lazy_import() val = { - 'Cat': cat.Cat, - 'Dog': dog.Dog, + 'Cat': Cat, + 'Dog': Dog, } if not val: return None @@ -118,7 +116,7 @@ class Animal(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """animal.Animal - a model defined in OpenAPI + """Animal - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 94d6d094d68..dc35f9394e1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class AnimalFarm(ModelSimple): @@ -69,21 +68,23 @@ class AnimalFarm(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([animal.Animal],), + 'value': ([Animal],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ class AnimalFarm(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """animal_farm.AnimalFarm - a model defined in OpenAPI + """AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): # noqa: E501 + value ([Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py index 24a2e3d897a..bce1291d1f6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -68,8 +68,8 @@ class ApiResponse(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ class ApiResponse(ModelNormal): def discriminator(): return None + attribute_map = { 'code': 'code', # noqa: E501 'type': 'type', # noqa: E501 @@ -104,7 +105,7 @@ class ApiResponse(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """api_response.ApiResponse - a model defined in OpenAPI + """ApiResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 014740ca0a6..7c7c2743398 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'array_array_number': 'ArrayArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 00afce1fb4a..4947154bb6e 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ArrayOfNumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'array_number': 'ArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class ArrayOfNumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py index e4478c5acdc..7b4d47ace89 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst class ArrayTest(ModelNormal): @@ -73,23 +72,25 @@ class ArrayTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'array_of_string': ([str],), # noqa: E501 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'array_of_string': 'array_of_string', # noqa: E501 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 @@ -109,7 +110,7 @@ class ArrayTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_test.ArrayTest - a model defined in OpenAPI + """ArrayTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ class ArrayTest(ModelNormal): _visited_composed_classes = (Animal,) array_of_string ([str]): [optional] # noqa: E501 array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py index 18c5f54c06f..3e0068ed683 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -68,8 +68,8 @@ class Capitalization(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -88,6 +88,7 @@ class Capitalization(ModelNormal): def discriminator(): return None + attribute_map = { 'small_camel': 'smallCamel', # noqa: E501 'capital_camel': 'CapitalCamel', # noqa: E501 @@ -110,7 +111,7 @@ class Capitalization(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """capitalization.Capitalization - a model defined in OpenAPI + """Capitalization - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/client/petstore/python-experimental/petstore_api/model/cat.py index 335b05559d1..7b34989c8c1 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf class Cat(ModelComposed): @@ -78,13 +74,14 @@ class Cat(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'declawed': (bool,), # noqa: E501 @@ -119,7 +116,7 @@ class Cat(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """cat.Cat - a model defined in OpenAPI + """Cat - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +224,13 @@ class Cat(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - cat_all_of.CatAllOf, + Animal, + CatAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index c257813c120..dadc7147572 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -68,8 +68,8 @@ class CatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class CatAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'declawed': 'declawed', # noqa: E501 } @@ -100,7 +101,7 @@ class CatAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """cat_all_of.CatAllOf - a model defined in OpenAPI + """CatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/category.py b/samples/client/petstore/python-experimental/petstore_api/model/category.py index e2be1802b1d..a5af94f90ce 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/category.py @@ -68,8 +68,8 @@ class Category(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Category(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'id': 'id', # noqa: E501 @@ -102,7 +103,7 @@ class Category(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """category.Category - a model defined in OpenAPI + """Category - a model defined in OpenAPI Args: diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child.py b/samples/client/petstore/python-experimental/petstore_api/model/child.py index 03b1839ccca..c2280abb12f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_all_of -except ImportError: - child_all_of = sys.modules[ - 'petstore_api.model.child_all_of'] -try: - from petstore_api.model import parent -except ImportError: - parent = sys.modules[ - 'petstore_api.model.parent'] + +def lazy_import(): + from petstore_api.model.child_all_of import ChildAllOf + from petstore_api.model.parent import Parent + globals()['ChildAllOf'] = ChildAllOf + globals()['Parent'] = Parent class Child(ModelComposed): @@ -78,13 +74,14 @@ class Child(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'radio_waves': (bool,), # noqa: E501 'tele_vision': (bool,), # noqa: E501 @@ -95,6 +92,7 @@ class Child(ModelComposed): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 'tele_vision': 'teleVision', # noqa: E501 @@ -115,7 +113,7 @@ class Child(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child.Child - a model defined in OpenAPI + """Child - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -220,12 +218,13 @@ class Child(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_all_of.ChildAllOf, - parent.Parent, + ChildAllOf, + Parent, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py index 0aaf9f258b4..8a3f615d3c2 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_all_of.py @@ -68,8 +68,8 @@ class ChildAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ChildAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'inter_net': 'interNet', # noqa: E501 } @@ -100,7 +101,7 @@ class ChildAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_all_of.ChildAllOf - a model defined in OpenAPI + """ChildAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py index 998f062d677..e608bb0fb47 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet class ChildCat(ModelComposed): @@ -78,13 +74,14 @@ class ChildCat(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'name': (str,), # noqa: E501 @@ -117,7 +114,7 @@ class ChildCat(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_cat.ChildCat - a model defined in OpenAPI + """ChildCat - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ class ChildCat(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_cat_all_of.ChildCatAllOf, - parent_pet.ParentPet, + ChildCatAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index cc67b70c874..d9c453ba4d6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -68,8 +68,8 @@ class ChildCatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ChildCatAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +101,7 @@ class ChildCatAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI + """ChildCatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py index 4fea9fbfe0d..e1847bccd35 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_dog_all_of -except ImportError: - child_dog_all_of = sys.modules[ - 'petstore_api.model.child_dog_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_dog_all_of import ChildDogAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildDogAllOf'] = ChildDogAllOf + globals()['ParentPet'] = ParentPet class ChildDog(ModelComposed): @@ -78,13 +74,14 @@ class ChildDog(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'bark': (str,), # noqa: E501 @@ -117,7 +114,7 @@ class ChildDog(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_dog.ChildDog - a model defined in OpenAPI + """ChildDog - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ class ChildDog(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_dog_all_of.ChildDogAllOf, - parent_pet.ParentPet, + ChildDogAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py index 6e3e49d360a..b4e625e874f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_dog_all_of.py @@ -68,8 +68,8 @@ class ChildDogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ChildDogAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'bark': 'bark', # noqa: E501 } @@ -100,7 +101,7 @@ class ChildDogAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_dog_all_of.ChildDogAllOf - a model defined in OpenAPI + """ChildDogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py index 741ef17af1a..cfae6eaf04b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_lizard_all_of -except ImportError: - child_lizard_all_of = sys.modules[ - 'petstore_api.model.child_lizard_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_lizard_all_of import ChildLizardAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildLizardAllOf'] = ChildLizardAllOf + globals()['ParentPet'] = ParentPet class ChildLizard(ModelComposed): @@ -78,13 +74,14 @@ class ChildLizard(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'loves_rocks': (bool,), # noqa: E501 @@ -117,7 +114,7 @@ class ChildLizard(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_lizard.ChildLizard - a model defined in OpenAPI + """ChildLizard - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +221,13 @@ class ChildLizard(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_lizard_all_of.ChildLizardAllOf, - parent_pet.ParentPet, + ChildLizardAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py index 31976b59fac..3dafa331800 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/child_lizard_all_of.py @@ -68,8 +68,8 @@ class ChildLizardAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ChildLizardAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'loves_rocks': 'lovesRocks', # noqa: E501 } @@ -100,7 +101,7 @@ class ChildLizardAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_lizard_all_of.ChildLizardAllOf - a model defined in OpenAPI + """ChildLizardAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py index d80e4ef3671..a1d4959a985 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -68,8 +68,8 @@ class ClassModel(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ClassModel(ModelNormal): def discriminator(): return None + attribute_map = { '_class': '_class', # noqa: E501 } @@ -100,7 +101,7 @@ class ClassModel(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """class_model.ClassModel - a model defined in OpenAPI + """ClassModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/client.py b/samples/client/petstore/python-experimental/petstore_api/model/client.py index 2ea3b4aadd4..114dab427f4 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/client.py @@ -68,8 +68,8 @@ class Client(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class Client(ModelNormal): def discriminator(): return None + attribute_map = { 'client': 'client', # noqa: E501 } @@ -100,7 +101,7 @@ class Client(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """client.Client - a model defined in OpenAPI + """Client - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/client/petstore/python-experimental/petstore_api/model/dog.py index 02d6f034439..24f8a468895 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf class Dog(ModelComposed): @@ -78,13 +74,14 @@ class Dog(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'breed': (str,), # noqa: E501 @@ -119,7 +116,7 @@ class Dog(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """dog.Dog - a model defined in OpenAPI + """Dog - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +224,13 @@ class Dog(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - dog_all_of.DogAllOf, + Animal, + DogAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 299a4d956bc..c27b3bbc053 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -68,8 +68,8 @@ class DogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class DogAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'breed': 'breed', # noqa: E501 } @@ -100,7 +101,7 @@ class DogAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """dog_all_of.DogAllOf - a model defined in OpenAPI + """DogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 161ddd5c1d1..4b04cd10401 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -76,8 +76,8 @@ class EnumArrays(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -92,6 +92,7 @@ class EnumArrays(ModelNormal): def discriminator(): return None + attribute_map = { 'just_symbol': 'just_symbol', # noqa: E501 'array_enum': 'array_enum', # noqa: E501 @@ -110,7 +111,7 @@ class EnumArrays(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """enum_arrays.EnumArrays - a model defined in OpenAPI + """EnumArrays - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py index dac3ee37d03..5c9799cce10 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -69,8 +69,8 @@ class EnumClass(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class EnumClass(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class EnumClass(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """enum_class.EnumClass - a model defined in OpenAPI + """EnumClass - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py index c53f054242e..0e4dd0da2ea 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum class EnumTest(ModelNormal): @@ -91,25 +90,27 @@ class EnumTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'enum_string_required': (str,), # noqa: E501 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'string_enum': (string_enum.StringEnum,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_string': 'enum_string', # noqa: E501 @@ -131,7 +132,7 @@ class EnumTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """enum_test.EnumTest - a model defined in OpenAPI + """EnumTest - a model defined in OpenAPI Args: enum_string_required (str): @@ -170,7 +171,7 @@ class EnumTest(ModelNormal): enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - string_enum (string_enum.StringEnum): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file.py b/samples/client/petstore/python-experimental/petstore_api/model/file.py index f7cdcb4fdf8..2dc360144d6 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file.py @@ -68,8 +68,8 @@ class File(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class File(ModelNormal): def discriminator(): return None + attribute_map = { 'source_uri': 'sourceURI', # noqa: E501 } @@ -100,7 +101,7 @@ class File(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file.File - a model defined in OpenAPI + """File - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 3c1d880d358..dc1405e1fe9 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File class FileSchemaTestClass(ModelNormal): @@ -73,22 +72,24 @@ class FileSchemaTestClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'file': (file.File,), # noqa: E501 - 'files': ([file.File],), # noqa: E501 + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'file': 'file', # noqa: E501 'files': 'files', # noqa: E501 @@ -107,7 +108,7 @@ class FileSchemaTestClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + """FileSchemaTestClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -140,8 +141,8 @@ class FileSchemaTestClass(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - file (file.File): [optional] # noqa: E501 - files ([file.File]): [optional] # noqa: E501 + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py index 1955422e7a8..d338a41ef97 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -103,8 +103,8 @@ class FormatTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -130,6 +130,7 @@ class FormatTest(ModelNormal): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'byte': 'byte', # noqa: E501 @@ -159,7 +160,7 @@ class FormatTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """format_test.FormatTest - a model defined in OpenAPI + """FormatTest - a model defined in OpenAPI Args: number (float): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py index 7d607a4f392..ca3b8391aeb 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent.py @@ -68,8 +68,8 @@ class Grandparent(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class Grandparent(ModelNormal): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 } @@ -100,7 +101,7 @@ class Grandparent(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """grandparent.Grandparent - a model defined in OpenAPI + """Grandparent - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 2dc2658ef13..62b2c875bff 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -29,26 +29,16 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['ParentPet'] = ParentPet class GrandparentAnimal(ModelNormal): @@ -88,24 +78,26 @@ class GrandparentAnimal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ChildDog': child_dog.ChildDog, - 'ChildLizard': child_lizard.ChildLizard, - 'ParentPet': parent_pet.ParentPet, + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, + 'ParentPet': ParentPet, } if not val: return None @@ -128,7 +120,7 @@ class GrandparentAnimal(ModelNormal): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """grandparent_animal.GrandparentAnimal - a model defined in OpenAPI + """GrandparentAnimal - a model defined in OpenAPI Args: pet_type (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 7a722ee9c78..a89269f087d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -68,8 +68,8 @@ class HasOnlyReadOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class HasOnlyReadOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'foo': 'foo', # noqa: E501 @@ -102,7 +103,7 @@ class HasOnlyReadOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + """HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/list.py b/samples/client/petstore/python-experimental/petstore_api/model/list.py index 77bd4d0565d..48a4934b3c3 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/list.py @@ -68,8 +68,8 @@ class List(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class List(ModelNormal): def discriminator(): return None + attribute_map = { '_123_list': '123-list', # noqa: E501 } @@ -100,7 +101,7 @@ class List(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """list.List - a model defined in OpenAPI + """List - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py index 5bafea48a04..b08a5c9d66d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap class MapTest(ModelNormal): @@ -77,24 +76,26 @@ class MapTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 'map_of_enum_string': ({str: (str,)},), # noqa: E501 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'map_map_of_string': 'map_map_of_string', # noqa: E501 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 @@ -115,7 +116,7 @@ class MapTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """map_test.MapTest - a model defined in OpenAPI + """MapTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,7 +152,7 @@ class MapTest(ModelNormal): map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 12cda6cf9ae..58a190e9a22 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @@ -73,23 +72,25 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'uuid': (str,), # noqa: E501 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (animal.Animal,)},), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'uuid': 'uuid', # noqa: E501 'date_time': 'dateTime', # noqa: E501 @@ -109,7 +110,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): _visited_composed_classes = (Animal,) uuid (str): [optional] # noqa: E501 date_time (datetime): [optional] # noqa: E501 - map ({str: (animal.Animal,)}): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py index ea4df21be49..0b331cb4292 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -68,8 +68,8 @@ class Model200Response(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Model200Response(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 '_class': 'class', # noqa: E501 @@ -102,7 +103,7 @@ class Model200Response(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model200_response.Model200Response - a model defined in OpenAPI + """Model200Response - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py index 535657ebbcf..5905af9cc4f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -68,8 +68,8 @@ class ModelReturn(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ModelReturn(ModelNormal): def discriminator(): return None + attribute_map = { '_return': 'return', # noqa: E501 } @@ -100,7 +101,7 @@ class ModelReturn(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model_return.ModelReturn - a model defined in OpenAPI + """ModelReturn - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/name.py b/samples/client/petstore/python-experimental/petstore_api/model/name.py index 95f197a7a59..1627f3381b0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/name.py @@ -68,8 +68,8 @@ class Name(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -86,6 +86,7 @@ class Name(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'snake_case': 'snake_case', # noqa: E501 @@ -106,7 +107,7 @@ class Name(ModelNormal): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """name.Name - a model defined in OpenAPI + """Name - a model defined in OpenAPI Args: name (int): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py index d16ea3765fc..421b4d51a8b 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -68,8 +68,8 @@ class NumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class NumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'just_number': 'JustNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class NumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """number_only.NumberOnly - a model defined in OpenAPI + """NumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index 1cb824ca0b4..00656ce8bcf 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -68,8 +68,8 @@ class NumberWithValidations(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class NumberWithValidations(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -98,7 +99,7 @@ class NumberWithValidations(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """number_with_validations.NumberWithValidations - a model defined in OpenAPI + """NumberWithValidations - a model defined in OpenAPI Args: value (float): # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 15ccc61db3f..8858e25aa53 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['NumberWithValidations'] = NumberWithValidations class ObjectModelWithRefProps(ModelNormal): @@ -73,15 +72,16 @@ class ObjectModelWithRefProps(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 + 'my_number': (NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -90,6 +90,7 @@ class ObjectModelWithRefProps(ModelNormal): def discriminator(): return None + attribute_map = { 'my_number': 'my_number', # noqa: E501 'my_string': 'my_string', # noqa: E501 @@ -109,7 +110,7 @@ class ObjectModelWithRefProps(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI + """ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -142,7 +143,7 @@ class ObjectModelWithRefProps(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 + my_number (NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/order.py b/samples/client/petstore/python-experimental/petstore_api/model/order.py index b21543df95f..08ce05074ae 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/order.py @@ -73,8 +73,8 @@ class Order(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ class Order(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'pet_id': 'petId', # noqa: E501 @@ -115,7 +116,7 @@ class Order(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """order.Order - a model defined in OpenAPI + """Order - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent.py b/samples/client/petstore/python-experimental/petstore_api/model/parent.py index e304790e4a6..4d0aeb96a9d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import grandparent -except ImportError: - grandparent = sys.modules[ - 'petstore_api.model.grandparent'] -try: - from petstore_api.model import parent_all_of -except ImportError: - parent_all_of = sys.modules[ - 'petstore_api.model.parent_all_of'] + +def lazy_import(): + from petstore_api.model.grandparent import Grandparent + from petstore_api.model.parent_all_of import ParentAllOf + globals()['Grandparent'] = Grandparent + globals()['ParentAllOf'] = ParentAllOf class Parent(ModelComposed): @@ -78,13 +74,14 @@ class Parent(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'radio_waves': (bool,), # noqa: E501 'tele_vision': (bool,), # noqa: E501 @@ -94,6 +91,7 @@ class Parent(ModelComposed): def discriminator(): return None + attribute_map = { 'radio_waves': 'radioWaves', # noqa: E501 'tele_vision': 'teleVision', # noqa: E501 @@ -113,7 +111,7 @@ class Parent(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """parent.Parent - a model defined in OpenAPI + """Parent - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -217,12 +215,13 @@ class Parent(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent.Grandparent, - parent_all_of.ParentAllOf, + Grandparent, + ParentAllOf, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py index 7c93bfa5304..a026b9b9c6d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_all_of.py @@ -68,8 +68,8 @@ class ParentAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ParentAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'tele_vision': 'teleVision', # noqa: E501 } @@ -100,7 +101,7 @@ class ParentAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """parent_all_of.ParentAllOf - a model defined in OpenAPI + """ParentAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py index be19773d591..d529f23e442 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -29,26 +29,16 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import child_dog -except ImportError: - child_dog = sys.modules[ - 'petstore_api.model.child_dog'] -try: - from petstore_api.model import child_lizard -except ImportError: - child_lizard = sys.modules[ - 'petstore_api.model.child_lizard'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.child_dog import ChildDog + from petstore_api.model.child_lizard import ChildLizard + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['ChildDog'] = ChildDog + globals()['ChildLizard'] = ChildLizard + globals()['GrandparentAnimal'] = GrandparentAnimal class ParentPet(ModelComposed): @@ -88,23 +78,25 @@ class ParentPet(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ChildDog': child_dog.ChildDog, - 'ChildLizard': child_lizard.ChildLizard, + 'ChildCat': ChildCat, + 'ChildDog': ChildDog, + 'ChildLizard': ChildLizard, } if not val: return None @@ -128,7 +120,7 @@ class ParentPet(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """parent_pet.ParentPet - a model defined in OpenAPI + """ParentPet - a model defined in OpenAPI Args: pet_type (str): @@ -234,11 +226,12 @@ class ParentPet(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent_animal.GrandparentAnimal, + GrandparentAnimal, ], 'oneOf': [ ], diff --git a/samples/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/client/petstore/python-experimental/petstore_api/model/pet.py index 5837810f22e..77f5d3bb1ee 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/pet.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.model import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag class Pet(ModelNormal): @@ -83,19 +79,20 @@ class Pet(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'name': (str,), # noqa: E501 'photo_urls': ([str],), # noqa: E501 'id': (int,), # noqa: E501 - 'category': (category.Category,), # noqa: E501 - 'tags': ([tag.Tag],), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 'status': (str,), # noqa: E501 } @@ -103,6 +100,7 @@ class Pet(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'photo_urls': 'photoUrls', # noqa: E501 @@ -125,7 +123,7 @@ class Pet(ModelNormal): @convert_js_args_to_python_args def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """pet.Pet - a model defined in OpenAPI + """Pet - a model defined in OpenAPI Args: name (str): @@ -163,8 +161,8 @@ class Pet(ModelNormal): through its discriminator because we passed in _visited_composed_classes = (Animal,) id (int): [optional] # noqa: E501 - category (category.Category): [optional] # noqa: E501 - tags ([tag.Tag]): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 status (str): pet status in the store. [optional] # noqa: E501 """ diff --git a/samples/client/petstore/python-experimental/petstore_api/model/player.py b/samples/client/petstore/python-experimental/petstore_api/model/player.py index b24471bd4c8..76caf4dce33 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/player.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/player.py @@ -68,8 +68,8 @@ class Player(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Player(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'enemy_player': 'enemyPlayer', # noqa: E501 @@ -102,7 +103,7 @@ class Player(ModelNormal): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """player.Player - a model defined in OpenAPI + """Player - a model defined in OpenAPI Args: name (str): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py index b53aa4db398..f9fea19495d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -68,8 +68,8 @@ class ReadOnlyFirst(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class ReadOnlyFirst(ModelNormal): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'baz': 'baz', # noqa: E501 @@ -102,7 +103,7 @@ class ReadOnlyFirst(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + """ReadOnlyFirst - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 75df4a577a3..e4df8f8e89d 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -68,8 +68,8 @@ class SpecialModelName(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class SpecialModelName(ModelNormal): def discriminator(): return None + attribute_map = { 'special_property_name': '$special[property.name]', # noqa: E501 } @@ -100,7 +101,7 @@ class SpecialModelName(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """special_model_name.SpecialModelName - a model defined in OpenAPI + """SpecialModelName - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index b1fb6432111..0f4bc65afde 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -61,15 +61,21 @@ class StringBooleanMap(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ class StringBooleanMap(ModelNormal): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ class StringBooleanMap(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + """StringBooleanMap - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py index 6f45c19a4cc..1fd2b674698 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -69,8 +69,8 @@ class StringEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class StringEnum(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class StringEnum(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum.StringEnum - a model defined in OpenAPI + """StringEnum - a model defined in OpenAPI Args: value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/client/petstore/python-experimental/petstore_api/model/tag.py index 480e1e60322..dae4bee68a5 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/tag.py @@ -68,8 +68,8 @@ class Tag(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ class Tag(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'name': 'name', # noqa: E501 @@ -104,7 +105,7 @@ class Tag(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """tag.Tag - a model defined in OpenAPI + """Tag - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py index 4eb7092ef86..812384aa994 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_default.py @@ -68,8 +68,8 @@ class TypeHolderDefault(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -89,6 +89,7 @@ class TypeHolderDefault(ModelNormal): def discriminator(): return None + attribute_map = { 'string_item': 'string_item', # noqa: E501 'number_item': 'number_item', # noqa: E501 @@ -112,7 +113,7 @@ class TypeHolderDefault(ModelNormal): @convert_js_args_to_python_args def __init__(self, array_item, *args, **kwargs): # noqa: E501 - """type_holder_default.TypeHolderDefault - a model defined in OpenAPI + """TypeHolderDefault - a model defined in OpenAPI Args: array_item ([int]): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py index 6e3cd4280b0..1f796982cde 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/type_holder_example.py @@ -77,8 +77,8 @@ class TypeHolderExample(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -96,6 +96,7 @@ class TypeHolderExample(ModelNormal): def discriminator(): return None + attribute_map = { 'string_item': 'string_item', # noqa: E501 'number_item': 'number_item', # noqa: E501 @@ -117,7 +118,7 @@ class TypeHolderExample(ModelNormal): @convert_js_args_to_python_args def __init__(self, bool_item, array_item, *args, **kwargs): # noqa: E501 - """type_holder_example.TypeHolderExample - a model defined in OpenAPI + """TypeHolderExample - a model defined in OpenAPI Args: bool_item (bool): diff --git a/samples/client/petstore/python-experimental/petstore_api/model/user.py b/samples/client/petstore/python-experimental/petstore_api/model/user.py index 95fd0683d74..b58ede5e5fd 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/user.py @@ -68,8 +68,8 @@ class User(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -90,6 +90,7 @@ class User(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'username': 'username', # noqa: E501 @@ -114,7 +115,7 @@ class User(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """user.User - a model defined in OpenAPI + """User - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py index 961fb0f5552..c52a02acfc0 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py +++ b/samples/client/petstore/python-experimental/petstore_api/model/xml_item.py @@ -68,8 +68,8 @@ class XmlItem(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -111,6 +111,7 @@ class XmlItem(ModelNormal): def discriminator(): return None + attribute_map = { 'attribute_string': 'attribute_string', # noqa: E501 'attribute_number': 'attribute_number', # noqa: E501 @@ -156,7 +157,7 @@ class XmlItem(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """xml_item.XmlItem - a model defined in OpenAPI + """XmlItem - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index ff378aa1e15..de9fc5c3a27 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -41,9 +41,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py index e87caa28bc1..ce985f76ed9 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_any_type.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py index 503b4952a20..f63ca82f6c2 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_array.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_array.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py index da5dc154691..e5a13891c09 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_boolean.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py index 42fdf194873..befc14455da 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py index e594f8207df..0e08b8f8770 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_integer.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py index d678ad4d658..90f4429e989 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_number.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_number.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py index 9088632e9f5..ded4a8e8a12 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_object.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_object.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py index 29c09806c15..cff2c31921f 100644 --- a/samples/client/petstore/python-experimental/test/test_additional_properties_string.py +++ b/samples/client/petstore/python-experimental/test/test_additional_properties_string.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal.py b/samples/client/petstore/python-experimental/test/test_animal.py index 0e1f8507373..958f303f13e 100644 --- a/samples/client/petstore/python-experimental/test/test_animal.py +++ b/samples/client/petstore/python-experimental/test/test_animal.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_animal_farm.py b/samples/client/petstore/python-experimental/test/test_animal_farm.py index f473c465d73..7117d42b430 100644 --- a/samples/client/petstore/python-experimental/test/test_animal_farm.py +++ b/samples/client/petstore/python-experimental/test/test_animal_farm.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_another_fake_api.py b/samples/client/petstore/python-experimental/test/test_another_fake_api.py index c58dfa6202b..f79966a2696 100644 --- a/samples/client/petstore/python-experimental/test/test_another_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_another_fake_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_api_response.py b/samples/client/petstore/python-experimental/test/test_api_response.py index a9a900c29cf..9db92633f62 100644 --- a/samples/client/petstore/python-experimental/test/test_api_response.py +++ b/samples/client/petstore/python-experimental/test/test_api_response.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py index 39f8874a4e8..4980ad17afb 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_array_of_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py index c4abfd06861..479c537cada 100644 --- a/samples/client/petstore/python-experimental/test/test_array_of_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_array_of_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_array_test.py b/samples/client/petstore/python-experimental/test/test_array_test.py index f966f4c0d85..2426b27b7e4 100644 --- a/samples/client/petstore/python-experimental/test/test_array_test.py +++ b/samples/client/petstore/python-experimental/test/test_array_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_capitalization.py b/samples/client/petstore/python-experimental/test/test_capitalization.py index 5f47ddb4db0..20d2649c01e 100644 --- a/samples/client/petstore/python-experimental/test/test_capitalization.py +++ b/samples/client/petstore/python-experimental/test/test_capitalization.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat.py b/samples/client/petstore/python-experimental/test/test_cat.py index 5f6eba3f847..64b525aaf11 100644 --- a/samples/client/petstore/python-experimental/test/test_cat.py +++ b/samples/client/petstore/python-experimental/test/test_cat.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_cat_all_of.py index 3d5a33d9907..a5bb91ac864 100644 --- a/samples/client/petstore/python-experimental/test/test_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_cat_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_category.py b/samples/client/petstore/python-experimental/test/test_category.py index 29490e0dbdb..59b64e5924a 100644 --- a/samples/client/petstore/python-experimental/test/test_category.py +++ b/samples/client/petstore/python-experimental/test/test_category.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child.py b/samples/client/petstore/python-experimental/test/test_child.py index 7739901bd81..3b49febd953 100644 --- a/samples/client/petstore/python-experimental/test/test_child.py +++ b/samples/client/petstore/python-experimental/test/test_child.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_all_of.py b/samples/client/petstore/python-experimental/test/test_child_all_of.py index b216908b0a6..96e479cf079 100644 --- a/samples/client/petstore/python-experimental/test/test_child_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat.py b/samples/client/petstore/python-experimental/test/test_child_cat.py index ba3c16543d8..34c085515a8 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py index 2a0b6b8c220..2a7aab100fb 100644 --- a/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_cat_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog.py b/samples/client/petstore/python-experimental/test/test_child_dog.py index 5a726e61244..dfb09213e40 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py index eec5e355674..ca75000c650 100644 --- a/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_dog_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard.py b/samples/client/petstore/python-experimental/test/test_child_lizard.py index 0b2bc17c143..975dc1612a9 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py index 7f1ae842e66..1b3bf4dba94 100644 --- a/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_child_lizard_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_class_model.py b/samples/client/petstore/python-experimental/test/test_class_model.py index 6dc2a692832..060df39e4b5 100644 --- a/samples/client/petstore/python-experimental/test/test_class_model.py +++ b/samples/client/petstore/python-experimental/test/test_class_model.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_client.py b/samples/client/petstore/python-experimental/test/test_client.py index caf85a24aa2..ab5e3a80d37 100644 --- a/samples/client/petstore/python-experimental/test/test_client.py +++ b/samples/client/petstore/python-experimental/test/test_client.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog.py b/samples/client/petstore/python-experimental/test/test_dog.py index 0bdb477f864..0b95c0a4c83 100644 --- a/samples/client/petstore/python-experimental/test/test_dog.py +++ b/samples/client/petstore/python-experimental/test/test_dog.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_dog_all_of.py b/samples/client/petstore/python-experimental/test/test_dog_all_of.py index 9f5075b7ed7..7ab4e8ae79d 100644 --- a/samples/client/petstore/python-experimental/test/test_dog_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_dog_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_arrays.py b/samples/client/petstore/python-experimental/test/test_enum_arrays.py index b1d0394df85..64ad5fd7dc0 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_arrays.py +++ b/samples/client/petstore/python-experimental/test/test_enum_arrays.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_class.py b/samples/client/petstore/python-experimental/test/test_enum_class.py index ed19c7985d4..f910231c9d0 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_class.py +++ b/samples/client/petstore/python-experimental/test/test_enum_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_enum_test.py b/samples/client/petstore/python-experimental/test/test_enum_test.py index b79127a3985..7b4c1b6b66a 100644 --- a/samples/client/petstore/python-experimental/test/test_enum_test.py +++ b/samples/client/petstore/python-experimental/test/test_enum_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_fake_api.py b/samples/client/petstore/python-experimental/test/test_fake_api.py index 6e3c87bc70a..34d207f3c71 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api @@ -109,7 +111,11 @@ class TestFakeApi(unittest.TestCase): """ # when we omit the required enums of length one, they are still set endpoint = self.api.test_endpoint_enums_length_one - from unittest.mock import patch + import six + if six.PY3: + from unittest.mock import patch + else: + from mock import patch with patch.object(endpoint, 'call_with_http_info') as call_with_http_info: endpoint() call_with_http_info.assert_called_with( diff --git a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py index b7724aaed7d..1ade31405a6 100644 --- a/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py +++ b/samples/client/petstore/python-experimental/test/test_fake_classname_tags_123_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import +import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_file.py b/samples/client/petstore/python-experimental/test/test_file.py index 438482f3952..8d60f64e01c 100644 --- a/samples/client/petstore/python-experimental/test/test_file.py +++ b/samples/client/petstore/python-experimental/test/test_file.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py index ec38c523c7d..9a4f6d38dfe 100644 --- a/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py +++ b/samples/client/petstore/python-experimental/test/test_file_schema_test_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index ec2c8d0cbe3..ca37b005fd9 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent.py b/samples/client/petstore/python-experimental/test/test_grandparent.py index bf2455a5ca0..2972d01161c 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py index 42b1f0f716b..cabe4d81f98 100644 --- a/samples/client/petstore/python-experimental/test/test_grandparent_animal.py +++ b/samples/client/petstore/python-experimental/test/test_grandparent_animal.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py index c9bf4c28658..9ebd7683b39 100644 --- a/samples/client/petstore/python-experimental/test/test_has_only_read_only.py +++ b/samples/client/petstore/python-experimental/test/test_has_only_read_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_list.py b/samples/client/petstore/python-experimental/test/test_list.py index 77611c300dc..52156adfed2 100644 --- a/samples/client/petstore/python-experimental/test/test_list.py +++ b/samples/client/petstore/python-experimental/test/test_list.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_map_test.py b/samples/client/petstore/python-experimental/test/test_map_test.py index f905d7e919c..3feda0f688d 100644 --- a/samples/client/petstore/python-experimental/test/test_map_test.py +++ b/samples/client/petstore/python-experimental/test/test_map_test.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py index 7de400b004f..4dcb5ad4268 100644 --- a/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python-experimental/test/test_mixed_properties_and_additional_properties_class.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model200_response.py b/samples/client/petstore/python-experimental/test/test_model200_response.py index 8ff474d5dde..4012eaae336 100644 --- a/samples/client/petstore/python-experimental/test/test_model200_response.py +++ b/samples/client/petstore/python-experimental/test/test_model200_response.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_model_return.py b/samples/client/petstore/python-experimental/test/test_model_return.py index f856d3d7620..54c98b33cd6 100644 --- a/samples/client/petstore/python-experimental/test/test_model_return.py +++ b/samples/client/petstore/python-experimental/test/test_model_return.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_name.py b/samples/client/petstore/python-experimental/test/test_name.py index b3841ca0304..6a9be99d1a5 100644 --- a/samples/client/petstore/python-experimental/test/test_name.py +++ b/samples/client/petstore/python-experimental/test/test_name.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_only.py b/samples/client/petstore/python-experimental/test/test_number_only.py index b7205f5fe02..07aab1d78af 100644 --- a/samples/client/petstore/python-experimental/test/test_number_only.py +++ b/samples/client/petstore/python-experimental/test/test_number_only.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_number_with_validations.py b/samples/client/petstore/python-experimental/test/test_number_with_validations.py index 98dc2930d3b..3f0b78835d4 100644 --- a/samples/client/petstore/python-experimental/test/test_number_with_validations.py +++ b/samples/client/petstore/python-experimental/test/test_number_with_validations.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index cdf42fcd662..35bd3b6d8ec 100644 --- a/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest @@ -33,11 +34,11 @@ class TestObjectModelWithRefProps(unittest.TestCase): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import number_with_validations + from petstore_api.model.number_with_validations import NumberWithValidations self.assertEqual( ObjectModelWithRefProps.openapi_types, { - 'my_number': (number_with_validations.NumberWithValidations,), + 'my_number': (NumberWithValidations,), 'my_string': (str,), 'my_boolean': (bool,), } diff --git a/samples/client/petstore/python-experimental/test/test_order.py b/samples/client/petstore/python-experimental/test/test_order.py index 03f633d353f..ee6988e28cc 100644 --- a/samples/client/petstore/python-experimental/test/test_order.py +++ b/samples/client/petstore/python-experimental/test/test_order.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent.py b/samples/client/petstore/python-experimental/test/test_parent.py index 385c66d2a69..20282dfb41e 100644 --- a/samples/client/petstore/python-experimental/test/test_parent.py +++ b/samples/client/petstore/python-experimental/test/test_parent.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_all_of.py b/samples/client/petstore/python-experimental/test/test_parent_all_of.py index f6485ac3cc3..ca87189bba5 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_all_of.py +++ b/samples/client/petstore/python-experimental/test/test_parent_all_of.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_parent_pet.py b/samples/client/petstore/python-experimental/test/test_parent_pet.py index 4a69d88eb78..17a4d60e75d 100644 --- a/samples/client/petstore/python-experimental/test/test_parent_pet.py +++ b/samples/client/petstore/python-experimental/test/test_parent_pet.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet.py b/samples/client/petstore/python-experimental/test/test_pet.py index 9edf385aa26..b072cff5e9a 100644 --- a/samples/client/petstore/python-experimental/test/test_pet.py +++ b/samples/client/petstore/python-experimental/test/test_pet.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_pet_api.py b/samples/client/petstore/python-experimental/test/test_pet_api.py index d545f497297..091b30cf8ac 100644 --- a/samples/client/petstore/python-experimental/test/test_pet_api.py +++ b/samples/client/petstore/python-experimental/test/test_pet_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import +import sys import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_player.py b/samples/client/petstore/python-experimental/test/test_player.py index 6dc81378727..ee7b95a677f 100644 --- a/samples/client/petstore/python-experimental/test/test_player.py +++ b/samples/client/petstore/python-experimental/test/test_player.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_read_only_first.py b/samples/client/petstore/python-experimental/test/test_read_only_first.py index a07676e9c2d..c2dcde240e7 100644 --- a/samples/client/petstore/python-experimental/test/test_read_only_first.py +++ b/samples/client/petstore/python-experimental/test/test_read_only_first.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_special_model_name.py b/samples/client/petstore/python-experimental/test/test_special_model_name.py index 4c525d99be5..6124525f517 100644 --- a/samples/client/petstore/python-experimental/test/test_special_model_name.py +++ b/samples/client/petstore/python-experimental/test/test_special_model_name.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_store_api.py b/samples/client/petstore/python-experimental/test/test_store_api.py index 3680a34b42a..0d9cc3dd36e 100644 --- a/samples/client/petstore/python-experimental/test/test_store_api.py +++ b/samples/client/petstore/python-experimental/test/test_store_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py index e4e795cca2a..e2e9d8b420b 100644 --- a/samples/client/petstore/python-experimental/test/test_string_boolean_map.py +++ b/samples/client/petstore/python-experimental/test/test_string_boolean_map.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_string_enum.py b/samples/client/petstore/python-experimental/test/test_string_enum.py index c7f463c444a..5eed0ad6f0e 100644 --- a/samples/client/petstore/python-experimental/test/test_string_enum.py +++ b/samples/client/petstore/python-experimental/test/test_string_enum.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_tag.py b/samples/client/petstore/python-experimental/test/test_tag.py index 0ce1c0a87f1..68a3b9046bf 100644 --- a/samples/client/petstore/python-experimental/test/test_tag.py +++ b/samples/client/petstore/python-experimental/test/test_tag.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_default.py b/samples/client/petstore/python-experimental/test/test_type_holder_default.py index 4a517b305b6..f9c050b81a8 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_default.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_default.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_type_holder_example.py b/samples/client/petstore/python-experimental/test/test_type_holder_example.py index 8d3c5c745df..e1ee7c36862 100644 --- a/samples/client/petstore/python-experimental/test/test_type_holder_example.py +++ b/samples/client/petstore/python-experimental/test/test_type_holder_example.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user.py b/samples/client/petstore/python-experimental/test/test_user.py index df3d2fff653..7241bb589c5 100644 --- a/samples/client/petstore/python-experimental/test/test_user.py +++ b/samples/client/petstore/python-experimental/test/test_user.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/test/test_user_api.py b/samples/client/petstore/python-experimental/test/test_user_api.py index abf57b0733d..df306da0776 100644 --- a/samples/client/petstore/python-experimental/test/test_user_api.py +++ b/samples/client/petstore/python-experimental/test/test_user_api.py @@ -10,6 +10,8 @@ """ +from __future__ import absolute_import + import unittest import petstore_api diff --git a/samples/client/petstore/python-experimental/test/test_xml_item.py b/samples/client/petstore/python-experimental/test/test_xml_item.py index 04322addc2a..4354664815f 100644 --- a/samples/client/petstore/python-experimental/test/test_xml_item.py +++ b/samples/client/petstore/python-experimental/test/test_xml_item.py @@ -10,6 +10,7 @@ """ +from __future__ import absolute_import import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 3c415e2ad7b..0d0771b5785 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -10,6 +10,7 @@ $ nosetests -v """ import os +import six import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index a5b1a66e7a4..e9ef8951fa2 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -15,6 +15,8 @@ import time import unittest import datetime +import six + import petstore_api from petstore_api.exceptions import ( @@ -377,7 +379,8 @@ class DeserializationTests(unittest.TestCase): file_path = file_object.name self.assertFalse(file_object.closed) file_object.close() - file_data = file_data.encode('utf-8') + if six.PY3: + file_data = file_data.encode('utf-8') with open(file_path, 'rb') as other_file_object: self.assertEqual(other_file_object.read(), file_data) finally: @@ -402,7 +405,7 @@ class DeserializationTests(unittest.TestCase): http_response = HTTPResponse( status=200, reason='OK', - data=json.dumps(data).encode("utf-8"), + data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), getheaders=get_headers, getheader=get_header ) diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 0a66b49c1d7..38d7a1cc0b8 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -23,6 +23,8 @@ from petstore_api.rest import ( RESTResponse ) +import six + from petstore_api.exceptions import ( ApiException, ApiValueError, @@ -34,7 +36,10 @@ from .util import id_gen import urllib3 -from unittest.mock import patch +if six.PY3: + from unittest.mock import patch +else: + from mock import patch HOST = 'http://localhost/v2' diff --git a/samples/client/petstore/python-experimental/tests/test_serialization.py b/samples/client/petstore/python-experimental/tests/test_serialization.py index 6f7166ee563..1f718ecca6b 100644 --- a/samples/client/petstore/python-experimental/tests/test_serialization.py +++ b/samples/client/petstore/python-experimental/tests/test_serialization.py @@ -15,6 +15,8 @@ import time import unittest import datetime +import six + import petstore_api from petstore_api.exceptions import ( diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py index 4bbe813f369..6be24a8fc54 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python-experimental/x_auth_id_alias/model_utils.py @@ -41,9 +41,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py index c35b5a8531c..685b622e6f0 100644 --- a/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py +++ b/samples/openapi3/client/features/dynamic-servers/python-experimental/dynamic_servers/model_utils.py @@ -41,9 +41,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index c1f2770b3cc..291496d2495 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -50,7 +50,7 @@ import time import petstore_api from pprint import pprint from petstore_api.api import another_fake_api -from petstore_api.model import client +from petstore_api.model.client import Client # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. configuration = petstore_api.Configuration( @@ -63,11 +63,11 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model try: # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) + api_response = api_instance.call_123_test_special_tags(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) @@ -126,94 +126,94 @@ Class | Method | HTTP request | Description ## Documentation For Models - - [additional_properties_class.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) - - [address.Address](docs/Address.md) - - [animal.Animal](docs/Animal.md) - - [animal_farm.AnimalFarm](docs/AnimalFarm.md) - - [api_response.ApiResponse](docs/ApiResponse.md) - - [apple.Apple](docs/Apple.md) - - [apple_req.AppleReq](docs/AppleReq.md) - - [array_of_array_of_number_only.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [array_of_enums.ArrayOfEnums](docs/ArrayOfEnums.md) - - [array_of_number_only.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [array_test.ArrayTest](docs/ArrayTest.md) - - [banana.Banana](docs/Banana.md) - - [banana_req.BananaReq](docs/BananaReq.md) - - [basque_pig.BasquePig](docs/BasquePig.md) - - [capitalization.Capitalization](docs/Capitalization.md) - - [cat.Cat](docs/Cat.md) - - [cat_all_of.CatAllOf](docs/CatAllOf.md) - - [category.Category](docs/Category.md) - - [child_cat.ChildCat](docs/ChildCat.md) - - [child_cat_all_of.ChildCatAllOf](docs/ChildCatAllOf.md) - - [class_model.ClassModel](docs/ClassModel.md) - - [client.Client](docs/Client.md) - - [complex_quadrilateral.ComplexQuadrilateral](docs/ComplexQuadrilateral.md) - - [composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) - - [danish_pig.DanishPig](docs/DanishPig.md) - - [dog.Dog](docs/Dog.md) - - [dog_all_of.DogAllOf](docs/DogAllOf.md) - - [drawing.Drawing](docs/Drawing.md) - - [enum_arrays.EnumArrays](docs/EnumArrays.md) - - [enum_class.EnumClass](docs/EnumClass.md) - - [enum_test.EnumTest](docs/EnumTest.md) - - [equilateral_triangle.EquilateralTriangle](docs/EquilateralTriangle.md) - - [file.File](docs/File.md) - - [file_schema_test_class.FileSchemaTestClass](docs/FileSchemaTestClass.md) - - [foo.Foo](docs/Foo.md) - - [format_test.FormatTest](docs/FormatTest.md) - - [fruit.Fruit](docs/Fruit.md) - - [fruit_req.FruitReq](docs/FruitReq.md) - - [gm_fruit.GmFruit](docs/GmFruit.md) - - [grandparent_animal.GrandparentAnimal](docs/GrandparentAnimal.md) - - [has_only_read_only.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [health_check_result.HealthCheckResult](docs/HealthCheckResult.md) - - [inline_object.InlineObject](docs/InlineObject.md) - - [inline_object1.InlineObject1](docs/InlineObject1.md) - - [inline_object2.InlineObject2](docs/InlineObject2.md) - - [inline_object3.InlineObject3](docs/InlineObject3.md) - - [inline_object4.InlineObject4](docs/InlineObject4.md) - - [inline_object5.InlineObject5](docs/InlineObject5.md) - - [inline_response_default.InlineResponseDefault](docs/InlineResponseDefault.md) - - [integer_enum.IntegerEnum](docs/IntegerEnum.md) - - [integer_enum_one_value.IntegerEnumOneValue](docs/IntegerEnumOneValue.md) - - [integer_enum_with_default_value.IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) - - [isosceles_triangle.IsoscelesTriangle](docs/IsoscelesTriangle.md) - - [list.List](docs/List.md) - - [mammal.Mammal](docs/Mammal.md) - - [map_test.MapTest](docs/MapTest.md) - - [mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [model200_response.Model200Response](docs/Model200Response.md) - - [model_return.ModelReturn](docs/ModelReturn.md) - - [name.Name](docs/Name.md) - - [nullable_class.NullableClass](docs/NullableClass.md) - - [nullable_shape.NullableShape](docs/NullableShape.md) - - [number_only.NumberOnly](docs/NumberOnly.md) - - [number_with_validations.NumberWithValidations](docs/NumberWithValidations.md) - - [object_model_with_ref_props.ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) - - [order.Order](docs/Order.md) - - [parent_pet.ParentPet](docs/ParentPet.md) - - [pet.Pet](docs/Pet.md) - - [pig.Pig](docs/Pig.md) - - [quadrilateral.Quadrilateral](docs/Quadrilateral.md) - - [quadrilateral_interface.QuadrilateralInterface](docs/QuadrilateralInterface.md) - - [read_only_first.ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [scalene_triangle.ScaleneTriangle](docs/ScaleneTriangle.md) - - [shape.Shape](docs/Shape.md) - - [shape_interface.ShapeInterface](docs/ShapeInterface.md) - - [shape_or_null.ShapeOrNull](docs/ShapeOrNull.md) - - [simple_quadrilateral.SimpleQuadrilateral](docs/SimpleQuadrilateral.md) - - [special_model_name.SpecialModelName](docs/SpecialModelName.md) - - [string_boolean_map.StringBooleanMap](docs/StringBooleanMap.md) - - [string_enum.StringEnum](docs/StringEnum.md) - - [string_enum_with_default_value.StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) - - [tag.Tag](docs/Tag.md) - - [triangle.Triangle](docs/Triangle.md) - - [triangle_interface.TriangleInterface](docs/TriangleInterface.md) - - [user.User](docs/User.md) - - [whale.Whale](docs/Whale.md) - - [zebra.Zebra](docs/Zebra.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesWithArrayOfEnums](docs/AdditionalPropertiesWithArrayOfEnums.md) + - [Address](docs/Address.md) + - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) + - [ApiResponse](docs/ApiResponse.md) + - [Apple](docs/Apple.md) + - [AppleReq](docs/AppleReq.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfEnums](docs/ArrayOfEnums.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Banana](docs/Banana.md) + - [BananaReq](docs/BananaReq.md) + - [BasquePig](docs/BasquePig.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ChildCat](docs/ChildCat.md) + - [ChildCatAllOf](docs/ChildCatAllOf.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [ComplexQuadrilateral](docs/ComplexQuadrilateral.md) + - [ComposedOneOfNumberWithValidations](docs/ComposedOneOfNumberWithValidations.md) + - [DanishPig](docs/DanishPig.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [Drawing](docs/Drawing.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [EquilateralTriangle](docs/EquilateralTriangle.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [Fruit](docs/Fruit.md) + - [FruitReq](docs/FruitReq.md) + - [GmFruit](docs/GmFruit.md) + - [GrandparentAnimal](docs/GrandparentAnimal.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [IntegerEnum](docs/IntegerEnum.md) + - [IntegerEnumOneValue](docs/IntegerEnumOneValue.md) + - [IntegerEnumWithDefaultValue](docs/IntegerEnumWithDefaultValue.md) + - [IsoscelesTriangle](docs/IsoscelesTriangle.md) + - [List](docs/List.md) + - [Mammal](docs/Mammal.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NullableShape](docs/NullableShape.md) + - [NumberOnly](docs/NumberOnly.md) + - [NumberWithValidations](docs/NumberWithValidations.md) + - [ObjectModelWithRefProps](docs/ObjectModelWithRefProps.md) + - [Order](docs/Order.md) + - [ParentPet](docs/ParentPet.md) + - [Pet](docs/Pet.md) + - [Pig](docs/Pig.md) + - [Quadrilateral](docs/Quadrilateral.md) + - [QuadrilateralInterface](docs/QuadrilateralInterface.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [ScaleneTriangle](docs/ScaleneTriangle.md) + - [Shape](docs/Shape.md) + - [ShapeInterface](docs/ShapeInterface.md) + - [ShapeOrNull](docs/ShapeOrNull.md) + - [SimpleQuadrilateral](docs/SimpleQuadrilateral.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [StringBooleanMap](docs/StringBooleanMap.md) + - [StringEnum](docs/StringEnum.md) + - [StringEnumWithDefaultValue](docs/StringEnumWithDefaultValue.md) + - [Tag](docs/Tag.md) + - [Triangle](docs/Triangle.md) + - [TriangleInterface](docs/TriangleInterface.md) + - [User](docs/User.md) + - [Whale](docs/Whale.md) + - [Zebra](docs/Zebra.md) ## Documentation For Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md index 042d7c437d6..e54a02329f1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesClass.md @@ -1,4 +1,4 @@ -# additional_properties_class.AdditionalPropertiesClass +# AdditionalPropertiesClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md index 10ab1cf5b34..124de21cf33 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AdditionalPropertiesWithArrayOfEnums.md @@ -1,9 +1,9 @@ -# additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums +# AdditionalPropertiesWithArrayOfEnums ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**any string name** | **[enum_class.EnumClass]** | any string name can be used but the value must be the correct type | [optional] +**any string name** | **[EnumClass]** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Address.md b/samples/openapi3/client/petstore/python-experimental/docs/Address.md index 23a2f2b1aec..f0699983eb7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Address.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Address.md @@ -1,4 +1,4 @@ -# address.Address +# Address ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md index fda84ee28ee..e59166a62e8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Animal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Animal.md @@ -1,4 +1,4 @@ -# animal.Animal +# Animal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md index c9976c7ddab..0717b5d7df1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnimalFarm.md @@ -1,9 +1,9 @@ -# animal_farm.AnimalFarm +# AnimalFarm ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[animal.Animal]**](Animal.md) | | +**value** | [**[Animal]**](Animal.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index b4f0834b121..c0b203732c3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **call_123_test_special_tags** -> client.Client call_123_test_special_tags(client_client) +> Client call_123_test_special_tags(client) To test special tags @@ -20,7 +20,7 @@ To test special tags and operation ID starting with number import time import petstore_api from petstore_api.api import another_fake_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -33,12 +33,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = another_fake_api.AnotherFakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test special tags - api_response = api_instance.call_123_test_special_tags(client_client) + api_response = api_instance.call_123_test_special_tags(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling AnotherFakeApi->call_123_test_special_tags: %s\n" % e) @@ -48,11 +48,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md index 8f7ffa46134..8fc302305ab 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ApiResponse.md @@ -1,4 +1,4 @@ -# api_response.ApiResponse +# ApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md index bd9818b8977..bf729dc7452 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Apple.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Apple.md @@ -1,4 +1,4 @@ -# apple.Apple +# Apple ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md index 3d6717ebd60..03370bdb968 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AppleReq.md @@ -1,4 +1,4 @@ -# apple_req.AppleReq +# AppleReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md index ab82c8c556d..1a68df0090b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_array_of_number_only.ArrayOfArrayOfNumberOnly +# ArrayOfArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md index e12fa68b8e9..8a1dfca693a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfEnums.md @@ -1,9 +1,9 @@ -# array_of_enums.ArrayOfEnums +# ArrayOfEnums ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**value** | [**[string_enum.StringEnum, none_type]**](StringEnum.md) | | +**value** | [**[StringEnum]**](StringEnum.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md index b8ffd843c8d..b8a760f56dc 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayOfNumberOnly.md @@ -1,4 +1,4 @@ -# array_of_number_only.ArrayOfNumberOnly +# ArrayOfNumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md index 22f198440e7..b94f23fd227 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ArrayTest.md @@ -1,11 +1,11 @@ -# array_test.ArrayTest +# ArrayTest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **array_of_string** | **[str]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional] -**array_array_of_model** | [**[[read_only_first.ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] +**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Banana.md b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md index ec8b3b902cc..5a5364538ba 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Banana.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Banana.md @@ -1,4 +1,4 @@ -# banana.Banana +# Banana ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md index 5cfe53ec741..804f9f11eb0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/BananaReq.md @@ -1,4 +1,4 @@ -# banana_req.BananaReq +# BananaReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md index 0e8f8bb27fb..5c8a3252529 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/BasquePig.md @@ -1,4 +1,4 @@ -# basque_pig.BasquePig +# BasquePig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md index d402f2a571a..85d88d239ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Capitalization.md @@ -1,4 +1,4 @@ -# capitalization.Capitalization +# Capitalization ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md index 846a97c82a8..d01b2effd04 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Cat.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Cat.md @@ -1,4 +1,4 @@ -# cat.Cat +# Cat ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md index 653bb0aa353..35434374fc9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/CatAllOf.md @@ -1,4 +1,4 @@ -# cat_all_of.CatAllOf +# CatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Category.md b/samples/openapi3/client/petstore/python-experimental/docs/Category.md index bb122d910fc..33b2242d703 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Category.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Category.md @@ -1,4 +1,4 @@ -# category.Category +# Category ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md index bee23082474..d39ee461163 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCat.md @@ -1,4 +1,4 @@ -# child_cat.ChildCat +# ChildCat ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md index 2e84f31081f..f48345511c1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ChildCatAllOf.md @@ -1,4 +1,4 @@ -# child_cat_all_of.ChildCatAllOf +# ChildCatAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md index 3f5d0075c1b..657d51a944d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ClassModel.md @@ -1,4 +1,4 @@ -# class_model.ClassModel +# ClassModel Model for testing model with \"_class\" property ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Client.md b/samples/openapi3/client/petstore/python-experimental/docs/Client.md index 4c7ce57f750..88e99384f92 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Client.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Client.md @@ -1,4 +1,4 @@ -# client.Client +# Client ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md index 4230b57b126..672d5c2acb0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComplexQuadrilateral.md @@ -1,4 +1,4 @@ -# complex_quadrilateral.ComplexQuadrilateral +# ComplexQuadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md index 1274b58a506..453d1a4d5b1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ComposedOneOfNumberWithValidations.md @@ -1,4 +1,4 @@ -# composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations +# ComposedOneOfNumberWithValidations this is a model that allows payloads of type object or number ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md index 65058d86e04..5501dc6b7c5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DanishPig.md @@ -1,4 +1,4 @@ -# danish_pig.DanishPig +# DanishPig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index 45617a26a75..3331aea8a25 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **foo_get** -> inline_response_default.InlineResponseDefault foo_get() +> InlineResponseDefault foo_get() @@ -18,7 +18,7 @@ Method | HTTP request | Description import time import petstore_api from petstore_api.api import default_api -from petstore_api.model import inline_response_default +from petstore_api.model.inline_response_default import InlineResponseDefault from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -45,7 +45,7 @@ This endpoint does not need any parameter. ### Return type -[**inline_response_default.InlineResponseDefault**](InlineResponseDefault.md) +[**InlineResponseDefault**](InlineResponseDefault.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md index 4c0497d6769..f2044b25341 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Dog.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Dog.md @@ -1,4 +1,4 @@ -# dog.Dog +# Dog ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md index da3c29557df..36d3216f7b3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DogAllOf.md @@ -1,4 +1,4 @@ -# dog_all_of.DogAllOf +# DogAllOf ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md index 1583a1dea01..73500bc0c5d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Drawing.md @@ -1,13 +1,13 @@ -# drawing.Drawing +# Drawing ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**main_shape** | [**shape.Shape**](Shape.md) | | [optional] -**shape_or_null** | [**shape_or_null.ShapeOrNull**](ShapeOrNull.md) | | [optional] -**nullable_shape** | [**nullable_shape.NullableShape**](NullableShape.md) | | [optional] -**shapes** | [**[shape.Shape]**](Shape.md) | | [optional] -**any string name** | **fruit.Fruit** | any string name can be used but the value must be the correct type | [optional] +**main_shape** | [**Shape**](Shape.md) | | [optional] +**shape_or_null** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional] +**nullable_shape** | [**NullableShape**](NullableShape.md) | | [optional] +**shapes** | [**[Shape]**](Shape.md) | | [optional] +**any string name** | **Fruit** | any string name can be used but the value must be the correct type | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md index c2f22d45047..e0b5582e9d5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumArrays.md @@ -1,4 +1,4 @@ -# enum_arrays.EnumArrays +# EnumArrays ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md index 4a29732d861..6e7ecf355ff 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumClass.md @@ -1,4 +1,4 @@ -# enum_class.EnumClass +# EnumClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md index da6c2440708..70969239ca2 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EnumTest.md @@ -1,4 +1,4 @@ -# enum_test.EnumTest +# EnumTest ## Properties Name | Type | Description | Notes @@ -7,11 +7,11 @@ Name | Type | Description | Notes **enum_string** | **str** | | [optional] **enum_integer** | **int** | | [optional] **enum_number** | **float** | | [optional] -**string_enum** | [**string_enum.StringEnum, none_type**](StringEnum.md) | | [optional] -**integer_enum** | [**integer_enum.IntegerEnum**](IntegerEnum.md) | | [optional] -**string_enum_with_default_value** | [**string_enum_with_default_value.StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] -**integer_enum_with_default_value** | [**integer_enum_with_default_value.IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] -**integer_enum_one_value** | [**integer_enum_one_value.IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] +**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] +**integer_enum** | [**IntegerEnum**](IntegerEnum.md) | | [optional] +**string_enum_with_default_value** | [**StringEnumWithDefaultValue**](StringEnumWithDefaultValue.md) | | [optional] +**integer_enum_with_default_value** | [**IntegerEnumWithDefaultValue**](IntegerEnumWithDefaultValue.md) | | [optional] +**integer_enum_one_value** | [**IntegerEnumOneValue**](IntegerEnumOneValue.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md index 2263b96b258..e73229ddc46 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/EquilateralTriangle.md @@ -1,4 +1,4 @@ -# equilateral_triangle.EquilateralTriangle +# EquilateralTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index a9a8e6ca115..47c7f50f3ec 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -26,7 +26,7 @@ Method | HTTP request | Description # **additional_properties_with_array_of_enums** -> additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() +> AdditionalPropertiesWithArrayOfEnums additional_properties_with_array_of_enums() Additional Properties with Array of Enums @@ -36,7 +36,7 @@ Additional Properties with Array of Enums import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import additional_properties_with_array_of_enums +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -49,13 +49,13 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - additional_properties_with_array_of_enums_additional_properties_with_array_of_enums = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums() # additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums | Input enum (optional) + additional_properties_with_array_of_enums = AdditionalPropertiesWithArrayOfEnums() # AdditionalPropertiesWithArrayOfEnums | Input enum (optional) # example passing only required values which don't have defaults set # and optional values try: # Additional Properties with Array of Enums - api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums_additional_properties_with_array_of_enums=additional_properties_with_array_of_enums_additional_properties_with_array_of_enums) + api_response = api_instance.additional_properties_with_array_of_enums(additional_properties_with_array_of_enums=additional_properties_with_array_of_enums) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->additional_properties_with_array_of_enums: %s\n" % e) @@ -65,11 +65,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **additional_properties_with_array_of_enums_additional_properties_with_array_of_enums** | [**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] + **additional_properties_with_array_of_enums** | [**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md)| Input enum | [optional] ### Return type -[**additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) +[**AdditionalPropertiesWithArrayOfEnums**](AdditionalPropertiesWithArrayOfEnums.md) ### Authorization @@ -88,7 +88,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **array_model** -> animal_farm.AnimalFarm array_model() +> AnimalFarm array_model() @@ -100,7 +100,7 @@ Test serialization of ArrayModel import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import animal_farm +from petstore_api.model.animal_farm import AnimalFarm from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -113,7 +113,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = animal_farm.AnimalFarm() # animal_farm.AnimalFarm | Input model (optional) + body = AnimalFarm() # AnimalFarm | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -128,11 +128,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**animal_farm.AnimalFarm**](AnimalFarm.md)| Input model | [optional] + **body** | [**AnimalFarm**](AnimalFarm.md)| Input model | [optional] ### Return type -[**animal_farm.AnimalFarm**](AnimalFarm.md) +[**AnimalFarm**](AnimalFarm.md) ### Authorization @@ -151,7 +151,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **array_of_enums** -> array_of_enums.ArrayOfEnums array_of_enums() +> ArrayOfEnums array_of_enums() Array of Enums @@ -161,7 +161,7 @@ Array of Enums import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import array_of_enums +from petstore_api.model.array_of_enums import ArrayOfEnums from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -174,13 +174,13 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - array_of_enums_array_of_enums = array_of_enums.ArrayOfEnums() # array_of_enums.ArrayOfEnums | Input enum (optional) + array_of_enums = ArrayOfEnums() # ArrayOfEnums | Input enum (optional) # example passing only required values which don't have defaults set # and optional values try: # Array of Enums - api_response = api_instance.array_of_enums(array_of_enums_array_of_enums=array_of_enums_array_of_enums) + api_response = api_instance.array_of_enums(array_of_enums=array_of_enums) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->array_of_enums: %s\n" % e) @@ -190,11 +190,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **array_of_enums_array_of_enums** | [**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] + **array_of_enums** | [**ArrayOfEnums**](ArrayOfEnums.md)| Input enum | [optional] ### Return type -[**array_of_enums.ArrayOfEnums**](ArrayOfEnums.md) +[**ArrayOfEnums**](ArrayOfEnums.md) ### Authorization @@ -275,7 +275,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **composed_one_of_number_with_validations** -> composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() +> ComposedOneOfNumberWithValidations composed_one_of_number_with_validations() @@ -287,7 +287,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import composed_one_of_number_with_validations +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -300,12 +300,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - composed_one_of_number_with_validations_composed_one_of_number_with_validations = composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations() # composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations | Input model (optional) + composed_one_of_number_with_validations = ComposedOneOfNumberWithValidations() # ComposedOneOfNumberWithValidations | Input model (optional) # example passing only required values which don't have defaults set # and optional values try: - api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations_composed_one_of_number_with_validations=composed_one_of_number_with_validations_composed_one_of_number_with_validations) + api_response = api_instance.composed_one_of_number_with_validations(composed_one_of_number_with_validations=composed_one_of_number_with_validations) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->composed_one_of_number_with_validations: %s\n" % e) @@ -315,11 +315,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **composed_one_of_number_with_validations_composed_one_of_number_with_validations** | [**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] + **composed_one_of_number_with_validations** | [**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md)| Input model | [optional] ### Return type -[**composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) +[**ComposedOneOfNumberWithValidations**](ComposedOneOfNumberWithValidations.md) ### Authorization @@ -338,7 +338,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **fake_health_get** -> health_check_result.HealthCheckResult fake_health_get() +> HealthCheckResult fake_health_get() Health check endpoint @@ -348,7 +348,7 @@ Health check endpoint import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import health_check_result +from petstore_api.model.health_check_result import HealthCheckResult from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -376,7 +376,7 @@ This endpoint does not need any parameter. ### Return type -[**health_check_result.HealthCheckResult**](HealthCheckResult.md) +[**HealthCheckResult**](HealthCheckResult.md) ### Authorization @@ -395,7 +395,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **number_with_validations** -> number_with_validations.NumberWithValidations number_with_validations() +> NumberWithValidations number_with_validations() @@ -407,7 +407,7 @@ Test serialization of outer number types import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import number_with_validations +from petstore_api.model.number_with_validations import NumberWithValidations from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -420,7 +420,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = number_with_validations.NumberWithValidations(3.4) # number_with_validations.NumberWithValidations | Input number as post body (optional) + body = NumberWithValidations(3.4) # NumberWithValidations | Input number as post body (optional) # example passing only required values which don't have defaults set # and optional values @@ -435,11 +435,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] + **body** | [**NumberWithValidations**](NumberWithValidations.md)| Input number as post body | [optional] ### Return type -[**number_with_validations.NumberWithValidations**](NumberWithValidations.md) +[**NumberWithValidations**](NumberWithValidations.md) ### Authorization @@ -458,7 +458,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **object_model_with_ref_props** -> object_model_with_ref_props.ObjectModelWithRefProps object_model_with_ref_props() +> ObjectModelWithRefProps object_model_with_ref_props() @@ -470,7 +470,7 @@ Test serialization of object with $refed properties import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import object_model_with_ref_props +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -483,7 +483,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = object_model_with_ref_props.ObjectModelWithRefProps() # object_model_with_ref_props.ObjectModelWithRefProps | Input model (optional) + body = ObjectModelWithRefProps() # ObjectModelWithRefProps | Input model (optional) # example passing only required values which don't have defaults set # and optional values @@ -498,11 +498,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] + **body** | [**ObjectModelWithRefProps**](ObjectModelWithRefProps.md)| Input model | [optional] ### Return type -[**object_model_with_ref_props.ObjectModelWithRefProps**](ObjectModelWithRefProps.md) +[**ObjectModelWithRefProps**](ObjectModelWithRefProps.md) ### Authorization @@ -583,7 +583,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **string_enum** -> string_enum.StringEnum string_enum() +> StringEnum string_enum() @@ -595,7 +595,7 @@ Test serialization of outer enum import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import string_enum +from petstore_api.model.string_enum import StringEnum from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -608,7 +608,7 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - body = string_enum.StringEnum("placed") # string_enum.StringEnum | Input enum (optional) + body = StringEnum("placed") # StringEnum | Input enum (optional) # example passing only required values which don't have defaults set # and optional values @@ -623,11 +623,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**string_enum.StringEnum**](StringEnum.md)| Input enum | [optional] + **body** | [**StringEnum**](StringEnum.md)| Input enum | [optional] ### Return type -[**string_enum.StringEnum**](StringEnum.md) +[**StringEnum**](StringEnum.md) ### Authorization @@ -646,7 +646,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_file_schema** -> test_body_with_file_schema(file_schema_test_class_file_schema_test_class) +> test_body_with_file_schema(file_schema_test_class) @@ -658,7 +658,7 @@ For this test, the body for this request much reference a schema named `File`. import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import file_schema_test_class +from petstore_api.model.file_schema_test_class import FileSchemaTestClass from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -671,11 +671,11 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - file_schema_test_class_file_schema_test_class = file_schema_test_class.FileSchemaTestClass() # file_schema_test_class.FileSchemaTestClass | + file_schema_test_class = FileSchemaTestClass() # FileSchemaTestClass | # example passing only required values which don't have defaults set try: - api_instance.test_body_with_file_schema(file_schema_test_class_file_schema_test_class) + api_instance.test_body_with_file_schema(file_schema_test_class) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_body_with_file_schema: %s\n" % e) ``` @@ -684,7 +684,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **file_schema_test_class_file_schema_test_class** | [**file_schema_test_class.FileSchemaTestClass**](FileSchemaTestClass.md)| | + **file_schema_test_class** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -707,7 +707,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_body_with_query_params** -> test_body_with_query_params(query, user_user) +> test_body_with_query_params(query, user) @@ -717,7 +717,7 @@ No authorization required import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -731,11 +731,11 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) query = 'query_example' # str | - user_user = user.User() # user.User | + user = User() # User | # example passing only required values which don't have defaults set try: - api_instance.test_body_with_query_params(query, user_user) + api_instance.test_body_with_query_params(query, user) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_body_with_query_params: %s\n" % e) ``` @@ -745,7 +745,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **str**| | - **user_user** | [**user.User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -768,7 +768,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_client_model** -> client.Client test_client_model(client_client) +> Client test_client_model(client) To test \"client\" model @@ -780,7 +780,7 @@ To test \"client\" model import time import petstore_api from petstore_api.api import fake_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -793,12 +793,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = fake_api.FakeApi(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test \"client\" model - api_response = api_instance.test_client_model(client_client) + api_response = api_instance.test_client_model(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeApi->test_client_model: %s\n" % e) @@ -808,11 +808,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 713737dfb51..fa046d30ddb 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -8,7 +8,7 @@ Method | HTTP request | Description # **test_classname** -> client.Client test_classname(client_client) +> Client test_classname(client) To test class name in snake case @@ -21,7 +21,7 @@ To test class name in snake case import time import petstore_api from petstore_api.api import fake_classname_tags_123_api -from petstore_api.model import client +from petstore_api.model.client import Client from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -48,12 +48,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = fake_classname_tags_123_api.FakeClassnameTags123Api(api_client) - client_client = client.Client() # client.Client | client model + client = Client() # Client | client model # example passing only required values which don't have defaults set try: # To test class name in snake case - api_response = api_instance.test_classname(client_client) + api_response = api_instance.test_classname(client) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling FakeClassnameTags123Api->test_classname: %s\n" % e) @@ -63,11 +63,11 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **client_client** | [**client.Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type -[**client.Client**](Client.md) +[**Client**](Client.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/File.md b/samples/openapi3/client/petstore/python-experimental/docs/File.md index 2847323a098..f17ba0057d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/File.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/File.md @@ -1,4 +1,4 @@ -# file.File +# File Must be named `File` for test. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md index 807350c62f2..d0a8bbaaba9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FileSchemaTestClass.md @@ -1,10 +1,10 @@ -# file_schema_test_class.FileSchemaTestClass +# FileSchemaTestClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**file** | [**file.File**](File.md) | | [optional] -**files** | [**[file.File]**](File.md) | | [optional] +**file** | [**File**](File.md) | | [optional] +**files** | [**[File]**](File.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md index 570d1dac093..5b281fa08de 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Foo.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Foo.md @@ -1,4 +1,4 @@ -# foo.Foo +# Foo ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md index cb7e31877a7..2ac0ffb36d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FormatTest.md @@ -1,4 +1,4 @@ -# format_test.FormatTest +# FormatTest ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md index 787699f2eb3..9a15349d34b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Fruit.md @@ -1,4 +1,4 @@ -# fruit.Fruit +# Fruit ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md index 22eeb37f1cc..b192b0caeb4 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FruitReq.md @@ -1,4 +1,4 @@ -# fruit_req.FruitReq +# FruitReq ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md index ea21af6ad1f..b5ec2fba3a0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/GmFruit.md @@ -1,4 +1,4 @@ -# gm_fruit.GmFruit +# GmFruit ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md index 8a6679f3895..2a9d89c76d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/GrandparentAnimal.md @@ -1,4 +1,4 @@ -# grandparent_animal.GrandparentAnimal +# GrandparentAnimal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md index f2194e269ed..f731a42eab5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/HasOnlyReadOnly.md @@ -1,4 +1,4 @@ -# has_only_read_only.HasOnlyReadOnly +# HasOnlyReadOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md index 280ddc2eaf3..50cf84f6913 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/HealthCheckResult.md @@ -1,4 +1,4 @@ -# health_check_result.HealthCheckResult +# HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md index 362cc36d1f0..f567ea188ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject.md @@ -1,4 +1,4 @@ -# inline_object.InlineObject +# InlineObject ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md index 3090ff26994..4349ad73e3b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject1.md @@ -1,4 +1,4 @@ -# inline_object1.InlineObject1 +# InlineObject1 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md index f8ea923f4e0..106488e8598 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject2.md @@ -1,4 +1,4 @@ -# inline_object2.InlineObject2 +# InlineObject2 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md index 69815c5e63c..34d5eb47845 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject3.md @@ -1,4 +1,4 @@ -# inline_object3.InlineObject3 +# InlineObject3 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md index 30ee0475e79..07574d0d076 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject4.md @@ -1,4 +1,4 @@ -# inline_object4.InlineObject4 +# InlineObject4 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md index 56d245f1683..8f8662c434d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineObject5.md @@ -1,4 +1,4 @@ -# inline_object5.InlineObject5 +# InlineObject5 ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md index 295326496d7..9c754420f24 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/InlineResponseDefault.md @@ -1,9 +1,9 @@ -# inline_response_default.InlineResponseDefault +# InlineResponseDefault ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string** | [**foo.Foo**](Foo.md) | | [optional] +**string** | [**Foo**](Foo.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md index cd3a799f2f5..9ef38c07047 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnum.md @@ -1,4 +1,4 @@ -# integer_enum.IntegerEnum +# IntegerEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md index e70e4b28e15..dda321694f5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumOneValue.md @@ -1,4 +1,4 @@ -# integer_enum_one_value.IntegerEnumOneValue +# IntegerEnumOneValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md index b921f8217e9..b2ae7cef0d3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IntegerEnumWithDefaultValue.md @@ -1,4 +1,4 @@ -# integer_enum_with_default_value.IntegerEnumWithDefaultValue +# IntegerEnumWithDefaultValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md index 335edad8c0f..e80ec0983a5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/IsoscelesTriangle.md @@ -1,4 +1,4 @@ -# isosceles_triangle.IsoscelesTriangle +# IsoscelesTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/List.md b/samples/openapi3/client/petstore/python-experimental/docs/List.md index 28e2ec05968..11f4f3a05f3 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/List.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/List.md @@ -1,4 +1,4 @@ -# list.List +# List ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md index 8aadf030d29..3ad5538e6e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Mammal.md @@ -1,4 +1,4 @@ -# mammal.Mammal +# Mammal ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md index 9fc13abebdc..ad561b7220b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/MapTest.md @@ -1,4 +1,4 @@ -# map_test.MapTest +# MapTest ## Properties Name | Type | Description | Notes @@ -6,7 +6,7 @@ Name | Type | Description | Notes **map_map_of_string** | **{str: ({str: (str,)},)}** | | [optional] **map_of_enum_string** | **{str: (str,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional] -**indirect_map** | [**string_boolean_map.StringBooleanMap**](StringBooleanMap.md) | | [optional] +**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md index 87cda996e76..1484c0638d8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -1,11 +1,11 @@ -# mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass +# MixedPropertiesAndAdditionalPropertiesClass ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **uuid** | **str** | | [optional] **date_time** | **datetime** | | [optional] -**map** | [**{str: (animal.Animal,)}**](Animal.md) | | [optional] +**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md index 90f5c2c025d..40d0d7828e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Model200Response.md @@ -1,4 +1,4 @@ -# model200_response.Model200Response +# Model200Response Model for testing model name starting with number ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md index 3be9912b753..65ec73ddae7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ModelReturn.md @@ -1,4 +1,4 @@ -# model_return.ModelReturn +# ModelReturn Model for testing reserved words ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Name.md b/samples/openapi3/client/petstore/python-experimental/docs/Name.md index 777b79a3d8b..807b76afc6e 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Name.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Name.md @@ -1,4 +1,4 @@ -# name.Name +# Name Model for testing model name same as property name ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md index 00037cf35fa..0789eb8ad1a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableClass.md @@ -1,4 +1,4 @@ -# nullable_class.NullableClass +# NullableClass ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md index 82b0d949406..3ebce34d8f8 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NullableShape.md @@ -1,4 +1,4 @@ -# nullable_shape.NullableShape +# NullableShape The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md index ea1a09d2934..93a0fde7b93 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberOnly.md @@ -1,4 +1,4 @@ -# number_only.NumberOnly +# NumberOnly ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md index b6eb738a2a8..402eb8325bc 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/NumberWithValidations.md @@ -1,4 +1,4 @@ -# number_with_validations.NumberWithValidations +# NumberWithValidations ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md index 6c308497b60..9a94ef8f61c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ObjectModelWithRefProps.md @@ -1,10 +1,10 @@ -# object_model_with_ref_props.ObjectModelWithRefProps +# ObjectModelWithRefProps a model that includes properties which should stay primitive (String + Boolean) and one which is defined as a class, NumberWithValidations ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**my_number** | [**number_with_validations.NumberWithValidations**](NumberWithValidations.md) | | [optional] +**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_string** | **str** | | [optional] **my_boolean** | **bool** | | [optional] diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Order.md b/samples/openapi3/client/petstore/python-experimental/docs/Order.md index 9569ea55e55..c21210a3bd5 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Order.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Order.md @@ -1,4 +1,4 @@ -# order.Order +# Order ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md index 78693cf8f0e..6e2571150d0 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ParentPet.md @@ -1,4 +1,4 @@ -# parent_pet.ParentPet +# ParentPet ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md index a1ea5598e86..ce09d401c89 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Pet.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pet.md @@ -1,4 +1,4 @@ -# pet.Pet +# Pet ## Properties Name | Type | Description | Notes @@ -6,8 +6,8 @@ Name | Type | Description | Notes **name** | **str** | | **photo_urls** | **[str]** | | **id** | **int** | | [optional] -**category** | [**category.Category**](Category.md) | | [optional] -**tags** | [**[tag.Tag]**](Tag.md) | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**[Tag]**](Tag.md) | | [optional] **status** | **str** | pet status in the store | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index a29af68a4c1..94c9629a8c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **add_pet** -> add_pet(pet_pet) +> add_pet(pet) Add a new pet to the store @@ -27,7 +27,7 @@ Add a new pet to the store import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -110,12 +110,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + pet = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: # Add a new pet to the store - api_instance.add_pet(pet_pet) + api_instance.add_pet(pet) except petstore_api.ApiException as e: print("Exception when calling PetApi->add_pet: %s\n" % e) ``` @@ -124,7 +124,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -227,7 +227,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **find_pets_by_status** -> [pet.Pet] find_pets_by_status(status) +> [Pet] find_pets_by_status(status) Finds Pets by status @@ -240,7 +240,7 @@ Multiple status values can be provided with comma separated strings import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -342,7 +342,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -362,7 +362,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **find_pets_by_tags** -> [pet.Pet] find_pets_by_tags(tags) +> [Pet] find_pets_by_tags(tags) Finds Pets by tags @@ -375,7 +375,7 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -477,7 +477,7 @@ Name | Type | Description | Notes ### Return type -[**[pet.Pet]**](Pet.md) +[**[Pet]**](Pet.md) ### Authorization @@ -497,7 +497,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_pet_by_id** -> pet.Pet get_pet_by_id(pet_id) +> Pet get_pet_by_id(pet_id) Find pet by ID @@ -510,7 +510,7 @@ Returns a single pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -556,7 +556,7 @@ Name | Type | Description | Notes ### Return type -[**pet.Pet**](Pet.md) +[**Pet**](Pet.md) ### Authorization @@ -577,7 +577,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_pet** -> update_pet(pet_pet) +> update_pet(pet) Update an existing pet @@ -588,7 +588,7 @@ Update an existing pet import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import pet +from petstore_api.model.pet import Pet from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -671,12 +671,12 @@ configuration.access_token = 'YOUR_ACCESS_TOKEN' with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = pet_api.PetApi(api_client) - pet_pet = pet.Pet() # pet.Pet | Pet object that needs to be added to the store + pet = Pet() # Pet | Pet object that needs to be added to the store # example passing only required values which don't have defaults set try: # Update an existing pet - api_instance.update_pet(pet_pet) + api_instance.update_pet(pet) except petstore_api.ApiException as e: print("Exception when calling PetApi->update_pet: %s\n" % e) ``` @@ -685,7 +685,7 @@ with petstore_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet_pet** | [**pet.Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -792,7 +792,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file** -> api_response.ApiResponse upload_file(pet_id) +> ApiResponse upload_file(pet_id) uploads an image @@ -803,7 +803,7 @@ uploads an image import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -858,7 +858,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization @@ -877,7 +877,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **upload_file_with_required_file** -> api_response.ApiResponse upload_file_with_required_file(pet_id, required_file) +> ApiResponse upload_file_with_required_file(pet_id, required_file) uploads an image (required) @@ -888,7 +888,7 @@ uploads an image (required) import time import petstore_api from petstore_api.api import pet_api -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -943,7 +943,7 @@ Name | Type | Description | Notes ### Return type -[**api_response.ApiResponse**](ApiResponse.md) +[**ApiResponse**](ApiResponse.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md index 0ca689c073e..bebdd38f901 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Pig.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Pig.md @@ -1,4 +1,4 @@ -# pig.Pig +# Pig ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md index 5d0a4a075fe..20e5742c134 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Quadrilateral.md @@ -1,4 +1,4 @@ -# quadrilateral.Quadrilateral +# Quadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md index d3600c6c5ba..25d74466517 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/QuadrilateralInterface.md @@ -1,4 +1,4 @@ -# quadrilateral_interface.QuadrilateralInterface +# QuadrilateralInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md index 252641787c3..6bc1447c1d7 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ReadOnlyFirst.md @@ -1,4 +1,4 @@ -# read_only_first.ReadOnlyFirst +# ReadOnlyFirst ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md index 6e4dc3c9af8..8b5b5ff8558 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ScaleneTriangle.md @@ -1,4 +1,4 @@ -# scalene_triangle.ScaleneTriangle +# ScaleneTriangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md index 793225bc517..90138dc6d36 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Shape.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Shape.md @@ -1,4 +1,4 @@ -# shape.Shape +# Shape ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md index adb207397a4..224a2faa1dd 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ShapeInterface.md @@ -1,4 +1,4 @@ -# shape_interface.ShapeInterface +# ShapeInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md index 0f52dcbd316..a82540d19ea 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/ShapeOrNull.md @@ -1,4 +1,4 @@ -# shape_or_null.ShapeOrNull +# ShapeOrNull The value may be a shape or the 'null' value. This is introduced in OAS schema >= 3.1. ## Properties diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md index 14789a06f91..ec38088e781 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/SimpleQuadrilateral.md @@ -1,4 +1,4 @@ -# simple_quadrilateral.SimpleQuadrilateral +# SimpleQuadrilateral ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md index 312539af45e..022ee19169c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/SpecialModelName.md @@ -1,4 +1,4 @@ -# special_model_name.SpecialModelName +# SpecialModelName ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index cb973190ab3..eb126eda51d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -146,7 +146,7 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_order_by_id** -> order.Order get_order_by_id(order_id) +> Order get_order_by_id(order_id) Find purchase order by ID @@ -158,7 +158,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +from petstore_api.model.order import Order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -190,7 +190,7 @@ Name | Type | Description | Notes ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization @@ -211,7 +211,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **place_order** -> order.Order place_order(order_order) +> Order place_order(order) Place an order for a pet @@ -221,7 +221,7 @@ Place an order for a pet import time import petstore_api from petstore_api.api import store_api -from petstore_api.model import order +from petstore_api.model.order import Order from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -234,12 +234,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = store_api.StoreApi(api_client) - order_order = order.Order() # order.Order | order placed for purchasing the pet + order = Order() # Order | order placed for purchasing the pet # example passing only required values which don't have defaults set try: # Place an order for a pet - api_response = api_instance.place_order(order_order) + api_response = api_instance.place_order(order) pprint(api_response) except petstore_api.ApiException as e: print("Exception when calling StoreApi->place_order: %s\n" % e) @@ -249,11 +249,11 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_order** | [**order.Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type -[**order.Order**](Order.md) +[**Order**](Order.md) ### Authorization diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md index 2eb94fd9a73..2fbf3b3767d 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringBooleanMap.md @@ -1,4 +1,4 @@ -# string_boolean_map.StringBooleanMap +# StringBooleanMap ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md index 7b720683b6e..fbedcd04bce 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnum.md @@ -1,4 +1,4 @@ -# string_enum.StringEnum +# StringEnum ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md index b0f8d1be268..62111d72dbe 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StringEnumWithDefaultValue.md @@ -1,4 +1,4 @@ -# string_enum_with_default_value.StringEnumWithDefaultValue +# StringEnumWithDefaultValue ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md index 66f75c28fe4..243cd98eda6 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Tag.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Tag.md @@ -1,4 +1,4 @@ -# tag.Tag +# Tag ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md index f066c080aad..7c96d050bfe 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Triangle.md @@ -1,4 +1,4 @@ -# triangle.Triangle +# Triangle ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md index 7a32b857214..901553d663a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/TriangleInterface.md @@ -1,4 +1,4 @@ -# triangle_interface.TriangleInterface +# TriangleInterface ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/User.md b/samples/openapi3/client/petstore/python-experimental/docs/User.md index 1b1ec5fb6cc..5fc54dce871 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/User.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/User.md @@ -1,4 +1,4 @@ -# user.User +# User ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 435713374e5..d7f0c3f8fa9 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description # **create_user** -> create_user(user_user) +> create_user(user) Create user @@ -27,7 +27,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -40,12 +40,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = user.User() # user.User | Created user object + user = User() # User | Created user object # example passing only required values which don't have defaults set try: # Create user - api_instance.create_user(user_user) + api_instance.create_user(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_user: %s\n" % e) ``` @@ -54,7 +54,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**user.User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -77,7 +77,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_array_input** -> create_users_with_array_input(user_user) +> create_users_with_array_input(user) Creates list of users with given input array @@ -87,7 +87,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -100,12 +100,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = [user.User()] # [user.User] | List of user object + user = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: # Creates list of users with given input array - api_instance.create_users_with_array_input(user_user) + api_instance.create_users_with_array_input(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_users_with_array_input: %s\n" % e) ``` @@ -114,7 +114,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**[user.User]**](User.md)| List of user object | + **user** | [**[User]**](User.md)| List of user object | ### Return type @@ -137,7 +137,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_users_with_list_input** -> create_users_with_list_input(user_user) +> create_users_with_list_input(user) Creates list of users with given input array @@ -147,7 +147,7 @@ Creates list of users with given input array import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -160,12 +160,12 @@ configuration = petstore_api.Configuration( with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) - user_user = [user.User()] # [user.User] | List of user object + user = [User()] # [User] | List of user object # example passing only required values which don't have defaults set try: # Creates list of users with given input array - api_instance.create_users_with_list_input(user_user) + api_instance.create_users_with_list_input(user) except petstore_api.ApiException as e: print("Exception when calling UserApi->create_users_with_list_input: %s\n" % e) ``` @@ -174,7 +174,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user_user** | [**[user.User]**](User.md)| List of user object | + **user** | [**[User]**](User.md)| List of user object | ### Return type @@ -259,7 +259,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_user_by_name** -> user.User get_user_by_name(username) +> User get_user_by_name(username) Get user by user name @@ -269,7 +269,7 @@ Get user by user name import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -301,7 +301,7 @@ Name | Type | Description | Notes ### Return type -[**user.User**](User.md) +[**User**](User.md) ### Authorization @@ -440,7 +440,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_user** -> update_user(username, user_user) +> update_user(username, user) Updated user @@ -452,7 +452,7 @@ This can only be done by the logged in user. import time import petstore_api from petstore_api.api import user_api -from petstore_api.model import user +from petstore_api.model.user import User from pprint import pprint # Defining the host is optional and defaults to http://petstore.swagger.io:80/v2 # See configuration.py for a list of all supported configuration parameters. @@ -466,12 +466,12 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = user_api.UserApi(api_client) username = 'username_example' # str | name that need to be deleted - user_user = user.User() # user.User | Updated user object + user = User() # User | Updated user object # example passing only required values which don't have defaults set try: # Updated user - api_instance.update_user(username, user_user) + api_instance.update_user(username, user) except petstore_api.ApiException as e: print("Exception when calling UserApi->update_user: %s\n" % e) ``` @@ -481,7 +481,7 @@ with petstore_api.ApiClient() as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **str**| name that need to be deleted | - **user_user** | [**user.User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md index 4a19e88c555..693dacb158b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Whale.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Whale.md @@ -1,4 +1,4 @@ -# whale.Whale +# Whale ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md index 05a4dbfd6ba..7681f694685 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/Zebra.md @@ -1,4 +1,4 @@ -# zebra.Zebra +# Zebra ## Properties Name | Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py index 40ca75cb253..af80014fe0c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/another_fake_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class AnotherFakeApi(object): @@ -40,7 +40,7 @@ class AnotherFakeApi(object): def __call_123_test_special_tags( self, - client_client, + client, **kwargs ): """To test special tags # noqa: E501 @@ -49,11 +49,11 @@ class AnotherFakeApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.call_123_test_special_tags(client_client, async_req=True) + >>> thread = api.call_123_test_special_tags(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ class AnotherFakeApi(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -100,13 +100,13 @@ class AnotherFakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.call_123_test_special_tags = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/another-fake/dummy', 'operation_id': 'call_123_test_special_tags', @@ -115,10 +115,10 @@ class AnotherFakeApi(object): }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -133,13 +133,13 @@ class AnotherFakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py index c6bf00fdc40..c64ea731eba 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/default_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import inline_response_default +from petstore_api.model.inline_response_default import InlineResponseDefault class DefaultApi(object): @@ -73,7 +73,7 @@ class DefaultApi(object): async_req (bool): execute request asynchronously Returns: - inline_response_default.InlineResponseDefault + InlineResponseDefault If the method is called asynchronously, returns the request thread. """ @@ -100,7 +100,7 @@ class DefaultApi(object): self.foo_get = Endpoint( settings={ - 'response_type': (inline_response_default.InlineResponseDefault,), + 'response_type': (InlineResponseDefault,), 'auth': [], 'endpoint_path': '/foo', 'operation_id': 'foo_get', diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py index b294bfc8e79..40f7ef9a826 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_api.py @@ -23,17 +23,17 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import additional_properties_with_array_of_enums -from petstore_api.model import animal_farm -from petstore_api.model import array_of_enums -from petstore_api.model import composed_one_of_number_with_validations -from petstore_api.model import health_check_result -from petstore_api.model import number_with_validations -from petstore_api.model import object_model_with_ref_props -from petstore_api.model import string_enum -from petstore_api.model import file_schema_test_class -from petstore_api.model import user -from petstore_api.model import client +from petstore_api.model.additional_properties_with_array_of_enums import AdditionalPropertiesWithArrayOfEnums +from petstore_api.model.animal_farm import AnimalFarm +from petstore_api.model.array_of_enums import ArrayOfEnums +from petstore_api.model.client import Client +from petstore_api.model.composed_one_of_number_with_validations import ComposedOneOfNumberWithValidations +from petstore_api.model.file_schema_test_class import FileSchemaTestClass +from petstore_api.model.health_check_result import HealthCheckResult +from petstore_api.model.number_with_validations import NumberWithValidations +from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps +from petstore_api.model.string_enum import StringEnum +from petstore_api.model.user import User class FakeApi(object): @@ -62,7 +62,7 @@ class FakeApi(object): Keyword Args: - additional_properties_with_array_of_enums_additional_properties_with_array_of_enums (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] + additional_properties_with_array_of_enums (AdditionalPropertiesWithArrayOfEnums): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -84,7 +84,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums + AdditionalPropertiesWithArrayOfEnums If the method is called asynchronously, returns the request thread. """ @@ -111,7 +111,7 @@ class FakeApi(object): self.additional_properties_with_array_of_enums = Endpoint( settings={ - 'response_type': (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), + 'response_type': (AdditionalPropertiesWithArrayOfEnums,), 'auth': [], 'endpoint_path': '/fake/additional-properties-with-array-of-enums', 'operation_id': 'additional_properties_with_array_of_enums', @@ -120,7 +120,7 @@ class FakeApi(object): }, params_map={ 'all': [ - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums', + 'additional_properties_with_array_of_enums', ], 'required': [], 'nullable': [ @@ -136,13 +136,13 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': - (additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums,), + 'additional_properties_with_array_of_enums': + (AdditionalPropertiesWithArrayOfEnums,), }, 'attribute_map': { }, 'location_map': { - 'additional_properties_with_array_of_enums_additional_properties_with_array_of_enums': 'body', + 'additional_properties_with_array_of_enums': 'body', }, 'collection_format_map': { } @@ -174,7 +174,7 @@ class FakeApi(object): Keyword Args: - body (animal_farm.AnimalFarm): Input model. [optional] + body (AnimalFarm): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -196,7 +196,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - animal_farm.AnimalFarm + AnimalFarm If the method is called asynchronously, returns the request thread. """ @@ -223,7 +223,7 @@ class FakeApi(object): self.array_model = Endpoint( settings={ - 'response_type': (animal_farm.AnimalFarm,), + 'response_type': (AnimalFarm,), 'auth': [], 'endpoint_path': '/fake/refs/arraymodel', 'operation_id': 'array_model', @@ -249,7 +249,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (animal_farm.AnimalFarm,), + (AnimalFarm,), }, 'attribute_map': { }, @@ -285,7 +285,7 @@ class FakeApi(object): Keyword Args: - array_of_enums_array_of_enums (array_of_enums.ArrayOfEnums): Input enum. [optional] + array_of_enums (ArrayOfEnums): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -307,7 +307,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - array_of_enums.ArrayOfEnums + ArrayOfEnums If the method is called asynchronously, returns the request thread. """ @@ -334,7 +334,7 @@ class FakeApi(object): self.array_of_enums = Endpoint( settings={ - 'response_type': (array_of_enums.ArrayOfEnums,), + 'response_type': (ArrayOfEnums,), 'auth': [], 'endpoint_path': '/fake/refs/array-of-enums', 'operation_id': 'array_of_enums', @@ -343,7 +343,7 @@ class FakeApi(object): }, params_map={ 'all': [ - 'array_of_enums_array_of_enums', + 'array_of_enums', ], 'required': [], 'nullable': [ @@ -359,13 +359,13 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'array_of_enums_array_of_enums': - (array_of_enums.ArrayOfEnums,), + 'array_of_enums': + (ArrayOfEnums,), }, 'attribute_map': { }, 'location_map': { - 'array_of_enums_array_of_enums': 'body', + 'array_of_enums': 'body', }, 'collection_format_map': { } @@ -509,7 +509,7 @@ class FakeApi(object): Keyword Args: - composed_one_of_number_with_validations_composed_one_of_number_with_validations (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations): Input model. [optional] + composed_one_of_number_with_validations (ComposedOneOfNumberWithValidations): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -531,7 +531,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations + ComposedOneOfNumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -558,7 +558,7 @@ class FakeApi(object): self.composed_one_of_number_with_validations = Endpoint( settings={ - 'response_type': (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + 'response_type': (ComposedOneOfNumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/composed_one_of_number_with_validations', 'operation_id': 'composed_one_of_number_with_validations', @@ -567,7 +567,7 @@ class FakeApi(object): }, params_map={ 'all': [ - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations', + 'composed_one_of_number_with_validations', ], 'required': [], 'nullable': [ @@ -583,13 +583,13 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': - (composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,), + 'composed_one_of_number_with_validations': + (ComposedOneOfNumberWithValidations,), }, 'attribute_map': { }, 'location_map': { - 'composed_one_of_number_with_validations_composed_one_of_number_with_validations': 'body', + 'composed_one_of_number_with_validations': 'body', }, 'collection_format_map': { } @@ -641,7 +641,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - health_check_result.HealthCheckResult + HealthCheckResult If the method is called asynchronously, returns the request thread. """ @@ -668,7 +668,7 @@ class FakeApi(object): self.fake_health_get = Endpoint( settings={ - 'response_type': (health_check_result.HealthCheckResult,), + 'response_type': (HealthCheckResult,), 'auth': [], 'endpoint_path': '/fake/health', 'operation_id': 'fake_health_get', @@ -725,7 +725,7 @@ class FakeApi(object): Keyword Args: - body (number_with_validations.NumberWithValidations): Input number as post body. [optional] + body (NumberWithValidations): Input number as post body. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -747,7 +747,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - number_with_validations.NumberWithValidations + NumberWithValidations If the method is called asynchronously, returns the request thread. """ @@ -774,7 +774,7 @@ class FakeApi(object): self.number_with_validations = Endpoint( settings={ - 'response_type': (number_with_validations.NumberWithValidations,), + 'response_type': (NumberWithValidations,), 'auth': [], 'endpoint_path': '/fake/refs/number', 'operation_id': 'number_with_validations', @@ -800,7 +800,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (number_with_validations.NumberWithValidations,), + (NumberWithValidations,), }, 'attribute_map': { }, @@ -837,7 +837,7 @@ class FakeApi(object): Keyword Args: - body (object_model_with_ref_props.ObjectModelWithRefProps): Input model. [optional] + body (ObjectModelWithRefProps): Input model. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -859,7 +859,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - object_model_with_ref_props.ObjectModelWithRefProps + ObjectModelWithRefProps If the method is called asynchronously, returns the request thread. """ @@ -886,7 +886,7 @@ class FakeApi(object): self.object_model_with_ref_props = Endpoint( settings={ - 'response_type': (object_model_with_ref_props.ObjectModelWithRefProps,), + 'response_type': (ObjectModelWithRefProps,), 'auth': [], 'endpoint_path': '/fake/refs/object_model_with_ref_props', 'operation_id': 'object_model_with_ref_props', @@ -912,7 +912,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (object_model_with_ref_props.ObjectModelWithRefProps,), + (ObjectModelWithRefProps,), }, 'attribute_map': { }, @@ -1061,7 +1061,7 @@ class FakeApi(object): Keyword Args: - body (string_enum.StringEnum): Input enum. [optional] + body (StringEnum): Input enum. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object @@ -1083,7 +1083,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - string_enum.StringEnum + StringEnum If the method is called asynchronously, returns the request thread. """ @@ -1110,7 +1110,7 @@ class FakeApi(object): self.string_enum = Endpoint( settings={ - 'response_type': (string_enum.StringEnum,), + 'response_type': (StringEnum,), 'auth': [], 'endpoint_path': '/fake/refs/enum', 'operation_id': 'string_enum', @@ -1137,7 +1137,7 @@ class FakeApi(object): }, 'openapi_types': { 'body': - (string_enum.StringEnum,), + (StringEnum,), }, 'attribute_map': { }, @@ -1161,7 +1161,7 @@ class FakeApi(object): def __test_body_with_file_schema( self, - file_schema_test_class_file_schema_test_class, + file_schema_test_class, **kwargs ): """test_body_with_file_schema # noqa: E501 @@ -1170,11 +1170,11 @@ class FakeApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_file_schema(file_schema_test_class_file_schema_test_class, async_req=True) + >>> thread = api.test_body_with_file_schema(file_schema_test_class, async_req=True) >>> result = thread.get() Args: - file_schema_test_class_file_schema_test_class (file_schema_test_class.FileSchemaTestClass): + file_schema_test_class (FileSchemaTestClass): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1221,8 +1221,8 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['file_schema_test_class_file_schema_test_class'] = \ - file_schema_test_class_file_schema_test_class + kwargs['file_schema_test_class'] = \ + file_schema_test_class return self.call_with_http_info(**kwargs) self.test_body_with_file_schema = Endpoint( @@ -1236,10 +1236,10 @@ class FakeApi(object): }, params_map={ 'all': [ - 'file_schema_test_class_file_schema_test_class', + 'file_schema_test_class', ], 'required': [ - 'file_schema_test_class_file_schema_test_class', + 'file_schema_test_class', ], 'nullable': [ ], @@ -1254,13 +1254,13 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'file_schema_test_class_file_schema_test_class': - (file_schema_test_class.FileSchemaTestClass,), + 'file_schema_test_class': + (FileSchemaTestClass,), }, 'attribute_map': { }, 'location_map': { - 'file_schema_test_class_file_schema_test_class': 'body', + 'file_schema_test_class': 'body', }, 'collection_format_map': { } @@ -1278,7 +1278,7 @@ class FakeApi(object): def __test_body_with_query_params( self, query, - user_user, + user, **kwargs ): """test_body_with_query_params # noqa: E501 @@ -1286,12 +1286,12 @@ class FakeApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_body_with_query_params(query, user_user, async_req=True) + >>> thread = api.test_body_with_query_params(query, user, async_req=True) >>> result = thread.get() Args: query (str): - user_user (user.User): + user (User): Keyword Args: _return_http_data_only (bool): response data without head status @@ -1340,8 +1340,8 @@ class FakeApi(object): kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.test_body_with_query_params = Endpoint( @@ -1356,11 +1356,11 @@ class FakeApi(object): params_map={ 'all': [ 'query', - 'user_user', + 'user', ], 'required': [ 'query', - 'user_user', + 'user', ], 'nullable': [ ], @@ -1377,15 +1377,15 @@ class FakeApi(object): 'openapi_types': { 'query': (str,), - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { 'query': 'query', }, 'location_map': { 'query': 'query', - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -1402,7 +1402,7 @@ class FakeApi(object): def __test_client_model( self, - client_client, + client, **kwargs ): """To test \"client\" model # noqa: E501 @@ -1411,11 +1411,11 @@ class FakeApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_client_model(client_client, async_req=True) + >>> thread = api.test_client_model(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -1439,7 +1439,7 @@ class FakeApi(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -1462,13 +1462,13 @@ class FakeApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.test_client_model = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [], 'endpoint_path': '/fake', 'operation_id': 'test_client_model', @@ -1477,10 +1477,10 @@ class FakeApi(object): }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -1495,13 +1495,13 @@ class FakeApi(object): 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py index 067e5a91f50..40f8039b3cb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/fake_classname_tags_123_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import client +from petstore_api.model.client import Client class FakeClassnameTags123Api(object): @@ -40,7 +40,7 @@ class FakeClassnameTags123Api(object): def __test_classname( self, - client_client, + client, **kwargs ): """To test class name in snake case # noqa: E501 @@ -49,11 +49,11 @@ class FakeClassnameTags123Api(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_classname(client_client, async_req=True) + >>> thread = api.test_classname(client, async_req=True) >>> result = thread.get() Args: - client_client (client.Client): client model + client (Client): client model Keyword Args: _return_http_data_only (bool): response data without head status @@ -77,7 +77,7 @@ class FakeClassnameTags123Api(object): async_req (bool): execute request asynchronously Returns: - client.Client + Client If the method is called asynchronously, returns the request thread. """ @@ -100,13 +100,13 @@ class FakeClassnameTags123Api(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['client_client'] = \ - client_client + kwargs['client'] = \ + client return self.call_with_http_info(**kwargs) self.test_classname = Endpoint( settings={ - 'response_type': (client.Client,), + 'response_type': (Client,), 'auth': [ 'api_key_query' ], @@ -117,10 +117,10 @@ class FakeClassnameTags123Api(object): }, params_map={ 'all': [ - 'client_client', + 'client', ], 'required': [ - 'client_client', + 'client', ], 'nullable': [ ], @@ -135,13 +135,13 @@ class FakeClassnameTags123Api(object): 'allowed_values': { }, 'openapi_types': { - 'client_client': - (client.Client,), + 'client': + (Client,), }, 'attribute_map': { }, 'location_map': { - 'client_client': 'body', + 'client': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py index 0a018863df4..3a20006d392 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/pet_api.py @@ -23,8 +23,8 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import pet -from petstore_api.model import api_response +from petstore_api.model.api_response import ApiResponse +from petstore_api.model.pet import Pet class PetApi(object): @@ -41,7 +41,7 @@ class PetApi(object): def __add_pet( self, - pet_pet, + pet, **kwargs ): """Add a new pet to the store # noqa: E501 @@ -49,11 +49,11 @@ class PetApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_pet(pet_pet, async_req=True) + >>> thread = api.add_pet(pet, async_req=True) >>> result = thread.get() Args: - pet_pet (pet.Pet): Pet object that needs to be added to the store + pet (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -100,8 +100,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_pet'] = \ - pet_pet + kwargs['pet'] = \ + pet return self.call_with_http_info(**kwargs) self.add_pet = Endpoint( @@ -127,10 +127,10 @@ class PetApi(object): }, params_map={ 'all': [ - 'pet_pet', + 'pet', ], 'required': [ - 'pet_pet', + 'pet', ], 'nullable': [ ], @@ -145,13 +145,13 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_pet': - (pet.Pet,), + 'pet': + (Pet,), }, 'attribute_map': { }, 'location_map': { - 'pet_pet': 'body', + 'pet': 'body', }, 'collection_format_map': { } @@ -328,7 +328,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -357,7 +357,7 @@ class PetApi(object): self.find_pets_by_status = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'http_signature_test', 'petstore_auth' @@ -457,7 +457,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - [pet.Pet] + [Pet] If the method is called asynchronously, returns the request thread. """ @@ -486,7 +486,7 @@ class PetApi(object): self.find_pets_by_tags = Endpoint( settings={ - 'response_type': ([pet.Pet],), + 'response_type': ([Pet],), 'auth': [ 'http_signature_test', 'petstore_auth' @@ -579,7 +579,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - pet.Pet + Pet If the method is called asynchronously, returns the request thread. """ @@ -608,7 +608,7 @@ class PetApi(object): self.get_pet_by_id = Endpoint( settings={ - 'response_type': (pet.Pet,), + 'response_type': (Pet,), 'auth': [ 'api_key' ], @@ -662,7 +662,7 @@ class PetApi(object): def __update_pet( self, - pet_pet, + pet, **kwargs ): """Update an existing pet # noqa: E501 @@ -670,11 +670,11 @@ class PetApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_pet(pet_pet, async_req=True) + >>> thread = api.update_pet(pet, async_req=True) >>> result = thread.get() Args: - pet_pet (pet.Pet): Pet object that needs to be added to the store + pet (Pet): Pet object that needs to be added to the store Keyword Args: _return_http_data_only (bool): response data without head status @@ -721,8 +721,8 @@ class PetApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['pet_pet'] = \ - pet_pet + kwargs['pet'] = \ + pet return self.call_with_http_info(**kwargs) self.update_pet = Endpoint( @@ -748,10 +748,10 @@ class PetApi(object): }, params_map={ 'all': [ - 'pet_pet', + 'pet', ], 'required': [ - 'pet_pet', + 'pet', ], 'nullable': [ ], @@ -766,13 +766,13 @@ class PetApi(object): 'allowed_values': { }, 'openapi_types': { - 'pet_pet': - (pet.Pet,), + 'pet': + (Pet,), }, 'attribute_map': { }, 'location_map': { - 'pet_pet': 'body', + 'pet': 'body', }, 'collection_format_map': { } @@ -958,7 +958,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -987,7 +987,7 @@ class PetApi(object): self.upload_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], @@ -1091,7 +1091,7 @@ class PetApi(object): async_req (bool): execute request asynchronously Returns: - api_response.ApiResponse + ApiResponse If the method is called asynchronously, returns the request thread. """ @@ -1122,7 +1122,7 @@ class PetApi(object): self.upload_file_with_required_file = Endpoint( settings={ - 'response_type': (api_response.ApiResponse,), + 'response_type': (ApiResponse,), 'auth': [ 'petstore_auth' ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py index 9c608eb3137..5aa2d27623a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/store_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import order +from petstore_api.model.order import Order class StoreApi(object): @@ -299,7 +299,7 @@ class StoreApi(object): async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -328,7 +328,7 @@ class StoreApi(object): self.get_order_by_id = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order/{order_id}', 'operation_id': 'get_order_by_id', @@ -386,7 +386,7 @@ class StoreApi(object): def __place_order( self, - order_order, + order, **kwargs ): """Place an order for a pet # noqa: E501 @@ -394,11 +394,11 @@ class StoreApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.place_order(order_order, async_req=True) + >>> thread = api.place_order(order, async_req=True) >>> result = thread.get() Args: - order_order (order.Order): order placed for purchasing the pet + order (Order): order placed for purchasing the pet Keyword Args: _return_http_data_only (bool): response data without head status @@ -422,7 +422,7 @@ class StoreApi(object): async_req (bool): execute request asynchronously Returns: - order.Order + Order If the method is called asynchronously, returns the request thread. """ @@ -445,13 +445,13 @@ class StoreApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['order_order'] = \ - order_order + kwargs['order'] = \ + order return self.call_with_http_info(**kwargs) self.place_order = Endpoint( settings={ - 'response_type': (order.Order,), + 'response_type': (Order,), 'auth': [], 'endpoint_path': '/store/order', 'operation_id': 'place_order', @@ -460,10 +460,10 @@ class StoreApi(object): }, params_map={ 'all': [ - 'order_order', + 'order', ], 'required': [ - 'order_order', + 'order', ], 'nullable': [ ], @@ -478,13 +478,13 @@ class StoreApi(object): 'allowed_values': { }, 'openapi_types': { - 'order_order': - (order.Order,), + 'order': + (Order,), }, 'attribute_map': { }, 'location_map': { - 'order_order': 'body', + 'order': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py index 5e3276985d0..ee0468ec928 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/api/user_api.py @@ -23,7 +23,7 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_and_convert_types ) -from petstore_api.model import user +from petstore_api.model.user import User class UserApi(object): @@ -40,7 +40,7 @@ class UserApi(object): def __create_user( self, - user_user, + user, **kwargs ): """Create user # noqa: E501 @@ -49,11 +49,11 @@ class UserApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user(user_user, async_req=True) + >>> thread = api.create_user(user, async_req=True) >>> result = thread.get() Args: - user_user (user.User): Created user object + user (User): Created user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -100,8 +100,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_user = Endpoint( @@ -115,10 +115,10 @@ class UserApi(object): }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -133,13 +133,13 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -156,7 +156,7 @@ class UserApi(object): def __create_users_with_array_input( self, - user_user, + user, **kwargs ): """Creates list of users with given input array # noqa: E501 @@ -164,11 +164,11 @@ class UserApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_array_input(user_user, async_req=True) + >>> thread = api.create_users_with_array_input(user, async_req=True) >>> result = thread.get() Args: - user_user ([user.User]): List of user object + user ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -215,8 +215,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_users_with_array_input = Endpoint( @@ -230,10 +230,10 @@ class UserApi(object): }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -248,13 +248,13 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'user_user': - ([user.User],), + 'user': + ([User],), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -271,7 +271,7 @@ class UserApi(object): def __create_users_with_list_input( self, - user_user, + user, **kwargs ): """Creates list of users with given input array # noqa: E501 @@ -279,11 +279,11 @@ class UserApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_users_with_list_input(user_user, async_req=True) + >>> thread = api.create_users_with_list_input(user, async_req=True) >>> result = thread.get() Args: - user_user ([user.User]): List of user object + user ([User]): List of user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -330,8 +330,8 @@ class UserApi(object): '_check_return_type', True ) kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.create_users_with_list_input = Endpoint( @@ -345,10 +345,10 @@ class UserApi(object): }, params_map={ 'all': [ - 'user_user', + 'user', ], 'required': [ - 'user_user', + 'user', ], 'nullable': [ ], @@ -363,13 +363,13 @@ class UserApi(object): 'allowed_values': { }, 'openapi_types': { - 'user_user': - ([user.User],), + 'user': + ([User],), }, 'attribute_map': { }, 'location_map': { - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } @@ -537,7 +537,7 @@ class UserApi(object): async_req (bool): execute request asynchronously Returns: - user.User + User If the method is called asynchronously, returns the request thread. """ @@ -566,7 +566,7 @@ class UserApi(object): self.get_user_by_name = Endpoint( settings={ - 'response_type': (user.User,), + 'response_type': (User,), 'auth': [], 'endpoint_path': '/user/{username}', 'operation_id': 'get_user_by_name', @@ -848,7 +848,7 @@ class UserApi(object): def __update_user( self, username, - user_user, + user, **kwargs ): """Updated user # noqa: E501 @@ -857,12 +857,12 @@ class UserApi(object): This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user(username, user_user, async_req=True) + >>> thread = api.update_user(username, user, async_req=True) >>> result = thread.get() Args: username (str): name that need to be deleted - user_user (user.User): Updated user object + user (User): Updated user object Keyword Args: _return_http_data_only (bool): response data without head status @@ -911,8 +911,8 @@ class UserApi(object): kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username - kwargs['user_user'] = \ - user_user + kwargs['user'] = \ + user return self.call_with_http_info(**kwargs) self.update_user = Endpoint( @@ -927,11 +927,11 @@ class UserApi(object): params_map={ 'all': [ 'username', - 'user_user', + 'user', ], 'required': [ 'username', - 'user_user', + 'user', ], 'nullable': [ ], @@ -948,15 +948,15 @@ class UserApi(object): 'openapi_types': { 'username': (str,), - 'user_user': - (user.User,), + 'user': + (User,), }, 'attribute_map': { 'username': 'username', }, 'location_map': { 'username': 'path', - 'user_user': 'body', + 'user': 'body', }, 'collection_format_map': { } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py index bc7591c4eb5..7c3910ca119 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_class.py @@ -68,8 +68,8 @@ class AdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -90,6 +90,7 @@ class AdditionalPropertiesClass(ModelNormal): def discriminator(): return None + attribute_map = { 'map_property': 'map_property', # noqa: E501 'map_of_map_property': 'map_of_map_property', # noqa: E501 @@ -114,7 +115,7 @@ class AdditionalPropertiesClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_class.AdditionalPropertiesClass - a model defined in OpenAPI + """AdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py index 006e258d72d..b48dee9bd04 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/additional_properties_with_array_of_enums.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import enum_class -except ImportError: - enum_class = sys.modules[ - 'petstore_api.model.enum_class'] + +def lazy_import(): + from petstore_api.model.enum_class import EnumClass + globals()['EnumClass'] = EnumClass class AdditionalPropertiesWithArrayOfEnums(ModelNormal): @@ -66,20 +65,28 @@ class AdditionalPropertiesWithArrayOfEnums(ModelNormal): validations = { } - additional_properties_type = ([enum_class.EnumClass],) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return ([EnumClass],) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { } @@ -87,6 +94,7 @@ class AdditionalPropertiesWithArrayOfEnums(ModelNormal): def discriminator(): return None + attribute_map = { } @@ -103,7 +111,7 @@ class AdditionalPropertiesWithArrayOfEnums(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI + """AdditionalPropertiesWithArrayOfEnums - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py index 7c16f2ba3b5..b8d829ccae3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/address.py @@ -61,15 +61,21 @@ class Address(ModelNormal): validations = { } - additional_properties_type = (int,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (int,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ class Address(ModelNormal): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ class Address(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """address.Address - a model defined in OpenAPI + """Address - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py index 7f1257e2ab4..39aaa93227c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import cat -except ImportError: - cat = sys.modules[ - 'petstore_api.model.cat'] -try: - from petstore_api.model import dog -except ImportError: - dog = sys.modules[ - 'petstore_api.model.dog'] + +def lazy_import(): + from petstore_api.model.cat import Cat + from petstore_api.model.dog import Dog + globals()['Cat'] = Cat + globals()['Dog'] = Dog class Animal(ModelNormal): @@ -78,13 +74,14 @@ class Animal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -92,9 +89,10 @@ class Animal(ModelNormal): @cached_property def discriminator(): + lazy_import() val = { - 'Cat': cat.Cat, - 'Dog': dog.Dog, + 'Cat': Cat, + 'Dog': Dog, } if not val: return None @@ -118,7 +116,7 @@ class Animal(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """animal.Animal - a model defined in OpenAPI + """Animal - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py index 94d6d094d68..dc35f9394e1 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/animal_farm.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class AnimalFarm(ModelSimple): @@ -69,21 +68,23 @@ class AnimalFarm(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([animal.Animal],), + 'value': ([Animal],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ class AnimalFarm(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """animal_farm.AnimalFarm - a model defined in OpenAPI + """AnimalFarm - a model defined in OpenAPI Args: - value ([animal.Animal]): # noqa: E501 + value ([Animal]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py index 24a2e3d897a..bce1291d1f6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/api_response.py @@ -68,8 +68,8 @@ class ApiResponse(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ class ApiResponse(ModelNormal): def discriminator(): return None + attribute_map = { 'code': 'code', # noqa: E501 'type': 'type', # noqa: E501 @@ -104,7 +105,7 @@ class ApiResponse(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """api_response.ApiResponse - a model defined in OpenAPI + """ApiResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py index a87374c4407..dffec26c89f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple.py @@ -79,8 +79,8 @@ class Apple(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -95,6 +95,7 @@ class Apple(ModelNormal): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'origin': 'origin', # noqa: E501 @@ -113,7 +114,7 @@ class Apple(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """apple.Apple - a model defined in OpenAPI + """Apple - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py index 16ef4bcac8a..99beef5e914 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/apple_req.py @@ -68,8 +68,8 @@ class AppleReq(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class AppleReq(ModelNormal): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'mealy': 'mealy', # noqa: E501 @@ -102,7 +103,7 @@ class AppleReq(ModelNormal): @convert_js_args_to_python_args def __init__(self, cultivar, *args, **kwargs): # noqa: E501 - """apple_req.AppleReq - a model defined in OpenAPI + """AppleReq - a model defined in OpenAPI Args: cultivar (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py index 014740ca0a6..7c7c2743398 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'array_array_number': 'ArrayArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class ArrayOfArrayOfNumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_array_of_number_only.ArrayOfArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py index dbde502ccd9..7de4cae7f1e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_enums.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] + +def lazy_import(): + from petstore_api.model.string_enum import StringEnum + globals()['StringEnum'] = StringEnum class ArrayOfEnums(ModelSimple): @@ -69,21 +68,23 @@ class ArrayOfEnums(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'value': ([string_enum.StringEnum, none_type],), + 'value': ([StringEnum],), } @cached_property def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,10 +100,10 @@ class ArrayOfEnums(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """array_of_enums.ArrayOfEnums - a model defined in OpenAPI + """ArrayOfEnums - a model defined in OpenAPI Args: - value ([string_enum.StringEnum, none_type]): # noqa: E501 + value ([StringEnum]): # noqa: E501 Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py index 00afce1fb4a..4947154bb6e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_of_number_only.py @@ -68,8 +68,8 @@ class ArrayOfNumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ArrayOfNumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'array_number': 'ArrayNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class ArrayOfNumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_of_number_only.ArrayOfNumberOnly - a model defined in OpenAPI + """ArrayOfNumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py index e4478c5acdc..7b4d47ace89 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/array_test.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import read_only_first -except ImportError: - read_only_first = sys.modules[ - 'petstore_api.model.read_only_first'] + +def lazy_import(): + from petstore_api.model.read_only_first import ReadOnlyFirst + globals()['ReadOnlyFirst'] = ReadOnlyFirst class ArrayTest(ModelNormal): @@ -73,23 +72,25 @@ class ArrayTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'array_of_string': ([str],), # noqa: E501 'array_array_of_integer': ([[int]],), # noqa: E501 - 'array_array_of_model': ([[read_only_first.ReadOnlyFirst]],), # noqa: E501 + 'array_array_of_model': ([[ReadOnlyFirst]],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'array_of_string': 'array_of_string', # noqa: E501 'array_array_of_integer': 'array_array_of_integer', # noqa: E501 @@ -109,7 +110,7 @@ class ArrayTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """array_test.ArrayTest - a model defined in OpenAPI + """ArrayTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ class ArrayTest(ModelNormal): _visited_composed_classes = (Animal,) array_of_string ([str]): [optional] # noqa: E501 array_array_of_integer ([[int]]): [optional] # noqa: E501 - array_array_of_model ([[read_only_first.ReadOnlyFirst]]): [optional] # noqa: E501 + array_array_of_model ([[ReadOnlyFirst]]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py index 13725068e7e..ffbcdbd27fa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana.py @@ -68,8 +68,8 @@ class Banana(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class Banana(ModelNormal): def discriminator(): return None + attribute_map = { 'length_cm': 'lengthCm', # noqa: E501 } @@ -100,7 +101,7 @@ class Banana(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """banana.Banana - a model defined in OpenAPI + """Banana - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py index 2675290a9c4..c6949869845 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/banana_req.py @@ -68,8 +68,8 @@ class BananaReq(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class BananaReq(ModelNormal): def discriminator(): return None + attribute_map = { 'length_cm': 'lengthCm', # noqa: E501 'sweet': 'sweet', # noqa: E501 @@ -102,7 +103,7 @@ class BananaReq(ModelNormal): @convert_js_args_to_python_args def __init__(self, length_cm, *args, **kwargs): # noqa: E501 - """banana_req.BananaReq - a model defined in OpenAPI + """BananaReq - a model defined in OpenAPI Args: length_cm (float): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py index 2766647c867..68532b82acc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/basque_pig.py @@ -68,8 +68,8 @@ class BasquePig(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class BasquePig(ModelNormal): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 } @@ -100,7 +101,7 @@ class BasquePig(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """basque_pig.BasquePig - a model defined in OpenAPI + """BasquePig - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py index 18c5f54c06f..3e0068ed683 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/capitalization.py @@ -68,8 +68,8 @@ class Capitalization(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -88,6 +88,7 @@ class Capitalization(ModelNormal): def discriminator(): return None + attribute_map = { 'small_camel': 'smallCamel', # noqa: E501 'capital_camel': 'CapitalCamel', # noqa: E501 @@ -110,7 +111,7 @@ class Capitalization(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """capitalization.Capitalization - a model defined in OpenAPI + """Capitalization - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py index 32966359277..79cb4253383 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat.py @@ -29,21 +29,14 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import address -except ImportError: - address = sys.modules[ - 'petstore_api.model.address'] -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import cat_all_of -except ImportError: - cat_all_of = sys.modules[ - 'petstore_api.model.cat_all_of'] + +def lazy_import(): + from petstore_api.model.address import Address + from petstore_api.model.animal import Animal + from petstore_api.model.cat_all_of import CatAllOf + globals()['Address'] = Address + globals()['Animal'] = Animal + globals()['CatAllOf'] = CatAllOf class Cat(ModelComposed): @@ -76,20 +69,28 @@ class Cat(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'declawed': (bool,), # noqa: E501 @@ -124,7 +125,7 @@ class Cat(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """cat.Cat - a model defined in OpenAPI + """Cat - a model defined in OpenAPI Args: class_name (str): @@ -232,13 +233,14 @@ class Cat(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - address.Address, - animal.Animal, - cat_all_of.CatAllOf, + Address, + Animal, + CatAllOf, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py index c257813c120..dadc7147572 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/cat_all_of.py @@ -68,8 +68,8 @@ class CatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class CatAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'declawed': 'declawed', # noqa: E501 } @@ -100,7 +101,7 @@ class CatAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """cat_all_of.CatAllOf - a model defined in OpenAPI + """CatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py index e2be1802b1d..a5af94f90ce 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/category.py @@ -68,8 +68,8 @@ class Category(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Category(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'id': 'id', # noqa: E501 @@ -102,7 +103,7 @@ class Category(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """category.Category - a model defined in OpenAPI + """Category - a model defined in OpenAPI Args: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py index 0710d1523d6..dfeab37c441 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat_all_of -except ImportError: - child_cat_all_of = sys.modules[ - 'petstore_api.model.child_cat_all_of'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat_all_of import ChildCatAllOf + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCatAllOf'] = ChildCatAllOf + globals()['ParentPet'] = ParentPet class ChildCat(ModelComposed): @@ -71,20 +67,28 @@ class ChildCat(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 'name': (str,), # noqa: E501 @@ -117,7 +121,7 @@ class ChildCat(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """child_cat.ChildCat - a model defined in OpenAPI + """ChildCat - a model defined in OpenAPI Args: pet_type (str): @@ -224,12 +228,13 @@ class ChildCat(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - child_cat_all_of.ChildCatAllOf, - parent_pet.ParentPet, + ChildCatAllOf, + ParentPet, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py index cc67b70c874..d9c453ba4d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/child_cat_all_of.py @@ -68,8 +68,8 @@ class ChildCatAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ChildCatAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 } @@ -100,7 +101,7 @@ class ChildCatAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """child_cat_all_of.ChildCatAllOf - a model defined in OpenAPI + """ChildCatAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py index d80e4ef3671..a1d4959a985 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/class_model.py @@ -68,8 +68,8 @@ class ClassModel(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ClassModel(ModelNormal): def discriminator(): return None + attribute_map = { '_class': '_class', # noqa: E501 } @@ -100,7 +101,7 @@ class ClassModel(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """class_model.ClassModel - a model defined in OpenAPI + """ClassModel - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py index 2ea3b4aadd4..114dab427f4 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/client.py @@ -68,8 +68,8 @@ class Client(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class Client(ModelNormal): def discriminator(): return None + attribute_map = { 'client': 'client', # noqa: E501 } @@ -100,7 +101,7 @@ class Client(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """client.Client - a model defined in OpenAPI + """Client - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py index 768104df4cc..b1826e361b0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/complex_quadrilateral.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral_interface -except ImportError: - quadrilateral_interface = sys.modules[ - 'petstore_api.model.quadrilateral_interface'] -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface class ComplexQuadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class ComplexQuadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ class ComplexQuadrilateral(ModelComposed): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'quadrilateral_type': 'quadrilateralType', # noqa: E501 @@ -113,7 +118,7 @@ class ComplexQuadrilateral(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 - """complex_quadrilateral.ComplexQuadrilateral - a model defined in OpenAPI + """ComplexQuadrilateral - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ class ComplexQuadrilateral(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - quadrilateral_interface.QuadrilateralInterface, - shape_interface.ShapeInterface, + QuadrilateralInterface, + ShapeInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py index b513cd1039a..b94be08717f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/composed_one_of_number_with_validations.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['Animal'] = Animal + globals()['NumberWithValidations'] = NumberWithValidations class ComposedOneOfNumberWithValidations(ModelComposed): @@ -71,20 +67,28 @@ class ComposedOneOfNumberWithValidations(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'color': (str,), # noqa: E501 @@ -94,6 +98,7 @@ class ComposedOneOfNumberWithValidations(ModelComposed): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'color': 'color', # noqa: E501 @@ -113,7 +118,7 @@ class ComposedOneOfNumberWithValidations(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations - a model defined in OpenAPI + """ComposedOneOfNumberWithValidations - a model defined in OpenAPI Args: @@ -221,15 +226,16 @@ class ComposedOneOfNumberWithValidations(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - animal.Animal, + Animal, + NumberWithValidations, date, none_type, - number_with_validations.NumberWithValidations, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py index 768a47bdc72..ab547146c57 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/danish_pig.py @@ -68,8 +68,8 @@ class DanishPig(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class DanishPig(ModelNormal): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 } @@ -100,7 +101,7 @@ class DanishPig(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """danish_pig.DanishPig - a model defined in OpenAPI + """DanishPig - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py index 836d19b484a..9dcfb59d09c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] -try: - from petstore_api.model import dog_all_of -except ImportError: - dog_all_of = sys.modules[ - 'petstore_api.model.dog_all_of'] + +def lazy_import(): + from petstore_api.model.animal import Animal + from petstore_api.model.dog_all_of import DogAllOf + globals()['Animal'] = Animal + globals()['DogAllOf'] = DogAllOf class Dog(ModelComposed): @@ -71,20 +67,28 @@ class Dog(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'breed': (str,), # noqa: E501 @@ -119,7 +123,7 @@ class Dog(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """dog.Dog - a model defined in OpenAPI + """Dog - a model defined in OpenAPI Args: class_name (str): @@ -227,12 +231,13 @@ class Dog(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - animal.Animal, - dog_all_of.DogAllOf, + Animal, + DogAllOf, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py index 299a4d956bc..c27b3bbc053 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/dog_all_of.py @@ -68,8 +68,8 @@ class DogAllOf(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class DogAllOf(ModelNormal): def discriminator(): return None + attribute_map = { 'breed': 'breed', # noqa: E501 } @@ -100,7 +101,7 @@ class DogAllOf(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """dog_all_of.DogAllOf - a model defined in OpenAPI + """DogAllOf - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py index ea6422a1022..21b5ef5054b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/drawing.py @@ -29,26 +29,16 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import fruit -except ImportError: - fruit = sys.modules[ - 'petstore_api.model.fruit'] -try: - from petstore_api.model import nullable_shape -except ImportError: - nullable_shape = sys.modules[ - 'petstore_api.model.nullable_shape'] -try: - from petstore_api.model import shape -except ImportError: - shape = sys.modules[ - 'petstore_api.model.shape'] -try: - from petstore_api.model import shape_or_null -except ImportError: - shape_or_null = sys.modules[ - 'petstore_api.model.shape_or_null'] + +def lazy_import(): + from petstore_api.model.fruit import Fruit + from petstore_api.model.nullable_shape import NullableShape + from petstore_api.model.shape import Shape + from petstore_api.model.shape_or_null import ShapeOrNull + globals()['Fruit'] = Fruit + globals()['NullableShape'] = NullableShape + globals()['Shape'] = Shape + globals()['ShapeOrNull'] = ShapeOrNull class Drawing(ModelNormal): @@ -81,31 +71,40 @@ class Drawing(ModelNormal): validations = { } - additional_properties_type = (fruit.Fruit,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (Fruit,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'main_shape': (shape.Shape,), # noqa: E501 - 'shape_or_null': (shape_or_null.ShapeOrNull,), # noqa: E501 - 'nullable_shape': (nullable_shape.NullableShape,), # noqa: E501 - 'shapes': ([shape.Shape],), # noqa: E501 + 'main_shape': (Shape,), # noqa: E501 + 'shape_or_null': (ShapeOrNull,), # noqa: E501 + 'nullable_shape': (NullableShape,), # noqa: E501 + 'shapes': ([Shape],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'main_shape': 'mainShape', # noqa: E501 'shape_or_null': 'shapeOrNull', # noqa: E501 @@ -126,7 +125,7 @@ class Drawing(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """drawing.Drawing - a model defined in OpenAPI + """Drawing - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -159,10 +158,10 @@ class Drawing(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - main_shape (shape.Shape): [optional] # noqa: E501 - shape_or_null (shape_or_null.ShapeOrNull): [optional] # noqa: E501 - nullable_shape (nullable_shape.NullableShape): [optional] # noqa: E501 - shapes ([shape.Shape]): [optional] # noqa: E501 + main_shape (Shape): [optional] # noqa: E501 + shape_or_null (ShapeOrNull): [optional] # noqa: E501 + nullable_shape (NullableShape): [optional] # noqa: E501 + shapes ([Shape]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py index 161ddd5c1d1..4b04cd10401 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_arrays.py @@ -76,8 +76,8 @@ class EnumArrays(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -92,6 +92,7 @@ class EnumArrays(ModelNormal): def discriminator(): return None + attribute_map = { 'just_symbol': 'just_symbol', # noqa: E501 'array_enum': 'array_enum', # noqa: E501 @@ -110,7 +111,7 @@ class EnumArrays(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """enum_arrays.EnumArrays - a model defined in OpenAPI + """EnumArrays - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py index dac3ee37d03..5c9799cce10 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_class.py @@ -69,8 +69,8 @@ class EnumClass(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class EnumClass(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class EnumClass(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """enum_class.EnumClass - a model defined in OpenAPI + """EnumClass - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of '-efg', must be one of ["_abc", "-efg", "(xyz)", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py index 120cb1b3da9..633a0b5ecd2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/enum_test.py @@ -29,31 +29,18 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import integer_enum -except ImportError: - integer_enum = sys.modules[ - 'petstore_api.model.integer_enum'] -try: - from petstore_api.model import integer_enum_one_value -except ImportError: - integer_enum_one_value = sys.modules[ - 'petstore_api.model.integer_enum_one_value'] -try: - from petstore_api.model import integer_enum_with_default_value -except ImportError: - integer_enum_with_default_value = sys.modules[ - 'petstore_api.model.integer_enum_with_default_value'] -try: - from petstore_api.model import string_enum -except ImportError: - string_enum = sys.modules[ - 'petstore_api.model.string_enum'] -try: - from petstore_api.model import string_enum_with_default_value -except ImportError: - string_enum_with_default_value = sys.modules[ - 'petstore_api.model.string_enum_with_default_value'] + +def lazy_import(): + from petstore_api.model.integer_enum import IntegerEnum + from petstore_api.model.integer_enum_one_value import IntegerEnumOneValue + from petstore_api.model.integer_enum_with_default_value import IntegerEnumWithDefaultValue + from petstore_api.model.string_enum import StringEnum + from petstore_api.model.string_enum_with_default_value import StringEnumWithDefaultValue + globals()['IntegerEnum'] = IntegerEnum + globals()['IntegerEnumOneValue'] = IntegerEnumOneValue + globals()['IntegerEnumWithDefaultValue'] = IntegerEnumWithDefaultValue + globals()['StringEnum'] = StringEnum + globals()['StringEnumWithDefaultValue'] = StringEnumWithDefaultValue class EnumTest(ModelNormal): @@ -111,29 +98,31 @@ class EnumTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'enum_string_required': (str,), # noqa: E501 'enum_string': (str,), # noqa: E501 'enum_integer': (int,), # noqa: E501 'enum_number': (float,), # noqa: E501 - 'string_enum': (string_enum.StringEnum, none_type,), # noqa: E501 - 'integer_enum': (integer_enum.IntegerEnum,), # noqa: E501 - 'string_enum_with_default_value': (string_enum_with_default_value.StringEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_with_default_value': (integer_enum_with_default_value.IntegerEnumWithDefaultValue,), # noqa: E501 - 'integer_enum_one_value': (integer_enum_one_value.IntegerEnumOneValue,), # noqa: E501 + 'string_enum': (StringEnum,), # noqa: E501 + 'integer_enum': (IntegerEnum,), # noqa: E501 + 'string_enum_with_default_value': (StringEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_with_default_value': (IntegerEnumWithDefaultValue,), # noqa: E501 + 'integer_enum_one_value': (IntegerEnumOneValue,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'enum_string_required': 'enum_string_required', # noqa: E501 'enum_string': 'enum_string', # noqa: E501 @@ -159,7 +148,7 @@ class EnumTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, enum_string_required, *args, **kwargs): # noqa: E501 - """enum_test.EnumTest - a model defined in OpenAPI + """EnumTest - a model defined in OpenAPI Args: enum_string_required (str): @@ -198,11 +187,11 @@ class EnumTest(ModelNormal): enum_string (str): [optional] # noqa: E501 enum_integer (int): [optional] # noqa: E501 enum_number (float): [optional] # noqa: E501 - string_enum (string_enum.StringEnum, none_type): [optional] # noqa: E501 - integer_enum (integer_enum.IntegerEnum): [optional] # noqa: E501 - string_enum_with_default_value (string_enum_with_default_value.StringEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_with_default_value (integer_enum_with_default_value.IntegerEnumWithDefaultValue): [optional] # noqa: E501 - integer_enum_one_value (integer_enum_one_value.IntegerEnumOneValue): [optional] # noqa: E501 + string_enum (StringEnum): [optional] # noqa: E501 + integer_enum (IntegerEnum): [optional] # noqa: E501 + string_enum_with_default_value (StringEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_with_default_value (IntegerEnumWithDefaultValue): [optional] # noqa: E501 + integer_enum_one_value (IntegerEnumOneValue): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py index e3a3507fa7f..214e84d760d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/equilateral_triangle.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class EquilateralTriangle(ModelComposed): @@ -71,20 +67,28 @@ class EquilateralTriangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ class EquilateralTriangle(ModelComposed): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +118,7 @@ class EquilateralTriangle(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """equilateral_triangle.EquilateralTriangle - a model defined in OpenAPI + """EquilateralTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ class EquilateralTriangle(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py index f7cdcb4fdf8..2dc360144d6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file.py @@ -68,8 +68,8 @@ class File(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class File(ModelNormal): def discriminator(): return None + attribute_map = { 'source_uri': 'sourceURI', # noqa: E501 } @@ -100,7 +101,7 @@ class File(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file.File - a model defined in OpenAPI + """File - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py index 3c1d880d358..dc1405e1fe9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/file_schema_test_class.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import file -except ImportError: - file = sys.modules[ - 'petstore_api.model.file'] + +def lazy_import(): + from petstore_api.model.file import File + globals()['File'] = File class FileSchemaTestClass(ModelNormal): @@ -73,22 +72,24 @@ class FileSchemaTestClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'file': (file.File,), # noqa: E501 - 'files': ([file.File],), # noqa: E501 + 'file': (File,), # noqa: E501 + 'files': ([File],), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'file': 'file', # noqa: E501 'files': 'files', # noqa: E501 @@ -107,7 +108,7 @@ class FileSchemaTestClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """file_schema_test_class.FileSchemaTestClass - a model defined in OpenAPI + """FileSchemaTestClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -140,8 +141,8 @@ class FileSchemaTestClass(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - file (file.File): [optional] # noqa: E501 - files ([file.File]): [optional] # noqa: E501 + file (File): [optional] # noqa: E501 + files ([File]): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py index 5bb23de0783..2947adf7dcb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/foo.py @@ -68,8 +68,8 @@ class Foo(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class Foo(ModelNormal): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 } @@ -100,7 +101,7 @@ class Foo(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """foo.Foo - a model defined in OpenAPI + """Foo - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py index 929b5abb69a..30960998799 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/format_test.py @@ -111,8 +111,8 @@ class FormatTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -140,6 +140,7 @@ class FormatTest(ModelNormal): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'byte': 'byte', # noqa: E501 @@ -171,7 +172,7 @@ class FormatTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, number, byte, date, password, *args, **kwargs): # noqa: E501 - """format_test.FormatTest - a model defined in OpenAPI + """FormatTest - a model defined in OpenAPI Args: number (float): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py index 61f95c056a9..4da9bf18dc2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana class Fruit(ModelComposed): @@ -89,13 +85,14 @@ class Fruit(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 @@ -107,6 +104,7 @@ class Fruit(ModelComposed): def discriminator(): return None + attribute_map = { 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 @@ -128,7 +126,7 @@ class Fruit(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """fruit.Fruit - a model defined in OpenAPI + """Fruit - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -234,13 +232,14 @@ class Fruit(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - apple.Apple, - banana.Banana, + Apple, + Banana, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py index 88ace981c69..83d0b29e850 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/fruit_req.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple_req -except ImportError: - apple_req = sys.modules[ - 'petstore_api.model.apple_req'] -try: - from petstore_api.model import banana_req -except ImportError: - banana_req = sys.modules[ - 'petstore_api.model.banana_req'] + +def lazy_import(): + from petstore_api.model.apple_req import AppleReq + from petstore_api.model.banana_req import BananaReq + globals()['AppleReq'] = AppleReq + globals()['BananaReq'] = BananaReq class FruitReq(ModelComposed): @@ -78,13 +74,14 @@ class FruitReq(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'cultivar': (str,), # noqa: E501 'length_cm': (float,), # noqa: E501 @@ -96,6 +93,7 @@ class FruitReq(ModelComposed): def discriminator(): return None + attribute_map = { 'cultivar': 'cultivar', # noqa: E501 'length_cm': 'lengthCm', # noqa: E501 @@ -117,7 +115,7 @@ class FruitReq(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """fruit_req.FruitReq - a model defined in OpenAPI + """FruitReq - a model defined in OpenAPI Args: @@ -229,14 +227,15 @@ class FruitReq(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - apple_req.AppleReq, - banana_req.BananaReq, + AppleReq, + BananaReq, none_type, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py index 9e063a02908..51a6ab77f10 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/gm_fruit.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import apple -except ImportError: - apple = sys.modules[ - 'petstore_api.model.apple'] -try: - from petstore_api.model import banana -except ImportError: - banana = sys.modules[ - 'petstore_api.model.banana'] + +def lazy_import(): + from petstore_api.model.apple import Apple + from petstore_api.model.banana import Banana + globals()['Apple'] = Apple + globals()['Banana'] = Banana class GmFruit(ModelComposed): @@ -89,13 +85,14 @@ class GmFruit(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'color': (str,), # noqa: E501 'cultivar': (str,), # noqa: E501 @@ -107,6 +104,7 @@ class GmFruit(ModelComposed): def discriminator(): return None + attribute_map = { 'color': 'color', # noqa: E501 'cultivar': 'cultivar', # noqa: E501 @@ -128,7 +126,7 @@ class GmFruit(ModelComposed): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """gm_fruit.GmFruit - a model defined in OpenAPI + """GmFruit - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -234,10 +232,11 @@ class GmFruit(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ - apple.Apple, - banana.Banana, + Apple, + Banana, ], 'allOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py index 3f847bc715d..631e6c636aa 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/grandparent_animal.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import parent_pet -except ImportError: - parent_pet = sys.modules[ - 'petstore_api.model.parent_pet'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.parent_pet import ParentPet + globals()['ChildCat'] = ChildCat + globals()['ParentPet'] = ParentPet class GrandparentAnimal(ModelNormal): @@ -78,22 +74,24 @@ class GrandparentAnimal(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, - 'ParentPet': parent_pet.ParentPet, + 'ChildCat': ChildCat, + 'ParentPet': ParentPet, } if not val: return None @@ -116,7 +114,7 @@ class GrandparentAnimal(ModelNormal): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """grandparent_animal.GrandparentAnimal - a model defined in OpenAPI + """GrandparentAnimal - a model defined in OpenAPI Args: pet_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py index 7a722ee9c78..a89269f087d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/has_only_read_only.py @@ -68,8 +68,8 @@ class HasOnlyReadOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class HasOnlyReadOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'foo': 'foo', # noqa: E501 @@ -102,7 +103,7 @@ class HasOnlyReadOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """has_only_read_only.HasOnlyReadOnly - a model defined in OpenAPI + """HasOnlyReadOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py index 4c56f502242..a664172b8db 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/health_check_result.py @@ -68,8 +68,8 @@ class HealthCheckResult(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class HealthCheckResult(ModelNormal): def discriminator(): return None + attribute_map = { 'nullable_message': 'NullableMessage', # noqa: E501 } @@ -100,7 +101,7 @@ class HealthCheckResult(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """health_check_result.HealthCheckResult - a model defined in OpenAPI + """HealthCheckResult - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py index 062e5832012..0e409d5ca3f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object.py @@ -68,8 +68,8 @@ class InlineObject(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class InlineObject(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'status': 'status', # noqa: E501 @@ -102,7 +103,7 @@ class InlineObject(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object.InlineObject - a model defined in OpenAPI + """InlineObject - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py index 7cfd107cc18..3969643b7c0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object1.py @@ -68,8 +68,8 @@ class InlineObject1(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class InlineObject1(ModelNormal): def discriminator(): return None + attribute_map = { 'additional_metadata': 'additionalMetadata', # noqa: E501 'file': 'file', # noqa: E501 @@ -102,7 +103,7 @@ class InlineObject1(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object1.InlineObject1 - a model defined in OpenAPI + """InlineObject1 - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py index adde4e38e9f..cb8a3b1758d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object2.py @@ -77,8 +77,8 @@ class InlineObject2(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ class InlineObject2(ModelNormal): def discriminator(): return None + attribute_map = { 'enum_form_string_array': 'enum_form_string_array', # noqa: E501 'enum_form_string': 'enum_form_string', # noqa: E501 @@ -111,7 +112,7 @@ class InlineObject2(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_object2.InlineObject2 - a model defined in OpenAPI + """InlineObject2 - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py index 1cadbd05785..b6d93037c33 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object3.py @@ -102,8 +102,8 @@ class InlineObject3(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -130,6 +130,7 @@ class InlineObject3(ModelNormal): def discriminator(): return None + attribute_map = { 'number': 'number', # noqa: E501 'double': 'double', # noqa: E501 @@ -160,7 +161,7 @@ class InlineObject3(ModelNormal): @convert_js_args_to_python_args def __init__(self, number, double, pattern_without_delimiter, byte, *args, **kwargs): # noqa: E501 - """inline_object3.InlineObject3 - a model defined in OpenAPI + """InlineObject3 - a model defined in OpenAPI Args: number (float): None diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py index 1625fed1141..b7e0f469efd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object4.py @@ -68,8 +68,8 @@ class InlineObject4(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class InlineObject4(ModelNormal): def discriminator(): return None + attribute_map = { 'param': 'param', # noqa: E501 'param2': 'param2', # noqa: E501 @@ -102,7 +103,7 @@ class InlineObject4(ModelNormal): @convert_js_args_to_python_args def __init__(self, param, param2, *args, **kwargs): # noqa: E501 - """inline_object4.InlineObject4 - a model defined in OpenAPI + """InlineObject4 - a model defined in OpenAPI Args: param (str): field1 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py index 57d0e6f2c86..041699c0da6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_object5.py @@ -68,8 +68,8 @@ class InlineObject5(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class InlineObject5(ModelNormal): def discriminator(): return None + attribute_map = { 'required_file': 'requiredFile', # noqa: E501 'additional_metadata': 'additionalMetadata', # noqa: E501 @@ -102,7 +103,7 @@ class InlineObject5(ModelNormal): @convert_js_args_to_python_args def __init__(self, required_file, *args, **kwargs): # noqa: E501 - """inline_object5.InlineObject5 - a model defined in OpenAPI + """InlineObject5 - a model defined in OpenAPI Args: required_file (file_type): file to upload diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py index a80abc38971..3535bcb83e7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/inline_response_default.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import foo -except ImportError: - foo = sys.modules[ - 'petstore_api.model.foo'] + +def lazy_import(): + from petstore_api.model.foo import Foo + globals()['Foo'] = Foo class InlineResponseDefault(ModelNormal): @@ -73,21 +72,23 @@ class InlineResponseDefault(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'string': (foo.Foo,), # noqa: E501 + 'string': (Foo,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'string': 'string', # noqa: E501 } @@ -105,7 +106,7 @@ class InlineResponseDefault(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """inline_response_default.InlineResponseDefault - a model defined in OpenAPI + """InlineResponseDefault - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -138,7 +139,7 @@ class InlineResponseDefault(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - string (foo.Foo): [optional] # noqa: E501 + string (Foo): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py index 9f68ce79be7..67d924c427c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum.py @@ -69,8 +69,8 @@ class IntegerEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class IntegerEnum(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class IntegerEnum(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """integer_enum.IntegerEnum - a model defined in OpenAPI + """IntegerEnum - a model defined in OpenAPI Args: value (int):, must be one of [0, 1, 2, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py index ee0ef6db55c..2ce011ae21d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_one_value.py @@ -67,8 +67,8 @@ class IntegerEnumOneValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +82,7 @@ class IntegerEnumOneValue(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -97,7 +98,7 @@ class IntegerEnumOneValue(ModelSimple): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): - """integer_enum_one_value.IntegerEnumOneValue - a model defined in OpenAPI + """IntegerEnumOneValue - a model defined in OpenAPI Keyword Args: value (int): defaults to 0, must be one of [0, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py index 73211d171ce..04884c5dfdc 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/integer_enum_with_default_value.py @@ -69,8 +69,8 @@ class IntegerEnumWithDefaultValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class IntegerEnumWithDefaultValue(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class IntegerEnumWithDefaultValue(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """integer_enum_with_default_value.IntegerEnumWithDefaultValue - a model defined in OpenAPI + """IntegerEnumWithDefaultValue - a model defined in OpenAPI Args: value (int): if omitted the server will use the default value of 0, must be one of [0, 1, 2, ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py index a608fe9b723..2e3108154fd 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/isosceles_triangle.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class IsoscelesTriangle(ModelComposed): @@ -78,13 +74,14 @@ class IsoscelesTriangle(ModelComposed): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +91,7 @@ class IsoscelesTriangle(ModelComposed): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +111,7 @@ class IsoscelesTriangle(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """isosceles_triangle.IsoscelesTriangle - a model defined in OpenAPI + """IsoscelesTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +219,13 @@ class IsoscelesTriangle(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py index 77bd4d0565d..48a4934b3c3 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/list.py @@ -68,8 +68,8 @@ class List(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class List(ModelNormal): def discriminator(): return None + attribute_map = { '_123_list': '123-list', # noqa: E501 } @@ -100,7 +101,7 @@ class List(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """list.List - a model defined in OpenAPI + """List - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py index f6c274287fd..965b2387f66 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mammal.py @@ -29,21 +29,14 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import pig -except ImportError: - pig = sys.modules[ - 'petstore_api.model.pig'] -try: - from petstore_api.model import whale -except ImportError: - whale = sys.modules[ - 'petstore_api.model.whale'] -try: - from petstore_api.model import zebra -except ImportError: - zebra = sys.modules[ - 'petstore_api.model.zebra'] + +def lazy_import(): + from petstore_api.model.pig import Pig + from petstore_api.model.whale import Whale + from petstore_api.model.zebra import Zebra + globals()['Pig'] = Pig + globals()['Whale'] = Whale + globals()['Zebra'] = Zebra class Mammal(ModelComposed): @@ -81,20 +74,28 @@ class Mammal(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 'has_baleen': (bool,), # noqa: E501 @@ -104,10 +105,11 @@ class Mammal(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'Pig': pig.Pig, - 'whale': whale.Whale, - 'zebra': zebra.Zebra, + 'Pig': Pig, + 'whale': Whale, + 'zebra': Zebra, } if not val: return None @@ -134,7 +136,7 @@ class Mammal(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """mammal.Mammal - a model defined in OpenAPI + """Mammal - a model defined in OpenAPI Args: class_name (str): @@ -243,14 +245,15 @@ class Mammal(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - pig.Pig, - whale.Whale, - zebra.Zebra, + Pig, + Whale, + Zebra, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py index 5bafea48a04..b08a5c9d66d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/map_test.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import string_boolean_map -except ImportError: - string_boolean_map = sys.modules[ - 'petstore_api.model.string_boolean_map'] + +def lazy_import(): + from petstore_api.model.string_boolean_map import StringBooleanMap + globals()['StringBooleanMap'] = StringBooleanMap class MapTest(ModelNormal): @@ -77,24 +76,26 @@ class MapTest(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'map_map_of_string': ({str: ({str: (str,)},)},), # noqa: E501 'map_of_enum_string': ({str: (str,)},), # noqa: E501 'direct_map': ({str: (bool,)},), # noqa: E501 - 'indirect_map': (string_boolean_map.StringBooleanMap,), # noqa: E501 + 'indirect_map': (StringBooleanMap,), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'map_map_of_string': 'map_map_of_string', # noqa: E501 'map_of_enum_string': 'map_of_enum_string', # noqa: E501 @@ -115,7 +116,7 @@ class MapTest(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """map_test.MapTest - a model defined in OpenAPI + """MapTest - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,7 +152,7 @@ class MapTest(ModelNormal): map_map_of_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 map_of_enum_string ({str: (str,)}): [optional] # noqa: E501 direct_map ({str: (bool,)}): [optional] # noqa: E501 - indirect_map (string_boolean_map.StringBooleanMap): [optional] # noqa: E501 + indirect_map (StringBooleanMap): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py index 12cda6cf9ae..58a190e9a22 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/mixed_properties_and_additional_properties_class.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import animal -except ImportError: - animal = sys.modules[ - 'petstore_api.model.animal'] + +def lazy_import(): + from petstore_api.model.animal import Animal + globals()['Animal'] = Animal class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @@ -73,23 +72,25 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'uuid': (str,), # noqa: E501 'date_time': (datetime,), # noqa: E501 - 'map': ({str: (animal.Animal,)},), # noqa: E501 + 'map': ({str: (Animal,)},), # noqa: E501 } @cached_property def discriminator(): return None + attribute_map = { 'uuid': 'uuid', # noqa: E501 'date_time': 'dateTime', # noqa: E501 @@ -109,7 +110,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """mixed_properties_and_additional_properties_class.MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI + """MixedPropertiesAndAdditionalPropertiesClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -144,7 +145,7 @@ class MixedPropertiesAndAdditionalPropertiesClass(ModelNormal): _visited_composed_classes = (Animal,) uuid (str): [optional] # noqa: E501 date_time (datetime): [optional] # noqa: E501 - map ({str: (animal.Animal,)}): [optional] # noqa: E501 + map ({str: (Animal,)}): [optional] # noqa: E501 """ _check_type = kwargs.pop('_check_type', True) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py index ea4df21be49..0b331cb4292 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model200_response.py @@ -68,8 +68,8 @@ class Model200Response(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Model200Response(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 '_class': 'class', # noqa: E501 @@ -102,7 +103,7 @@ class Model200Response(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model200_response.Model200Response - a model defined in OpenAPI + """Model200Response - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py index 535657ebbcf..5905af9cc4f 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/model_return.py @@ -68,8 +68,8 @@ class ModelReturn(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ModelReturn(ModelNormal): def discriminator(): return None + attribute_map = { '_return': 'return', # noqa: E501 } @@ -100,7 +101,7 @@ class ModelReturn(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """model_return.ModelReturn - a model defined in OpenAPI + """ModelReturn - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py index 95f197a7a59..1627f3381b0 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/name.py @@ -68,8 +68,8 @@ class Name(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -86,6 +86,7 @@ class Name(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'snake_case': 'snake_case', # noqa: E501 @@ -106,7 +107,7 @@ class Name(ModelNormal): @convert_js_args_to_python_args def __init__(self, name, *args, **kwargs): # noqa: E501 - """name.Name - a model defined in OpenAPI + """Name - a model defined in OpenAPI Args: name (int): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py index 878266d85d3..a8bc03b4d53 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_class.py @@ -61,15 +61,21 @@ class NullableClass(ModelNormal): validations = { } - additional_properties_type = ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -94,6 +100,7 @@ class NullableClass(ModelNormal): def discriminator(): return None + attribute_map = { 'integer_prop': 'integer_prop', # noqa: E501 'number_prop': 'number_prop', # noqa: E501 @@ -122,7 +129,7 @@ class NullableClass(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """nullable_class.NullableClass - a model defined in OpenAPI + """NullableClass - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py index a2979d1b670..83a1cb5bad2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/nullable_shape.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class NullableShape(ModelComposed): @@ -71,20 +67,28 @@ class NullableShape(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = True @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ class NullableShape(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ class NullableShape(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """nullable_shape.NullableShape - a model defined in OpenAPI + """NullableShape - a model defined in OpenAPI Args: shape_type (str): @@ -233,13 +238,14 @@ class NullableShape(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - quadrilateral.Quadrilateral, - triangle.Triangle, + Quadrilateral, + Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py index d16ea3765fc..421b4d51a8b 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_only.py @@ -68,8 +68,8 @@ class NumberOnly(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class NumberOnly(ModelNormal): def discriminator(): return None + attribute_map = { 'just_number': 'JustNumber', # noqa: E501 } @@ -100,7 +101,7 @@ class NumberOnly(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """number_only.NumberOnly - a model defined in OpenAPI + """NumberOnly - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py index dcd182e3401..dac4ec635b8 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/number_with_validations.py @@ -68,8 +68,8 @@ class NumberWithValidations(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class NumberWithValidations(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -98,7 +99,7 @@ class NumberWithValidations(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """number_with_validations.NumberWithValidations - a model defined in OpenAPI + """NumberWithValidations - a model defined in OpenAPI Args: value (float): # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py index 15ccc61db3f..8858e25aa53 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/object_model_with_ref_props.py @@ -29,11 +29,10 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import number_with_validations -except ImportError: - number_with_validations = sys.modules[ - 'petstore_api.model.number_with_validations'] + +def lazy_import(): + from petstore_api.model.number_with_validations import NumberWithValidations + globals()['NumberWithValidations'] = NumberWithValidations class ObjectModelWithRefProps(ModelNormal): @@ -73,15 +72,16 @@ class ObjectModelWithRefProps(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - 'my_number': (number_with_validations.NumberWithValidations,), # noqa: E501 + 'my_number': (NumberWithValidations,), # noqa: E501 'my_string': (str,), # noqa: E501 'my_boolean': (bool,), # noqa: E501 } @@ -90,6 +90,7 @@ class ObjectModelWithRefProps(ModelNormal): def discriminator(): return None + attribute_map = { 'my_number': 'my_number', # noqa: E501 'my_string': 'my_string', # noqa: E501 @@ -109,7 +110,7 @@ class ObjectModelWithRefProps(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """object_model_with_ref_props.ObjectModelWithRefProps - a model defined in OpenAPI + """ObjectModelWithRefProps - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -142,7 +143,7 @@ class ObjectModelWithRefProps(ModelNormal): Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - my_number (number_with_validations.NumberWithValidations): [optional] # noqa: E501 + my_number (NumberWithValidations): [optional] # noqa: E501 my_string (str): [optional] # noqa: E501 my_boolean (bool): [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py index b21543df95f..08ce05074ae 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/order.py @@ -73,8 +73,8 @@ class Order(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -93,6 +93,7 @@ class Order(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'pet_id': 'petId', # noqa: E501 @@ -115,7 +116,7 @@ class Order(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """order.Order - a model defined in OpenAPI + """Order - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py index f8faa308d6f..b7102569a14 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/parent_pet.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import child_cat -except ImportError: - child_cat = sys.modules[ - 'petstore_api.model.child_cat'] -try: - from petstore_api.model import grandparent_animal -except ImportError: - grandparent_animal = sys.modules[ - 'petstore_api.model.grandparent_animal'] + +def lazy_import(): + from petstore_api.model.child_cat import ChildCat + from petstore_api.model.grandparent_animal import GrandparentAnimal + globals()['ChildCat'] = ChildCat + globals()['GrandparentAnimal'] = GrandparentAnimal class ParentPet(ModelComposed): @@ -71,28 +67,37 @@ class ParentPet(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'pet_type': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'ChildCat': child_cat.ChildCat, + 'ChildCat': ChildCat, } if not val: return None @@ -116,7 +121,7 @@ class ParentPet(ModelComposed): @convert_js_args_to_python_args def __init__(self, pet_type, *args, **kwargs): # noqa: E501 - """parent_pet.ParentPet - a model defined in OpenAPI + """ParentPet - a model defined in OpenAPI Args: pet_type (str): @@ -222,11 +227,12 @@ class ParentPet(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - grandparent_animal.GrandparentAnimal, + GrandparentAnimal, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py index 5837810f22e..77f5d3bb1ee 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pet.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import category -except ImportError: - category = sys.modules[ - 'petstore_api.model.category'] -try: - from petstore_api.model import tag -except ImportError: - tag = sys.modules[ - 'petstore_api.model.tag'] + +def lazy_import(): + from petstore_api.model.category import Category + from petstore_api.model.tag import Tag + globals()['Category'] = Category + globals()['Tag'] = Tag class Pet(ModelNormal): @@ -83,19 +79,20 @@ class Pet(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'name': (str,), # noqa: E501 'photo_urls': ([str],), # noqa: E501 'id': (int,), # noqa: E501 - 'category': (category.Category,), # noqa: E501 - 'tags': ([tag.Tag],), # noqa: E501 + 'category': (Category,), # noqa: E501 + 'tags': ([Tag],), # noqa: E501 'status': (str,), # noqa: E501 } @@ -103,6 +100,7 @@ class Pet(ModelNormal): def discriminator(): return None + attribute_map = { 'name': 'name', # noqa: E501 'photo_urls': 'photoUrls', # noqa: E501 @@ -125,7 +123,7 @@ class Pet(ModelNormal): @convert_js_args_to_python_args def __init__(self, name, photo_urls, *args, **kwargs): # noqa: E501 - """pet.Pet - a model defined in OpenAPI + """Pet - a model defined in OpenAPI Args: name (str): @@ -163,8 +161,8 @@ class Pet(ModelNormal): through its discriminator because we passed in _visited_composed_classes = (Animal,) id (int): [optional] # noqa: E501 - category (category.Category): [optional] # noqa: E501 - tags ([tag.Tag]): [optional] # noqa: E501 + category (Category): [optional] # noqa: E501 + tags ([Tag]): [optional] # noqa: E501 status (str): pet status in the store. [optional] # noqa: E501 """ diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py index f64d88bfeb1..e9e2fef97c2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/pig.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import basque_pig -except ImportError: - basque_pig = sys.modules[ - 'petstore_api.model.basque_pig'] -try: - from petstore_api.model import danish_pig -except ImportError: - danish_pig = sys.modules[ - 'petstore_api.model.danish_pig'] + +def lazy_import(): + from petstore_api.model.basque_pig import BasquePig + from petstore_api.model.danish_pig import DanishPig + globals()['BasquePig'] = BasquePig + globals()['DanishPig'] = DanishPig class Pig(ModelComposed): @@ -71,29 +67,38 @@ class Pig(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'class_name': (str,), # noqa: E501 } @cached_property def discriminator(): + lazy_import() val = { - 'BasquePig': basque_pig.BasquePig, - 'DanishPig': danish_pig.DanishPig, + 'BasquePig': BasquePig, + 'DanishPig': DanishPig, } if not val: return None @@ -117,7 +122,7 @@ class Pig(ModelComposed): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """pig.Pig - a model defined in OpenAPI + """Pig - a model defined in OpenAPI Args: class_name (str): @@ -223,13 +228,14 @@ class Pig(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - basque_pig.BasquePig, - danish_pig.DanishPig, + BasquePig, + DanishPig, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py index ca871a544fb..4dac65fa113 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import complex_quadrilateral -except ImportError: - complex_quadrilateral = sys.modules[ - 'petstore_api.model.complex_quadrilateral'] -try: - from petstore_api.model import simple_quadrilateral -except ImportError: - simple_quadrilateral = sys.modules[ - 'petstore_api.model.simple_quadrilateral'] + +def lazy_import(): + from petstore_api.model.complex_quadrilateral import ComplexQuadrilateral + from petstore_api.model.simple_quadrilateral import SimpleQuadrilateral + globals()['ComplexQuadrilateral'] = ComplexQuadrilateral + globals()['SimpleQuadrilateral'] = SimpleQuadrilateral class Quadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class Quadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -92,9 +96,10 @@ class Quadrilateral(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'ComplexQuadrilateral': complex_quadrilateral.ComplexQuadrilateral, - 'SimpleQuadrilateral': simple_quadrilateral.SimpleQuadrilateral, + 'ComplexQuadrilateral': ComplexQuadrilateral, + 'SimpleQuadrilateral': SimpleQuadrilateral, } if not val: return None @@ -119,7 +124,7 @@ class Quadrilateral(ModelComposed): @convert_js_args_to_python_args def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """quadrilateral.Quadrilateral - a model defined in OpenAPI + """Quadrilateral - a model defined in OpenAPI Args: quadrilateral_type (str): @@ -228,13 +233,14 @@ class Quadrilateral(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - complex_quadrilateral.ComplexQuadrilateral, - simple_quadrilateral.SimpleQuadrilateral, + ComplexQuadrilateral, + SimpleQuadrilateral, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py index e76a7e0a9c0..72274eb9c2c 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/quadrilateral_interface.py @@ -68,8 +68,8 @@ class QuadrilateralInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class QuadrilateralInterface(ModelNormal): def discriminator(): return None + attribute_map = { 'quadrilateral_type': 'quadrilateralType', # noqa: E501 } @@ -100,7 +101,7 @@ class QuadrilateralInterface(ModelNormal): @convert_js_args_to_python_args def __init__(self, quadrilateral_type, *args, **kwargs): # noqa: E501 - """quadrilateral_interface.QuadrilateralInterface - a model defined in OpenAPI + """QuadrilateralInterface - a model defined in OpenAPI Args: quadrilateral_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py index b53aa4db398..f9fea19495d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/read_only_first.py @@ -68,8 +68,8 @@ class ReadOnlyFirst(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class ReadOnlyFirst(ModelNormal): def discriminator(): return None + attribute_map = { 'bar': 'bar', # noqa: E501 'baz': 'baz', # noqa: E501 @@ -102,7 +103,7 @@ class ReadOnlyFirst(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """read_only_first.ReadOnlyFirst - a model defined in OpenAPI + """ReadOnlyFirst - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py index 55defdec487..c3c5f0c5020 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/scalene_triangle.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] -try: - from petstore_api.model import triangle_interface -except ImportError: - triangle_interface = sys.modules[ - 'petstore_api.model.triangle_interface'] + +def lazy_import(): + from petstore_api.model.shape_interface import ShapeInterface + from petstore_api.model.triangle_interface import TriangleInterface + globals()['ShapeInterface'] = ShapeInterface + globals()['TriangleInterface'] = TriangleInterface class ScaleneTriangle(ModelComposed): @@ -71,20 +67,28 @@ class ScaleneTriangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ class ScaleneTriangle(ModelComposed): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'triangle_type': 'triangleType', # noqa: E501 @@ -113,7 +118,7 @@ class ScaleneTriangle(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, triangle_type, *args, **kwargs): # noqa: E501 - """scalene_triangle.ScaleneTriangle - a model defined in OpenAPI + """ScaleneTriangle - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ class ScaleneTriangle(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - shape_interface.ShapeInterface, - triangle_interface.TriangleInterface, + ShapeInterface, + TriangleInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py index 457d5743b5c..6168869f2c5 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class Shape(ModelComposed): @@ -71,20 +67,28 @@ class Shape(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ class Shape(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ class Shape(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape.Shape - a model defined in OpenAPI + """Shape - a model defined in OpenAPI Args: shape_type (str): @@ -233,13 +238,14 @@ class Shape(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - quadrilateral.Quadrilateral, - triangle.Triangle, + Quadrilateral, + Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py index 1db0ffe70ce..07c271fe2e6 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_interface.py @@ -68,8 +68,8 @@ class ShapeInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class ShapeInterface(ModelNormal): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 } @@ -100,7 +101,7 @@ class ShapeInterface(ModelNormal): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape_interface.ShapeInterface - a model defined in OpenAPI + """ShapeInterface - a model defined in OpenAPI Args: shape_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py index 17027a5bc55..613055b9feb 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/shape_or_null.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral -except ImportError: - quadrilateral = sys.modules[ - 'petstore_api.model.quadrilateral'] -try: - from petstore_api.model import triangle -except ImportError: - triangle = sys.modules[ - 'petstore_api.model.triangle'] + +def lazy_import(): + from petstore_api.model.quadrilateral import Quadrilateral + from petstore_api.model.triangle import Triangle + globals()['Quadrilateral'] = Quadrilateral + globals()['Triangle'] = Triangle class ShapeOrNull(ModelComposed): @@ -71,20 +67,28 @@ class ShapeOrNull(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -93,9 +97,10 @@ class ShapeOrNull(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'Quadrilateral': quadrilateral.Quadrilateral, - 'Triangle': triangle.Triangle, + 'Quadrilateral': Quadrilateral, + 'Triangle': Triangle, } if not val: return None @@ -121,7 +126,7 @@ class ShapeOrNull(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, *args, **kwargs): # noqa: E501 - """shape_or_null.ShapeOrNull - a model defined in OpenAPI + """ShapeOrNull - a model defined in OpenAPI Args: shape_type (str): @@ -233,14 +238,15 @@ class ShapeOrNull(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ + Quadrilateral, + Triangle, none_type, - quadrilateral.Quadrilateral, - triangle.Triangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py index 330cb845813..de8c1cf2116 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/simple_quadrilateral.py @@ -29,16 +29,12 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import quadrilateral_interface -except ImportError: - quadrilateral_interface = sys.modules[ - 'petstore_api.model.quadrilateral_interface'] -try: - from petstore_api.model import shape_interface -except ImportError: - shape_interface = sys.modules[ - 'petstore_api.model.shape_interface'] + +def lazy_import(): + from petstore_api.model.quadrilateral_interface import QuadrilateralInterface + from petstore_api.model.shape_interface import ShapeInterface + globals()['QuadrilateralInterface'] = QuadrilateralInterface + globals()['ShapeInterface'] = ShapeInterface class SimpleQuadrilateral(ModelComposed): @@ -71,20 +67,28 @@ class SimpleQuadrilateral(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'quadrilateral_type': (str,), # noqa: E501 @@ -94,6 +98,7 @@ class SimpleQuadrilateral(ModelComposed): def discriminator(): return None + attribute_map = { 'shape_type': 'shapeType', # noqa: E501 'quadrilateral_type': 'quadrilateralType', # noqa: E501 @@ -113,7 +118,7 @@ class SimpleQuadrilateral(ModelComposed): @convert_js_args_to_python_args def __init__(self, shape_type, quadrilateral_type, *args, **kwargs): # noqa: E501 - """simple_quadrilateral.SimpleQuadrilateral - a model defined in OpenAPI + """SimpleQuadrilateral - a model defined in OpenAPI Args: shape_type (str): @@ -221,12 +226,13 @@ class SimpleQuadrilateral(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ - quadrilateral_interface.QuadrilateralInterface, - shape_interface.ShapeInterface, + QuadrilateralInterface, + ShapeInterface, ], 'oneOf': [ ], diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py index 75df4a577a3..e4df8f8e89d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/special_model_name.py @@ -68,8 +68,8 @@ class SpecialModelName(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class SpecialModelName(ModelNormal): def discriminator(): return None + attribute_map = { 'special_property_name': '$special[property.name]', # noqa: E501 } @@ -100,7 +101,7 @@ class SpecialModelName(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """special_model_name.SpecialModelName - a model defined in OpenAPI + """SpecialModelName - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py index b1fb6432111..0f4bc65afde 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_boolean_map.py @@ -61,15 +61,21 @@ class StringBooleanMap(ModelNormal): validations = { } - additional_properties_type = (bool,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -82,6 +88,7 @@ class StringBooleanMap(ModelNormal): def discriminator(): return None + attribute_map = { } @@ -98,7 +105,7 @@ class StringBooleanMap(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """string_boolean_map.StringBooleanMap - a model defined in OpenAPI + """StringBooleanMap - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py index 3de705cdcc9..d76bf700a8a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum.py @@ -70,8 +70,8 @@ class StringEnum(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ class StringEnum(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -100,7 +101,7 @@ class StringEnum(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum.StringEnum - a model defined in OpenAPI + """StringEnum - a model defined in OpenAPI Args: value (str):, must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py index 1598bc68430..fd425751def 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/string_enum_with_default_value.py @@ -69,8 +69,8 @@ class StringEnumWithDefaultValue(ModelSimple): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class StringEnumWithDefaultValue(ModelSimple): def discriminator(): return None + attribute_map = {} _composed_schemas = None @@ -99,7 +100,7 @@ class StringEnumWithDefaultValue(ModelSimple): @convert_js_args_to_python_args def __init__(self, value, *args, **kwargs): - """string_enum_with_default_value.StringEnumWithDefaultValue - a model defined in OpenAPI + """StringEnumWithDefaultValue - a model defined in OpenAPI Args: value (str): if omitted the server will use the default value of 'placed', must be one of ["placed", "approved", "delivered", ] # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py index cdf9c9d2633..d1f0c9aa6d9 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/tag.py @@ -68,8 +68,8 @@ class Tag(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -84,6 +84,7 @@ class Tag(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'name': 'name', # noqa: E501 @@ -102,7 +103,7 @@ class Tag(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """tag.Tag - a model defined in OpenAPI + """Tag - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py index b08f0d1025f..2b83c4c0881 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle.py @@ -29,21 +29,14 @@ from petstore_api.model_utils import ( # noqa: F401 none_type, validate_get_composed_info, ) -try: - from petstore_api.model import equilateral_triangle -except ImportError: - equilateral_triangle = sys.modules[ - 'petstore_api.model.equilateral_triangle'] -try: - from petstore_api.model import isosceles_triangle -except ImportError: - isosceles_triangle = sys.modules[ - 'petstore_api.model.isosceles_triangle'] -try: - from petstore_api.model import scalene_triangle -except ImportError: - scalene_triangle = sys.modules[ - 'petstore_api.model.scalene_triangle'] + +def lazy_import(): + from petstore_api.model.equilateral_triangle import EquilateralTriangle + from petstore_api.model.isosceles_triangle import IsoscelesTriangle + from petstore_api.model.scalene_triangle import ScaleneTriangle + globals()['EquilateralTriangle'] = EquilateralTriangle + globals()['IsoscelesTriangle'] = IsoscelesTriangle + globals()['ScaleneTriangle'] = ScaleneTriangle class Triangle(ModelComposed): @@ -76,20 +69,28 @@ class Triangle(ModelComposed): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { 'shape_type': (str,), # noqa: E501 'triangle_type': (str,), # noqa: E501 @@ -97,10 +98,11 @@ class Triangle(ModelComposed): @cached_property def discriminator(): + lazy_import() val = { - 'EquilateralTriangle': equilateral_triangle.EquilateralTriangle, - 'IsoscelesTriangle': isosceles_triangle.IsoscelesTriangle, - 'ScaleneTriangle': scalene_triangle.ScaleneTriangle, + 'EquilateralTriangle': EquilateralTriangle, + 'IsoscelesTriangle': IsoscelesTriangle, + 'ScaleneTriangle': ScaleneTriangle, } if not val: return None @@ -125,7 +127,7 @@ class Triangle(ModelComposed): @convert_js_args_to_python_args def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """triangle.Triangle - a model defined in OpenAPI + """Triangle - a model defined in OpenAPI Args: triangle_type (str): @@ -234,14 +236,15 @@ class Triangle(ModelComposed): # code would be run when this module is imported, and these composed # classes don't exist yet because their module has not finished # loading + lazy_import() return { 'anyOf': [ ], 'allOf': [ ], 'oneOf': [ - equilateral_triangle.EquilateralTriangle, - isosceles_triangle.IsoscelesTriangle, - scalene_triangle.ScaleneTriangle, + EquilateralTriangle, + IsoscelesTriangle, + ScaleneTriangle, ], } diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py index 5b3ff330c77..d7454cfad8e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/triangle_interface.py @@ -68,8 +68,8 @@ class TriangleInterface(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -83,6 +83,7 @@ class TriangleInterface(ModelNormal): def discriminator(): return None + attribute_map = { 'triangle_type': 'triangleType', # noqa: E501 } @@ -100,7 +101,7 @@ class TriangleInterface(ModelNormal): @convert_js_args_to_python_args def __init__(self, triangle_type, *args, **kwargs): # noqa: E501 - """triangle_interface.TriangleInterface - a model defined in OpenAPI + """TriangleInterface - a model defined in OpenAPI Args: triangle_type (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py index 6813e0eb095..5f26153652d 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/user.py @@ -68,8 +68,8 @@ class User(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -94,6 +94,7 @@ class User(ModelNormal): def discriminator(): return None + attribute_map = { 'id': 'id', # noqa: E501 'username': 'username', # noqa: E501 @@ -122,7 +123,7 @@ class User(ModelNormal): @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 - """user.User - a model defined in OpenAPI + """User - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py index 586c6efa025..6efac18c4f7 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/whale.py @@ -68,8 +68,8 @@ class Whale(ModelNormal): @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -85,6 +85,7 @@ class Whale(ModelNormal): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'has_baleen': 'hasBaleen', # noqa: E501 @@ -104,7 +105,7 @@ class Whale(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """whale.Whale - a model defined in OpenAPI + """Whale - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py index c90032e7671..6abcf271313 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model/zebra.py @@ -66,15 +66,21 @@ class Zebra(ModelNormal): validations = { } - additional_properties_type = (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + @cached_property + def additional_properties_type(): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @cached_property def openapi_types(): """ - This must be a class method so a model may have properties that are - of type self, this ensures that we don't create a cyclic import + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded Returns openapi_types (dict): The key is attribute name @@ -89,6 +95,7 @@ class Zebra(ModelNormal): def discriminator(): return None + attribute_map = { 'class_name': 'className', # noqa: E501 'type': 'type', # noqa: E501 @@ -107,7 +114,7 @@ class Zebra(ModelNormal): @convert_js_args_to_python_args def __init__(self, class_name, *args, **kwargs): # noqa: E501 - """zebra.Zebra - a model defined in OpenAPI + """Zebra - a model defined in OpenAPI Args: class_name (str): diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index ff378aa1e15..de9fc5c3a27 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -41,9 +41,9 @@ class cached_property(object): self._fn = fn def __get__(self, instance, cls=None): - try: + if self.result_key in vars(self): return vars(self)[self.result_key] - except KeyError: + else: result = self._fn() setattr(self, self.result_key, result) return result diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py index 8b89752b364..60dcbd549df 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_fake_api.py @@ -119,7 +119,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import array_of_enums, string_enum endpoint = self.api.array_of_enums - assert endpoint.openapi_types['array_of_enums_array_of_enums'] == (array_of_enums.ArrayOfEnums,) + assert endpoint.openapi_types['array_of_enums'] == (array_of_enums.ArrayOfEnums,) assert endpoint.settings['response_type'] == (array_of_enums.ArrayOfEnums,) # serialization + deserialization works @@ -129,7 +129,7 @@ class TestFakeApi(unittest.TestCase): value_simple = ["placed"] mock_method.return_value = self.mock_response(value_simple) - response = endpoint(array_of_enums_array_of_enums=body) + response = endpoint(array_of_enums=body) self.assert_request_called_with(mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/array-of-enums', value_simple) assert isinstance(response, array_of_enums.ArrayOfEnums) @@ -171,7 +171,7 @@ class TestFakeApi(unittest.TestCase): """ from petstore_api.model import animal, composed_one_of_number_with_validations, number_with_validations endpoint = self.api.composed_one_of_number_with_validations - assert endpoint.openapi_types['composed_one_of_number_with_validations_composed_one_of_number_with_validations'] == ( + assert endpoint.openapi_types['composed_one_of_number_with_validations'] == ( composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) assert endpoint.settings['response_type'] == ( composed_one_of_number_with_validations.ComposedOneOfNumberWithValidations,) @@ -193,7 +193,7 @@ class TestFakeApi(unittest.TestCase): with patch.object(RESTClientObject, 'request') as mock_method: mock_method.return_value = self.mock_response(value_simple) - response = endpoint(composed_one_of_number_with_validations_composed_one_of_number_with_validations=body) + response = endpoint(composed_one_of_number_with_validations=body) self.assert_request_called_with( mock_method, 'http://petstore.swagger.io:80/v2/fake/refs/composed_one_of_number_with_validations', diff --git a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py index cdf42fcd662..9ce55c75bb8 100644 --- a/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python-experimental/test/test_object_model_with_ref_props.py @@ -33,11 +33,11 @@ class TestObjectModelWithRefProps(unittest.TestCase): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - from petstore_api.model.object_model_with_ref_props import number_with_validations + from petstore_api.model.number_with_validations import NumberWithValidations self.assertEqual( ObjectModelWithRefProps.openapi_types, { - 'my_number': (number_with_validations.NumberWithValidations,), + 'my_number': (NumberWithValidations,), 'my_string': (str,), 'my_boolean': (bool,), }