[python-nextgen] fix #16010 circular refs lead to no imports (#16199)

* [python-nextgen] fix #16010 circular refs lead to no imports

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unnecessary Postponed annotations

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] remove unnecessary Postponed annotations

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

* [python-nextgen] update samples

Signed-off-by: ふぁ <yuki@yuki0311.com>

---------

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-07-30 01:42:46 +09:00 committed by GitHub
parent d41fe12c1f
commit 48ff57b4f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
160 changed files with 342 additions and 8 deletions

View File

@ -413,6 +413,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
* @param datetimeImports datetime imports
* @param modelImports model imports
* @param exampleImports example imports
* @param postponedModelImports postponed model imports
* @param postponedExampleImports postponed example imports
* @param classname class name
* @return pydantic type
*
@ -423,6 +425,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
Set<String> datetimeImports,
Set<String> modelImports,
Set<String> exampleImports,
Set<String> postponedModelImports,
Set<String> postponedExampleImports,
String classname) {
if (cp == null) {
// if codegen parameter (e.g. map/dict of undefined type) is null, default to string
@ -444,12 +448,12 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
}
pydanticImports.add("conlist");
return String.format(Locale.ROOT, "conlist(%s%s)",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname),
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname),
constraints);
} else if (cp.isMap) {
typingImports.add("Dict");
return String.format(Locale.ROOT, "Dict[str, %s]",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname));
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname));
} else if (cp.isString) {
if (cp.hasValidation) {
List<String> fieldCustomization = new ArrayList<>();
@ -658,7 +662,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
CodegenMediaType cmt = contents.get(key);
// TODO process the first one only at the moment
if (cmt != null)
return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname);
return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname);
}
throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
} else {
@ -675,6 +679,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
* @param datetimeImports datetime imports
* @param modelImports model imports
* @param exampleImports example imports
* @param postponedModelImports postponed model imports
* @param postponedExampleImports postponed example imports
* @param classname class name
* @return pydantic type
*
@ -685,6 +691,8 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
Set<String> datetimeImports,
Set<String> modelImports,
Set<String> exampleImports,
Set<String> postponedModelImports,
Set<String> postponedExampleImports,
String classname) {
if (cp == null) {
// if codegen property (e.g. map/dict of undefined type) is null, default to string
@ -725,11 +733,11 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
pydanticImports.add("conlist");
typingImports.add("List"); // for return type
return String.format(Locale.ROOT, "conlist(%s%s)",
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname),
getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname),
constraints);
} else if (cp.isMap) {
typingImports.add("Dict");
return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, classname));
return String.format(Locale.ROOT, "Dict[str, %s]", getPydanticType(cp.items, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname));
} else if (cp.isString) {
if (cp.hasValidation) {
List<String> fieldCustomization = new ArrayList<>();
@ -935,6 +943,9 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
} else {
if (circularImports.containsKey(cp.dataType)) {
if (circularImports.get(cp.dataType).contains(classname)) {
hasModelsToImport = true;
postponedModelImports.add(cp.dataType);
postponedExampleImports.add(cp.dataType);
// cp.dataType import map of set contains this model (classname), don't import
LOGGER.debug("Skipped importing {} in {} due to circular import.", cp.dataType, classname);
} else {
@ -960,15 +971,17 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
TreeSet<String> pydanticImports = new TreeSet<>();
TreeSet<String> datetimeImports = new TreeSet<>();
TreeSet<String> modelImports = new TreeSet<>();
TreeSet<String> postponedModelImports = new TreeSet<>();
OperationMap objectMap = objs.getOperations();
List<CodegenOperation> operations = objectMap.getOperation();
for (CodegenOperation operation : operations) {
TreeSet<String> exampleImports = new TreeSet<>(); // import for each operation to be show in sample code
TreeSet<String> postponedExampleImports = new TreeSet<>(); // import for each operation to be show in sample code
List<CodegenParameter> params = operation.allParams;
for (CodegenParameter param : params) {
String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, null);
String typing = getPydanticType(param, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, null);
List<String> fields = new ArrayList<>();
String firstField = "";
@ -1020,7 +1033,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
// update typing import for operation return type
if (!StringUtils.isEmpty(operation.returnType)) {
String typing = getPydanticType(operation.returnProperty, typingImports,
new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, exampleImports, null);
new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, null);
}
// add import for code samples
@ -1032,6 +1045,15 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
}
operation.vendorExtensions.put("x-py-example-import", imports);
}
if (!postponedExampleImports.isEmpty()) {
List<String> imports = new ArrayList<>();
for (String exampleImport : postponedExampleImports) {
imports.add("from " + packageName + ".models." + underscore(exampleImport) + " import "
+ exampleImport);
}
operation.vendorExtensions.put("x-py-example-import", imports);
}
}
List<Map<String, String>> newImports = new ArrayList<>();
@ -1066,6 +1088,14 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
}
}
if (!postponedModelImports.isEmpty()) {
for (String modelImport : postponedModelImports) {
Map<String, String> item = new HashMap<>();
item.put("import", "from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport);
newImports.add(item);
}
}
// reset imports with newImports
objs.setImports(newImports);
return objs;
@ -1194,9 +1224,11 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
TreeSet<String> pydanticImports = new TreeSet<>();
TreeSet<String> datetimeImports = new TreeSet<>();
TreeSet<String> modelImports = new TreeSet<>();
TreeSet<String> postponedModelImports = new TreeSet<>();
for (ModelMap m : objs.getModels()) {
TreeSet<String> exampleImports = new TreeSet<>();
TreeSet<String> postponedExampleImports = new TreeSet<>();
List<String> readOnlyFields = new ArrayList<>();
hasModelsToImport = false;
int property_count = 1;
@ -1249,7 +1281,7 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
//loop through properties/schemas to set up typing, pydantic
for (CodegenProperty cp : codegenProperties) {
String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, model.classname);
String typing = getPydanticType(cp, typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, model.classname);
List<String> fields = new ArrayList<>();
String firstField = "";
@ -1362,6 +1394,20 @@ public class PythonClientCodegen extends AbstractPythonCodegen implements Codege
model.getVendorExtensions().putIfAbsent("x-py-model-imports", modelsToImport);
}
if (!postponedModelImports.isEmpty()) {
Set<String> modelsToImport = new TreeSet<>();
for (String modelImport : postponedModelImports) {
if (modelImport.equals(model.classname)) {
// skip self import
continue;
}
modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport);
}
model.getVendorExtensions().putIfAbsent("x-py-postponed-model-imports", modelsToImport);
}
}
return objs;

View File

@ -29,3 +29,10 @@ from pprint import pprint
except Exception as e:
print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e)
```
{{#vendorExtensions.x-py-postponed-example-imports.size}}
{{#vendorExtensions.x-py-postponed-example-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-example-imports}}
{{classname}}.update_forward_refs()
{{/vendorExtensions.x-py-postponed-example-imports.size}}

View File

@ -171,3 +171,10 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())
{{#vendorExtensions.x-py-postponed-model-imports.size}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.update_forward_refs()
{{/vendorExtensions.x-py-postponed-model-imports.size}}

View File

@ -357,3 +357,10 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
{{/isAdditionalPropertiesTrue}}
return _obj
{{/hasChildren}}
{{#vendorExtensions.x-py-postponed-model-imports.size}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.update_forward_refs()
{{/vendorExtensions.x-py-postponed-model-imports.size}}

View File

@ -197,3 +197,10 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())
{{#vendorExtensions.x-py-postponed-model-imports.size}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.update_forward_refs()
{{/vendorExtensions.x-py-postponed-model-imports.size}}

View File

@ -51,6 +51,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -113,6 +114,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -178,6 +180,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -243,6 +246,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -309,6 +313,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -375,6 +380,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -441,6 +447,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -48,6 +48,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -48,6 +48,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -47,6 +47,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -54,6 +54,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -121,6 +122,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -190,6 +192,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -258,6 +261,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -323,6 +327,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -389,6 +394,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -455,6 +461,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -520,6 +527,7 @@ with openapi_client.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -71,3 +71,4 @@ class Bird(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class Category(BaseModel):
})
return _obj

View File

@ -76,3 +76,4 @@ class DataQuery(Query):
})
return _obj

View File

@ -110,3 +110,4 @@ class DefaultValue(BaseModel):
})
return _obj

View File

@ -73,3 +73,4 @@ class NumberPropertiesOnly(BaseModel):
})
return _obj

View File

@ -101,3 +101,4 @@ class Pet(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class Query(BaseModel):
def from_dict(cls, obj: dict) -> Query:
"""Create an instance of Query from a dict"""

View File

@ -71,3 +71,4 @@ class Tag(BaseModel):
})
return _obj

View File

@ -75,3 +75,4 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
})
return _obj

View File

@ -69,3 +69,4 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
})
return _obj

View File

@ -47,6 +47,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -43,6 +43,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.

View File

@ -60,6 +60,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -122,6 +123,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -185,6 +187,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -313,6 +316,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -379,6 +383,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -444,6 +449,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -508,6 +514,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -572,6 +579,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -637,6 +645,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -699,6 +708,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -762,6 +772,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -824,6 +835,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -891,6 +903,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -952,6 +965,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1041,6 +1055,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1134,6 +1149,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1202,6 +1218,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1266,6 +1283,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1335,6 +1353,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -58,6 +58,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -123,6 +123,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -195,6 +196,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -333,6 +335,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -470,6 +473,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -548,6 +552,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -684,6 +689,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -759,6 +765,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -837,6 +844,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -914,6 +922,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -47,6 +47,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -123,6 +124,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -186,6 +188,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -254,6 +257,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -52,6 +52,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -116,6 +117,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -180,6 +182,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -243,6 +246,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -310,6 +314,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -378,6 +383,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -442,6 +448,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -504,6 +511,7 @@ async with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -70,3 +70,4 @@ class AdditionalPropertiesClass(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class AllOfWithSingleRef(BaseModel):
})
return _obj

View File

@ -87,3 +87,4 @@ class Animal(BaseModel):
json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
", mapping: " + json.dumps(cls.__discriminator_value_class_map))

View File

@ -152,3 +152,4 @@ class AnyOfColor(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -131,3 +131,4 @@ class AnyOfPig(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -72,3 +72,4 @@ class ApiResponse(BaseModel):
})
return _obj

View File

@ -81,3 +81,4 @@ class ArrayOfArrayOfModel(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class ArrayOfArrayOfNumberOnly(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class ArrayOfNumberOnly(BaseModel):
})
return _obj

View File

@ -85,3 +85,4 @@ class ArrayTest(BaseModel):
})
return _obj

View File

@ -70,3 +70,4 @@ class BasquePig(BaseModel):
})
return _obj

View File

@ -78,3 +78,4 @@ class Capitalization(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class Cat(Animal):
})
return _obj

View File

@ -70,3 +70,4 @@ class Category(BaseModel):
})
return _obj

View File

@ -73,3 +73,6 @@ class CircularReferenceModel(BaseModel):
})
return _obj
from petstore_api.models.first_ref import FirstRef
CircularReferenceModel.update_forward_refs()

View File

@ -68,3 +68,4 @@ class ClassModel(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class Client(BaseModel):
})
return _obj

View File

@ -167,3 +167,4 @@ class Color(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -70,3 +70,4 @@ class DanishPig(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class DeprecatedObject(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class Dog(Animal):
})
return _obj

View File

@ -73,3 +73,6 @@ class DummyModel(BaseModel):
})
return _obj
from petstore_api.models.self_reference_model import SelfReferenceModel
DummyModel.update_forward_refs()

View File

@ -91,3 +91,4 @@ class EnumArrays(BaseModel):
})
return _obj

View File

@ -140,3 +140,4 @@ class EnumTest(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class File(BaseModel):
})
return _obj

View File

@ -81,3 +81,4 @@ class FileSchemaTestClass(BaseModel):
})
return _obj

View File

@ -73,3 +73,6 @@ class FirstRef(BaseModel):
})
return _obj
from petstore_api.models.second_ref import SecondRef
FirstRef.update_forward_refs()

View File

@ -68,3 +68,4 @@ class Foo(BaseModel):
})
return _obj

View File

@ -72,3 +72,4 @@ class FooGetDefaultResponse(BaseModel):
})
return _obj

View File

@ -140,3 +140,4 @@ class FormatTest(BaseModel):
})
return _obj

View File

@ -72,3 +72,4 @@ class HasOnlyReadOnly(BaseModel):
})
return _obj

View File

@ -73,3 +73,4 @@ class HealthCheckResult(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class InnerDictWithProperty(BaseModel):
})
return _obj

View File

@ -144,3 +144,4 @@ class IntOrString(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -68,3 +68,4 @@ class List(BaseModel):
})
return _obj

View File

@ -85,3 +85,4 @@ class MapOfArrayOfModel(BaseModel):
})
return _obj

View File

@ -84,3 +84,4 @@ class MapTest(BaseModel):
})
return _obj

View File

@ -85,3 +85,4 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel):
})
return _obj

View File

@ -70,3 +70,4 @@ class Model200Response(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class ModelReturn(BaseModel):
})
return _obj

View File

@ -76,3 +76,4 @@ class Name(BaseModel):
})
return _obj

View File

@ -147,3 +147,4 @@ class NullableClass(BaseModel):
})
return _obj

View File

@ -85,3 +85,4 @@ class NullableProperty(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class NumberOnly(BaseModel):
})
return _obj

View File

@ -68,3 +68,4 @@ class ObjectToTestAdditionalProperties(BaseModel):
})
return _obj

View File

@ -78,3 +78,4 @@ class ObjectWithDeprecatedFields(BaseModel):
})
return _obj

View File

@ -138,3 +138,4 @@ class OneOfEnumString(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -88,3 +88,4 @@ class Order(BaseModel):
})
return _obj

View File

@ -72,3 +72,4 @@ class OuterComposite(BaseModel):
})
return _obj

View File

@ -77,3 +77,4 @@ class OuterObjectWithEnumProperty(BaseModel):
})
return _obj

View File

@ -81,3 +81,4 @@ class Parent(BaseModel):
})
return _obj

View File

@ -81,3 +81,4 @@ class ParentWithOptionalDict(BaseModel):
})
return _obj

View File

@ -100,3 +100,4 @@ class Pet(BaseModel):
})
return _obj

View File

@ -141,3 +141,4 @@ class Pig(BaseModel):
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.dict())

View File

@ -72,3 +72,4 @@ class PropertyNameCollision(BaseModel):
})
return _obj

View File

@ -71,3 +71,4 @@ class ReadOnlyFirst(BaseModel):
})
return _obj

View File

@ -73,3 +73,6 @@ class SecondRef(BaseModel):
})
return _obj
from petstore_api.models.circular_reference_model import CircularReferenceModel
SecondRef.update_forward_refs()

View File

@ -73,3 +73,6 @@ class SelfReferenceModel(BaseModel):
})
return _obj
from petstore_api.models.dummy_model import DummyModel
SelfReferenceModel.update_forward_refs()

View File

@ -68,3 +68,4 @@ class SpecialModelName(BaseModel):
})
return _obj

View File

@ -86,3 +86,4 @@ class SpecialName(BaseModel):
})
return _obj

View File

@ -70,3 +70,4 @@ class Tag(BaseModel):
})
return _obj

View File

@ -82,3 +82,4 @@ class User(BaseModel):
})
return _obj

View File

@ -80,3 +80,4 @@ class WithNestedOneOf(BaseModel):
})
return _obj

View File

@ -47,6 +47,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -43,6 +43,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.

View File

@ -60,6 +60,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -122,6 +123,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -185,6 +187,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -313,6 +316,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -379,6 +383,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -444,6 +449,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -508,6 +514,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -572,6 +579,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -637,6 +645,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -699,6 +708,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -762,6 +772,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -824,6 +835,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -891,6 +903,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -952,6 +965,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1041,6 +1055,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1134,6 +1149,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1202,6 +1218,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1266,6 +1283,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -1335,6 +1353,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -58,6 +58,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -123,6 +123,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -195,6 +196,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -333,6 +335,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -470,6 +473,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -548,6 +552,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -684,6 +689,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -759,6 +765,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -837,6 +844,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -914,6 +922,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -47,6 +47,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -123,6 +124,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -186,6 +188,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -254,6 +257,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -52,6 +52,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -116,6 +117,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -180,6 +182,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -243,6 +246,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -310,6 +314,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -378,6 +383,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes
@ -442,6 +448,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
This endpoint does not need any parameter.
@ -504,6 +511,7 @@ with petstore_api.ApiClient(configuration) as api_client:
```
### Parameters
Name | Type | Description | Notes

View File

@ -82,3 +82,4 @@ class AdditionalPropertiesClass(BaseModel):
return _obj

View File

@ -83,3 +83,4 @@ class AllOfWithSingleRef(BaseModel):
return _obj

View File

@ -94,3 +94,4 @@ class Animal(BaseModel):
json.dumps(obj) + ". Discriminator property name: " + cls.__discriminator_property_name +
", mapping: " + json.dumps(cls.__discriminator_value_class_map))

Some files were not shown because too many files have changed in this diff Show More