python: simplify module imports (#17507)

In #16624, I introduced a new mechanism to record imports to other
modules, instead of having specialized datetime/typing/pydantic objects
to manage imports for these modules.

This change reuses the mechanism from #16624 and replace the specialized
import managers by the generic one. Unused imports from various
.mustache templates are also cleaned up.
This commit is contained in:
Jonathan Ballet 2024-01-03 14:22:53 +01:00 committed by GitHub
parent dffb5c121f
commit 063865973d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
266 changed files with 356 additions and 1335 deletions

View File

@ -861,10 +861,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// process enum in models // process enum in models
objs = postProcessModelsEnum(objs); objs = postProcessModelsEnum(objs);
// TODO: migrate almost (all?) everything to the `Imports` class. // TODO: migrate almost (all?) everything to the `PythonImports` class.
TreeSet<String> typingImports = new TreeSet<>();
TreeSet<String> pydanticImports = new TreeSet<>();
TreeSet<String> datetimeImports = new TreeSet<>();
TreeSet<String> modelImports = new TreeSet<>(); TreeSet<String> modelImports = new TreeSet<>();
TreeSet<String> postponedModelImports = new TreeSet<>(); TreeSet<String> postponedModelImports = new TreeSet<>();
@ -874,21 +871,16 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
List<String> readOnlyFields = new ArrayList<>(); List<String> readOnlyFields = new ArrayList<>();
hasModelsToImport = false; hasModelsToImport = false;
int property_count = 1; int property_count = 1;
typingImports.clear();
pydanticImports.clear();
datetimeImports.clear();
Imports otherImports = new Imports(); PythonImports moduleImports = new PythonImports();
CodegenModel model = m.getModel(); CodegenModel model = m.getModel();
PydanticType pydantic = new PydanticType( PydanticType pydantic = new PydanticType(
typingImports,
pydanticImports,
datetimeImports,
modelImports, modelImports,
exampleImports, exampleImports,
postponedModelImports, postponedModelImports,
postponedExampleImports, postponedExampleImports,
otherImports, moduleImports,
model.classname model.classname
); );
@ -909,24 +901,24 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
List<CodegenProperty> codegenProperties = null; List<CodegenProperty> codegenProperties = null;
if (!model.oneOf.isEmpty()) { // oneOfValidationError if (!model.oneOf.isEmpty()) { // oneOfValidationError
codegenProperties = model.getComposedSchemas().getOneOf(); codegenProperties = model.getComposedSchemas().getOneOf();
typingImports.add("Any"); moduleImports.add("typing", "Any");
typingImports.add("List"); moduleImports.add("typing", "List");
pydanticImports.add("Field"); moduleImports.add("pydantic", "Field");
pydanticImports.add("StrictStr"); moduleImports.add("pydantic", "StrictStr");
pydanticImports.add("ValidationError"); moduleImports.add("pydantic", "ValidationError");
pydanticImports.add("field_validator"); moduleImports.add("pydantic", "field_validator");
} else if (!model.anyOf.isEmpty()) { // anyOF } else if (!model.anyOf.isEmpty()) { // anyOF
codegenProperties = model.getComposedSchemas().getAnyOf(); codegenProperties = model.getComposedSchemas().getAnyOf();
pydanticImports.add("Field"); moduleImports.add("pydantic", "Field");
pydanticImports.add("StrictStr"); moduleImports.add("pydantic", "StrictStr");
pydanticImports.add("ValidationError"); moduleImports.add("pydantic", "ValidationError");
pydanticImports.add("field_validator"); moduleImports.add("pydantic", "field_validator");
} else { // typical model } else { // typical model
codegenProperties = model.vars; codegenProperties = model.vars;
// if super class // if super class
if (model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) { if (model.getDiscriminator() != null && model.getDiscriminator().getMappedModels() != null) {
typingImports.add("Union"); moduleImports.add("typing", "Union");
Set<CodegenDiscriminator.MappedModel> discriminator = model.getDiscriminator().getMappedModels(); Set<CodegenDiscriminator.MappedModel> discriminator = model.getDiscriminator().getMappedModels();
for (CodegenDiscriminator.MappedModel mappedModel : discriminator) { for (CodegenDiscriminator.MappedModel mappedModel : discriminator) {
postponedModelImports.add(mappedModel.getModelName()); postponedModelImports.add(mappedModel.getModelName());
@ -948,11 +940,11 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// if model_generic.mustache is used // if model_generic.mustache is used
if (model.oneOf.isEmpty() && model.anyOf.isEmpty() && !model.isEnum) { if (model.oneOf.isEmpty() && model.anyOf.isEmpty() && !model.isEnum) {
typingImports.add("ClassVar"); moduleImports.add("typing", "ClassVar");
typingImports.add("Dict"); moduleImports.add("typing", "Dict");
typingImports.add("Any"); moduleImports.add("typing", "Any");
if(this.disallowAdditionalPropertiesIfNotPresent || model.isAdditionalPropertiesTrue) { if(this.disallowAdditionalPropertiesIfNotPresent || model.isAdditionalPropertiesTrue) {
typingImports.add("List"); moduleImports.add("typing", "List");
} }
} }
@ -979,7 +971,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
if (!StringUtils.isEmpty(model.parent)) { if (!StringUtils.isEmpty(model.parent)) {
modelImports.add(model.parent); modelImports.add(model.parent);
} else if (!model.isEnum) { } else if (!model.isEnum) {
pydanticImports.add("BaseModel"); moduleImports.add("pydantic", "BaseModel");
} }
// set enum type in extensions and update `name` in enumVars // set enum type in extensions and update `name` in enumVars
@ -997,9 +989,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
// set the extensions if the key is absent // set the extensions if the key is absent
model.getVendorExtensions().putIfAbsent("x-py-typing-imports", typingImports);
model.getVendorExtensions().putIfAbsent("x-py-pydantic-imports", pydanticImports);
model.getVendorExtensions().putIfAbsent("x-py-datetime-imports", datetimeImports);
model.getVendorExtensions().putIfAbsent("x-py-readonly", readOnlyFields); model.getVendorExtensions().putIfAbsent("x-py-readonly", readOnlyFields);
// import models one by one // import models one by one
@ -1011,7 +1000,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
continue; continue;
} }
modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport); modelsToImport.add("from " + packageName + ".models." + underscore(modelImport) + " import " + modelImport);
} }
if (!modelsToImport.isEmpty()) { if (!modelsToImport.isEmpty()) {
@ -1019,8 +1007,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
} }
if (!otherImports.isEmpty()) { if (!moduleImports.isEmpty()) {
model.getVendorExtensions().putIfAbsent("x-py-other-imports", otherImports.exports()); model.getVendorExtensions().putIfAbsent("x-py-other-imports", moduleImports.exports());
} }
@ -1046,9 +1034,6 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* Gets the pydantic type given a Codegen Property * Gets the pydantic type given a Codegen Property
* *
* @param cp codegen property * @param cp codegen property
* @param typingImports typing imports
* @param pydantic pydantic imports
* @param datetimeImports datetime imports
* @param modelImports model imports * @param modelImports model imports
* @param exampleImports example imports * @param exampleImports example imports
* @param postponedModelImports postponed model imports * @param postponedModelImports postponed model imports
@ -1058,24 +1043,18 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* *
*/ */
private PythonType getPydanticType(CodegenProperty cp, private PythonType getPydanticType(CodegenProperty cp,
Set<String> typingImports,
Set<String> pydanticImports,
Set<String> datetimeImports,
Set<String> modelImports, Set<String> modelImports,
Set<String> exampleImports, Set<String> exampleImports,
Set<String> postponedModelImports, Set<String> postponedModelImports,
Set<String> postponedExampleImports, Set<String> postponedExampleImports,
String classname) { String classname) {
Imports otherImports = new Imports(); PythonImports moduleImports = new PythonImports();
PydanticType pt = new PydanticType( PydanticType pt = new PydanticType(
typingImports,
pydanticImports,
datetimeImports,
modelImports, modelImports,
exampleImports, exampleImports,
postponedModelImports, postponedModelImports,
postponedExampleImports, postponedExampleImports,
otherImports, moduleImports,
classname classname
); );
@ -1228,31 +1207,27 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) { public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels) {
hasModelsToImport = false; hasModelsToImport = false;
// TODO: migrate almost (all?) everything to the `Imports` class.
TreeSet<String> typingImports = new TreeSet<>();
TreeSet<String> pydanticImports = new TreeSet<>();
TreeSet<String> datetimeImports = new TreeSet<>();
TreeSet<String> modelImports = new TreeSet<>(); TreeSet<String> modelImports = new TreeSet<>();
TreeSet<String> postponedModelImports = new TreeSet<>(); TreeSet<String> postponedModelImports = new TreeSet<>();
PythonImports moduleImports = new PythonImports();
OperationMap objectMap = objs.getOperations(); OperationMap objectMap = objs.getOperations();
List<CodegenOperation> operations = objectMap.getOperation(); List<CodegenOperation> operations = objectMap.getOperation();
Imports otherImports = new Imports();
for (CodegenOperation operation : operations) { for (CodegenOperation operation : operations) {
TreeSet<String> exampleImports = new TreeSet<>(); // import for each operation to be show in sample code 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 TreeSet<String> postponedExampleImports = new TreeSet<>(); // import for each operation to be show in sample code
List<CodegenParameter> params = operation.allParams; List<CodegenParameter> params = operation.allParams;
for (CodegenParameter cp : params) { for (CodegenParameter cp : params) {
PydanticType pydantic = new PydanticType( PydanticType pydantic = new PydanticType(
typingImports, pydanticImports, datetimeImports, modelImports,
modelImports, exampleImports, exampleImports,
postponedModelImports, postponedExampleImports, postponedModelImports,
otherImports, postponedExampleImports,
null); moduleImports,
null
);
String typing = pydantic.generatePythonType(cp); String typing = pydantic.generatePythonType(cp);
cp.vendorExtensions.put("x-py-typing", typing); cp.vendorExtensions.put("x-py-typing", typing);
} }
@ -1260,8 +1235,14 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// update typing import for operation return type // update typing import for operation return type
if (!StringUtils.isEmpty(operation.returnType)) { if (!StringUtils.isEmpty(operation.returnType)) {
// Not interested in the result, only in the update of the imports // Not interested in the result, only in the update of the imports
getPydanticType(operation.returnProperty, typingImports, getPydanticType(
new TreeSet<>() /* skip pydantic import for return type */, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, null); operation.returnProperty,
modelImports,
exampleImports,
postponedModelImports,
postponedExampleImports,
null
);
} }
// add import for code samples // add import for code samples
@ -1289,33 +1270,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
List<Map<String, String>> newImports = new ArrayList<>(); List<Map<String, String>> newImports = new ArrayList<>();
for (String importLine : otherImports.exports()) { for (String importLine : moduleImports.exports()) {
Map<String, String> item = new HashMap<>(); Map<String, String> item = new HashMap<>();
item.put("import", importLine); item.put("import", importLine);
newImports.add(item); newImports.add(item);
} }
// need datetime import
if (!datetimeImports.isEmpty()) {
Map<String, String> item = new HashMap<>();
item.put("import", String.format(Locale.ROOT, "from datetime import %s\n", StringUtils.join(datetimeImports, ", ")));
newImports.add(item);
}
// need pydantic imports
if (!pydanticImports.isEmpty()) {
Map<String, String> item = new HashMap<>();
item.put("import", String.format(Locale.ROOT, "from pydantic import %s\n", StringUtils.join(pydanticImports, ", ")));
newImports.add(item);
}
// need typing imports
if (!typingImports.isEmpty()) {
Map<String, String> item = new HashMap<>();
item.put("import", String.format(Locale.ROOT, "from typing import %s\n", StringUtils.join(typingImports, ", ")));
newImports.add(item);
}
// import models one by one // import models one by one
if (!modelImports.isEmpty()) { if (!modelImports.isEmpty()) {
for (String modelImport : modelImports) { for (String modelImport : modelImports) {
@ -1584,7 +1544,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* the field / variable being defined are *not* part of the * the field / variable being defined are *not* part of the
* constraints but part of the "type value". * constraints but part of the "type value".
*/ */
public String asTypeConstraint(Imports imports) { public String asTypeConstraint(PythonImports imports) {
return asTypeConstraint(imports, false); return asTypeConstraint(imports, false);
} }
@ -1599,11 +1559,11 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* Note that the default value is not managed here, but directly in * Note that the default value is not managed here, but directly in
* the Mustache template. * the Mustache template.
*/ */
public String asTypeConstraintWithAnnotations(Imports imports) { public String asTypeConstraintWithAnnotations(PythonImports imports) {
return asTypeConstraint(imports, true); return asTypeConstraint(imports, true);
} }
private String asTypeConstraint(Imports imports, boolean withAnnotations) { private String asTypeConstraint(PythonImports imports, boolean withAnnotations) {
String typeParam = ""; String typeParam = "";
if (this.typeParams.size() > 0) { if (this.typeParams.size() > 0) {
List<String> types = new ArrayList<>(); List<String> types = new ArrayList<>();
@ -1657,7 +1617,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* Constraints on the type are *not* part of the "type value", but are part of the "type constraints". * Constraints on the type are *not* part of the "type value", but are part of the "type constraints".
*/ */
@Nullable @Nullable
public String asTypeValue(Imports imports) { public String asTypeValue(PythonImports imports) {
String defaultValue = this.defaultValue; String defaultValue = this.defaultValue;
if (this.annotations.size() > 0) { if (this.annotations.size() > 0) {
@ -1687,7 +1647,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
/* Track the list of resources to imports from where. /* Track the list of resources to imports from where.
* *
* Imports are tracked as a set of modules to import from, and actual * PythonImports are tracked as a set of modules to import from, and actual
* resources (classes, functions, etc.) to import. * resources (classes, functions, etc.) to import.
* *
* The same resource can be safely "imported" many times from the same * The same resource can be safely "imported" many times from the same
@ -1695,10 +1655,10 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
* entries will be automatically removed. * entries will be automatically removed.
* *
* */ * */
class Imports { class PythonImports {
private Map<String, Set<String>> imports; private Map<String, Set<String>> imports;
public Imports() { public PythonImports() {
imports = new HashMap<>(); imports = new HashMap<>();
} }
@ -1742,35 +1702,26 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
class PydanticType { class PydanticType {
private Set<String> typingImports;
private Set<String> pydanticImports;
private Set<String> datetimeImports;
private Set<String> modelImports; private Set<String> modelImports;
private Set<String> exampleImports; private Set<String> exampleImports;
private Set<String> postponedModelImports; private Set<String> postponedModelImports;
private Set<String> postponedExampleImports; private Set<String> postponedExampleImports;
private Imports otherImports; private PythonImports moduleImports;
private String classname; private String classname;
public PydanticType( public PydanticType(
Set<String> typingImports,
Set<String> pydanticImports,
Set<String> datetimeImports,
Set<String> modelImports, Set<String> modelImports,
Set<String> exampleImports, Set<String> exampleImports,
Set<String> postponedModelImports, Set<String> postponedModelImports,
Set<String> postponedExampleImports, Set<String> postponedExampleImports,
Imports otherImports, PythonImports moduleImports,
String classname String classname
) { ) {
this.typingImports = typingImports;
this.pydanticImports = pydanticImports;
this.datetimeImports = datetimeImports;
this.modelImports = modelImports; this.modelImports = modelImports;
this.exampleImports = exampleImports; this.exampleImports = exampleImports;
this.postponedModelImports = postponedModelImports; this.postponedModelImports = postponedModelImports;
this.postponedExampleImports = postponedExampleImports; this.postponedExampleImports = postponedExampleImports;
this.otherImports = otherImports; this.moduleImports = moduleImports;
this.classname = classname; this.classname = classname;
} }
@ -1790,12 +1741,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// random JSON serialization order, unable to easily serialize // random JSON serialization order, unable to easily serialize
// to JSON, etc. // to JSON, etc.
//pt.setType("Set"); //pt.setType("Set");
//typingImports.add("Set"); //moduleImports.add("typing", "Set");
pt.setType("List"); pt.setType("List");
typingImports.add("List"); moduleImports.add("typing", "List");
} else { } else {
pt.setType("List"); pt.setType("List");
typingImports.add("List"); moduleImports.add("typing", "List");
} }
pt.addTypeParam(getType(cp.getItems())); pt.addTypeParam(getType(cp.getItems()));
return pt; return pt;
@ -1816,24 +1767,24 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
if (cp.getPattern() != null) { if (cp.getPattern() != null) {
pydanticImports.add("field_validator"); moduleImports.add("pydantic", "field_validator");
// use validator instead as regex doesn't support flags, e.g. IGNORECASE // use validator instead as regex doesn't support flags, e.g. IGNORECASE
//fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern())); //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern()));
} }
return pt; return pt;
} else { } else {
if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead if ("password".equals(cp.getFormat())) { // TDOO avoid using format, use `is` boolean flag instead
pydanticImports.add("SecretStr"); moduleImports.add("pydantic", "SecretStr");
return new PythonType("SecretStr"); return new PythonType("SecretStr");
} else { } else {
pydanticImports.add("StrictStr"); moduleImports.add("pydantic", "StrictStr");
return new PythonType("StrictStr"); return new PythonType("StrictStr");
} }
} }
} }
private PythonType mapType(IJsonSchemaValidationProperties cp) { private PythonType mapType(IJsonSchemaValidationProperties cp) {
typingImports.add("Dict"); moduleImports.add("typing", "Dict");
PythonType pt = new PythonType("Dict"); PythonType pt = new PythonType("Dict");
pt.addTypeParam(new PythonType("str")); pt.addTypeParam(new PythonType("str"));
pt.addTypeParam(getType(cp.getItems())); pt.addTypeParam(getType(cp.getItems()));
@ -1872,7 +1823,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
floatt.constrain("strict", true); floatt.constrain("strict", true);
intt.constrain("strict", true); intt.constrain("strict", true);
typingImports.add("Union"); moduleImports.add("typing", "Union");
PythonType pt = new PythonType("Union"); PythonType pt = new PythonType("Union");
pt.addTypeParam(floatt); pt.addTypeParam(floatt);
pt.addTypeParam(intt); pt.addTypeParam(intt);
@ -1885,15 +1836,15 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
} else { } else {
if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) { if ("Union[StrictFloat, StrictInt]".equals(mapNumberTo)) {
typingImports.add("Union"); moduleImports.add("typing", "Union");
pydanticImports.add("StrictFloat"); moduleImports.add("pydantic", "StrictFloat");
pydanticImports.add("StrictInt"); moduleImports.add("pydantic", "StrictInt");
PythonType pt = new PythonType("Union"); PythonType pt = new PythonType("Union");
pt.addTypeParam(new PythonType("StrictFloat")); pt.addTypeParam(new PythonType("StrictFloat"));
pt.addTypeParam(new PythonType("StrictInt")); pt.addTypeParam(new PythonType("StrictInt"));
return pt; return pt;
} else if ("StrictFloat".equals(mapNumberTo)) { } else if ("StrictFloat".equals(mapNumberTo)) {
pydanticImports.add("StrictFloat"); moduleImports.add("pydantic", "StrictFloat");
return new PythonType("StrictFloat"); return new PythonType("StrictFloat");
} else { } else {
return new PythonType("float"); return new PythonType("float");
@ -1925,7 +1876,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
return pt; return pt;
} else { } else {
pydanticImports.add("StrictInt"); moduleImports.add("pydantic", "StrictInt");
return new PythonType("StrictInt"); return new PythonType("StrictInt");
} }
} }
@ -1947,21 +1898,21 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
strt.constrain("min_length", cp.getMinLength()); strt.constrain("min_length", cp.getMinLength());
} }
if (cp.getPattern() != null) { if (cp.getPattern() != null) {
pydanticImports.add("field_validator"); moduleImports.add("pydantic", "field_validator");
// use validator instead as regex doesn't support flags, e.g. IGNORECASE // use validator instead as regex doesn't support flags, e.g. IGNORECASE
//fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern())); //fieldCustomization.add(Locale.ROOT, String.format(Locale.ROOT, "regex=r'%s'", cp.getPattern()));
} }
typingImports.add("Union"); moduleImports.add("typing", "Union");
PythonType pt = new PythonType("Union"); PythonType pt = new PythonType("Union");
pt.addTypeParam(bytest); pt.addTypeParam(bytest);
pt.addTypeParam(strt); pt.addTypeParam(strt);
return pt; return pt;
} else { } else {
// same as above which has validation // same as above which has validation
pydanticImports.add("StrictBytes"); moduleImports.add("pydantic", "StrictBytes");
pydanticImports.add("StrictStr"); moduleImports.add("pydantic", "StrictStr");
typingImports.add("Union"); moduleImports.add("typing", "Union");
PythonType pt = new PythonType("Union"); PythonType pt = new PythonType("Union");
pt.addTypeParam(new PythonType("StrictBytes")); pt.addTypeParam(new PythonType("StrictBytes"));
@ -1971,13 +1922,13 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
private PythonType boolType(IJsonSchemaValidationProperties cp) { private PythonType boolType(IJsonSchemaValidationProperties cp) {
pydanticImports.add("StrictBool"); moduleImports.add("pydantic", "StrictBool");
return new PythonType("StrictBool"); return new PythonType("StrictBool");
} }
private PythonType decimalType(IJsonSchemaValidationProperties cp) { private PythonType decimalType(IJsonSchemaValidationProperties cp) {
PythonType pt = new PythonType("Decimal"); PythonType pt = new PythonType("Decimal");
otherImports.add("decimal", "Decimal"); moduleImports.add("decimal", "Decimal");
if (cp.getHasValidation()) { if (cp.getHasValidation()) {
// e.g. condecimal(ge=10, le=100, strict=True) // e.g. condecimal(ge=10, le=100, strict=True)
@ -2005,16 +1956,16 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
private PythonType anyType(IJsonSchemaValidationProperties cp) { private PythonType anyType(IJsonSchemaValidationProperties cp) {
typingImports.add("Any"); moduleImports.add("typing", "Any");
return new PythonType("Any"); return new PythonType("Any");
} }
private PythonType dateType(IJsonSchemaValidationProperties cp) { private PythonType dateType(IJsonSchemaValidationProperties cp) {
if (cp.getIsDate()) { if (cp.getIsDate()) {
datetimeImports.add("date"); moduleImports.add("datetime", "date");
} }
if (cp.getIsDateTime()) { if (cp.getIsDateTime()) {
datetimeImports.add("datetime"); moduleImports.add("datetime", "datetime");
} }
return new PythonType(cp.getDataType()); return new PythonType(cp.getDataType());
@ -2036,12 +1987,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
if (cp == null) { if (cp == null) {
// if codegen property (e.g. map/dict of undefined type) is null, default to string // if codegen property (e.g. map/dict of undefined type) is null, default to string
LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any."); LOGGER.warn("Codegen property is null (e.g. map/dict of undefined type). Default to typing.Any.");
typingImports.add("Any"); moduleImports.add("typing", "Any");
return new PythonType("Any"); return new PythonType("Any");
} }
if (cp.getIsEnum()) { if (cp.getIsEnum()) {
pydanticImports.add("field_validator"); moduleImports.add("pydantic", "field_validator");
} }
if (cp.getIsArray()) { if (cp.getIsArray()) {
@ -2083,7 +2034,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
also need to put cp.isEnum check after isArray, isMap check also need to put cp.isEnum check after isArray, isMap check
if (cp.isEnum) { if (cp.isEnum) {
// use Literal for inline enum // use Literal for inline enum
typingImports.add("Literal"); moduleImports.add("typing", "Literal");
List<String> values = new ArrayList<>(); List<String> values = new ArrayList<>();
List<Map<String, Object>> enumVars = (List<Map<String, Object>>) cp.allowableValues.get("enumVars"); List<Map<String, Object>> enumVars = (List<Map<String, Object>>) cp.allowableValues.get("enumVars");
if (enumVars != null) { if (enumVars != null) {
@ -2132,7 +2083,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
private String finalizeType(CodegenProperty cp, PythonType pt) { private String finalizeType(CodegenProperty cp, PythonType pt) {
if (!cp.required || cp.isNullable) { if (!cp.required || cp.isNullable) {
typingImports.add("Optional"); moduleImports.add("typing", "Optional");
PythonType opt = new PythonType("Optional"); PythonType opt = new PythonType("Optional");
opt.addTypeParam(pt); opt.addTypeParam(pt);
pt = opt; pt = opt;
@ -2167,8 +2118,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
} }
} }
String typeConstraint = pt.asTypeConstraint(otherImports); String typeConstraint = pt.asTypeConstraint(moduleImports);
String typeValue = pt.asTypeValue(otherImports); String typeValue = pt.asTypeValue(moduleImports);
if (typeValue == null) { if (typeValue == null) {
return typeConstraint; return typeConstraint;
@ -2200,7 +2151,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
// TODO process the first one only at the moment // TODO process the first one only at the moment
if (cmt != null) if (cmt != null)
// TODO: don't loop back to the deprecated getPydanticType method // TODO: don't loop back to the deprecated getPydanticType method
return getPydanticType(cmt.getSchema(), typingImports, pydanticImports, datetimeImports, modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname); return getPydanticType(cmt.getSchema(), modelImports, exampleImports, postponedModelImports, postponedExampleImports, classname);
} }
throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp); throw new RuntimeException("Error! Failed to process getPydanticType when getting the content: " + cp);
} else { } else {
@ -2213,7 +2164,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
private String finalizeType(CodegenParameter cp, PythonType pt) { private String finalizeType(CodegenParameter cp, PythonType pt) {
if (!cp.required || cp.isNullable) { if (!cp.required || cp.isNullable) {
typingImports.add("Optional"); moduleImports.add("typing", "Optional");
PythonType opt = new PythonType("Optional"); PythonType opt = new PythonType("Optional");
opt.addTypeParam(pt); opt.addTypeParam(pt);
pt = opt; pt = opt;
@ -2228,8 +2179,8 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
fields.add(String.format(Locale.ROOT, "example=%s", cp.getExample())); fields.add(String.format(Locale.ROOT, "example=%s", cp.getExample()));
}*/ }*/
//return pt.asTypeConstraint(otherImports); //return pt.asTypeConstraint(moduleImports);
return pt.asTypeConstraintWithAnnotations(otherImports); return pt.asTypeConstraintWithAnnotations(moduleImports);
} }
} }
} }

View File

@ -1,12 +1,9 @@
# coding: utf-8 # coding: utf-8
{{>partial_header}} {{>partial_header}}
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -170,7 +167,7 @@ class {{classname}}:
{{#isBinary}} {{#isBinary}}
# convert to byte array if the input is a file name (str) # convert to byte array if the input is a file name (str)
if isinstance({{paramName}}, str): if isinstance({{paramName}}, str):
with io.open({{paramName}}, "rb") as _fp: with open({{paramName}}, "rb") as _fp:
_body_params = _fp.read() _body_params = _fp.read()
else: else:
_body_params = {{paramName}} _body_params = {{paramName}}

View File

@ -2,7 +2,6 @@
{{>partial_header}} {{>partial_header}}
import atexit
import datetime import datetime
from dateutil.parser import parse from dateutil.parser import parse
import json import json

View File

@ -1,7 +1,5 @@
```python ```python
import time
import os
import {{{packageName}}} import {{{packageName}}}
{{#vendorExtensions.x-py-example-import}} {{#vendorExtensions.x-py-example-import}}
{{{.}}} {{{.}}}

View File

@ -1,7 +1,7 @@
"""API response object.""" """API response object."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Optional, Generic, TypeVar from typing import Dict, Optional, Generic, TypeVar
from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel
T = TypeVar("T") T = TypeVar("T")

View File

@ -1,6 +1,5 @@
```python ```python
{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}} {{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}}
import time
import {{{packageName}}} import {{{packageName}}}
from {{{packageName}}}.rest import ApiException from {{{packageName}}}.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -3,9 +3,6 @@ from inspect import getfullargspec
import json import json
import pprint import pprint
import re # noqa: F401 import re # noqa: F401
{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
{{#vendorExtensions.x-py-other-imports}} {{#vendorExtensions.x-py-other-imports}}
{{{.}}} {{{.}}}
{{/vendorExtensions.x-py-other-imports}} {{/vendorExtensions.x-py-other-imports}}
@ -13,12 +10,7 @@ import re # noqa: F401
{{{.}}} {{{.}}}
{{/vendorExtensions.x-py-model-imports}} {{/vendorExtensions.x-py-model-imports}}
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal from typing_extensions import Literal, Self
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}] {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ANY_OF_SCHEMAS = [{{#anyOf}}"{{.}}"{{^-last}}, {{/-last}}{{/anyOf}}]

View File

@ -1,14 +1,9 @@
from __future__ import annotations from __future__ import annotations
import json import json
import pprint
import re # noqa: F401
from enum import Enum from enum import Enum
{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}} {{#vendorExtensions.x-py-other-imports}}
{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}} {{{.}}}
{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}} {{/vendorExtensions.x-py-other-imports}}
try:
from typing import Self
except ImportError:
from typing_extensions import Self from typing_extensions import Self

View File

@ -3,9 +3,6 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
{{#vendorExtensions.x-py-other-imports}} {{#vendorExtensions.x-py-other-imports}}
{{{.}}} {{{.}}}
{{/vendorExtensions.x-py-other-imports}} {{/vendorExtensions.x-py-other-imports}}

View File

@ -1,24 +1,15 @@
from __future__ import annotations from __future__ import annotations
from inspect import getfullargspec
import json import json
import pprint import pprint
import re # noqa: F401
{{#vendorExtensions.x-py-datetime-imports}}{{#-first}}from datetime import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-datetime-imports}}
{{#vendorExtensions.x-py-typing-imports}}{{#-first}}from typing import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-typing-imports}}
{{#vendorExtensions.x-py-pydantic-imports}}{{#-first}}from pydantic import{{/-first}} {{{.}}}{{^-last}},{{/-last}}{{/vendorExtensions.x-py-pydantic-imports}}
{{#vendorExtensions.x-py-other-imports}} {{#vendorExtensions.x-py-other-imports}}
{{{.}}} {{{.}}}
{{/vendorExtensions.x-py-other-imports}} {{/vendorExtensions.x-py-other-imports}}
{{#vendorExtensions.x-py-model-imports}} {{#vendorExtensions.x-py-model-imports}}
{{{.}}} {{{.}}}
{{/vendorExtensions.x-py-model-imports}} {{/vendorExtensions.x-py-model-imports}}
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal
from pydantic import StrictStr, Field from pydantic import StrictStr, Field
try: from typing import Union, List, Optional, Dict
from typing import Self from typing_extensions import Literal, Self
except ImportError:
from typing_extensions import Self
{{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}] {{#lambda.uppercase}}{{{classname}}}{{/lambda.uppercase}}_ONE_OF_SCHEMAS = [{{#oneOf}}"{{.}}"{{^-last}}, {{/-last}}{{/oneOf}}]

View File

@ -3,7 +3,6 @@
{{>partial_header}} {{>partial_header}}
import unittest import unittest
import datetime
{{#models}} {{#models}}
{{#model}} {{#model}}

View File

@ -6,7 +6,6 @@ from Crypto.Hash import SHA256, SHA512
from Crypto.PublicKey import RSA, ECC from Crypto.PublicKey import RSA, ECC
from Crypto.Signature import PKCS1_v1_5, pss, DSS from Crypto.Signature import PKCS1_v1_5, pss, DSS
from email.utils import formatdate from email.utils import formatdate
import json
import os import os
import re import re
from time import time from time import time

View File

@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th
```python ```python
import time
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -20,8 +20,6 @@ To test HTTP basic authentication
* Basic Authentication (http_auth): * Basic Authentication (http_auth):
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -96,8 +94,6 @@ To test HTTP bearer authentication
* Bearer Authentication (http_bearer_auth): * Bearer Authentication (http_bearer_auth):
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -26,8 +26,6 @@ Test binary (gif) response body
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -91,8 +89,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -160,8 +156,6 @@ Test array of binary in multipart mime
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -229,8 +223,6 @@ Test single binary in multipart mime
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -298,8 +290,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -368,8 +358,6 @@ Test free form object
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -437,8 +425,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -507,8 +493,6 @@ Test empty response body
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -577,8 +561,6 @@ Test empty json (request body)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -19,8 +19,6 @@ Test form parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -92,8 +90,6 @@ Test form parameter(s) for oneOf schema
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -18,8 +18,6 @@ Test header parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -18,8 +18,6 @@ Test path parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -25,8 +25,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -97,8 +95,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -170,8 +166,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -243,8 +237,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -313,8 +305,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -382,8 +372,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -452,8 +440,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -522,8 +508,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated

View File

@ -12,24 +12,18 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field from pydantic import Field, StrictBytes, StrictStr
from typing_extensions import Annotated
from pydantic import StrictBytes, StrictStr
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
@ -519,7 +513,7 @@ class BodyApi:
if body is not None: if body is not None:
# convert to byte array if the input is a file name (str) # convert to byte array if the input is a file name (str)
if isinstance(body, str): if isinstance(body, str):
with io.open(body, "rb") as _fp: with open(body, "rb") as _fp:
_body_params = _fp.read() _body_params = _fp.read()
else: else:
_body_params = body _body_params = body

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,10 +22,8 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr from pydantic import StrictBool, StrictInt, StrictStr
from typing import Optional from typing import Optional
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient
from openapi_client.api_response import ApiResponse from openapi_client.api_response import ApiResponse
from openapi_client.rest import RESTResponseType from openapi_client.rest import RESTResponseType

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,9 +22,7 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr, field_validator from pydantic import StrictBool, StrictInt, StrictStr, field_validator
from typing import Optional from typing import Optional
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,7 +22,6 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictInt, StrictStr, field_validator from pydantic import StrictInt, StrictStr, field_validator
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,11 +22,8 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from datetime import date, datetime from datetime import date, datetime
from pydantic import StrictBool, StrictInt, StrictStr, field_validator from pydantic import StrictBool, StrictInt, StrictStr, field_validator
from typing import Any, Optional from typing import Any, Optional
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@ -13,7 +13,6 @@
""" # noqa: E501 """ # noqa: E501
import atexit
import datetime import datetime
from dateutil.parser import parse from dateutil.parser import parse
import json import json

View File

@ -1,7 +1,7 @@
"""API response object.""" """API response object."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Optional, Generic, TypeVar from typing import Dict, Optional, Generic, TypeVar
from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel
T = TypeVar("T") T = TypeVar("T")

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -19,9 +19,8 @@ import re # noqa: F401
import json import json
from datetime import datetime from datetime import datetime
from pydantic import Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import StrictStr
from pydantic import Field
from openapi_client.models.query import Query from openapi_client.models.query import Query
try: try:
from typing import Self from typing import Self

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
try: try:
from typing import Self from typing import Self

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictFloat, StrictInt
from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Any, ClassVar, Dict, List, Optional, Union
from pydantic import BaseModel, StrictFloat, StrictInt
from pydantic import Field
from typing_extensions import Annotated from typing_extensions import Annotated
try: try:
from typing import Self from typing import Self

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from pydantic import Field
from openapi_client.models.category import Category from openapi_client.models.category import Category
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
try: try:

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -15,15 +15,7 @@
from __future__ import annotations from __future__ import annotations
import json import json
import pprint
import re # noqa: F401
from enum import Enum from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self from typing_extensions import Self

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th
```python ```python
import time
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -20,8 +20,6 @@ To test HTTP basic authentication
* Basic Authentication (http_auth): * Basic Authentication (http_auth):
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -96,8 +94,6 @@ To test HTTP bearer authentication
* Bearer Authentication (http_bearer_auth): * Bearer Authentication (http_bearer_auth):
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -26,8 +26,6 @@ Test binary (gif) response body
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -91,8 +89,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -160,8 +156,6 @@ Test array of binary in multipart mime
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -229,8 +223,6 @@ Test single binary in multipart mime
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -298,8 +290,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -368,8 +358,6 @@ Test free form object
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -437,8 +425,6 @@ Test body parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -507,8 +493,6 @@ Test empty response body
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -577,8 +561,6 @@ Test empty json (request body)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -19,8 +19,6 @@ Test form parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -92,8 +90,6 @@ Test form parameter(s) for oneOf schema
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -18,8 +18,6 @@ Test header parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -18,8 +18,6 @@ Test path parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException

View File

@ -25,8 +25,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -97,8 +95,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -170,8 +166,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -243,8 +237,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -313,8 +305,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint
@ -382,8 +372,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -452,8 +440,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
@ -522,8 +508,6 @@ Test query parameter(s)
```python ```python
import time
import os
import openapi_client import openapi_client
from openapi_client.rest import ApiException from openapi_client.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated

View File

@ -12,24 +12,18 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field from pydantic import Field, StrictBytes, StrictStr
from typing_extensions import Annotated
from pydantic import StrictBytes, StrictStr
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
@ -519,7 +513,7 @@ class BodyApi:
if body is not None: if body is not None:
# convert to byte array if the input is a file name (str) # convert to byte array if the input is a file name (str)
if isinstance(body, str): if isinstance(body, str):
with io.open(body, "rb") as _fp: with open(body, "rb") as _fp:
_body_params = _fp.read() _body_params = _fp.read()
else: else:
_body_params = body _body_params = body

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,10 +22,8 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr from pydantic import StrictBool, StrictInt, StrictStr
from typing import Optional from typing import Optional
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient
from openapi_client.api_response import ApiResponse from openapi_client.api_response import ApiResponse
from openapi_client.rest import RESTResponseType from openapi_client.rest import RESTResponseType

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,9 +22,7 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictBool, StrictInt, StrictStr, field_validator from pydantic import StrictBool, StrictInt, StrictStr, field_validator
from typing import Optional from typing import Optional
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,7 +22,6 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictInt, StrictStr, field_validator from pydantic import StrictInt, StrictStr, field_validator
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.api_client import ApiClient from openapi_client.api_client import ApiClient

View File

@ -12,12 +12,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
@ -25,11 +22,8 @@ except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from datetime import date, datetime from datetime import date, datetime
from pydantic import StrictBool, StrictInt, StrictStr, field_validator from pydantic import StrictBool, StrictInt, StrictStr, field_validator
from typing import Any, Optional from typing import Any, Optional
from openapi_client.models.pet import Pet from openapi_client.models.pet import Pet
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from openapi_client.models.test_query_style_form_explode_true_array_string_query_object_parameter import TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter

View File

@ -13,7 +13,6 @@
""" # noqa: E501 """ # noqa: E501
import atexit
import datetime import datetime
from dateutil.parser import parse from dateutil.parser import parse
import json import json

View File

@ -1,7 +1,7 @@
"""API response object.""" """API response object."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Optional, Generic, TypeVar from typing import Dict, Optional, Generic, TypeVar
from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel
T = TypeVar("T") T = TypeVar("T")

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -19,9 +19,8 @@ import re # noqa: F401
import json import json
from datetime import datetime from datetime import datetime
from pydantic import Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import StrictStr
from pydantic import Field
from openapi_client.models.query import Query from openapi_client.models.query import Query
try: try:
from typing import Self from typing import Self

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from openapi_client.models.string_enum_ref import StringEnumRef from openapi_client.models.string_enum_ref import StringEnumRef
try: try:
from typing import Self from typing import Self

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictFloat, StrictInt
from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Any, ClassVar, Dict, List, Optional, Union
from pydantic import BaseModel, StrictFloat, StrictInt
from pydantic import Field
from typing_extensions import Annotated from typing_extensions import Annotated
try: try:
from typing import Self from typing import Self

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from pydantic import Field
from openapi_client.models.category import Category from openapi_client.models.category import Category
from openapi_client.models.tag import Tag from openapi_client.models.tag import Tag
try: try:

View File

@ -18,10 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr, field_validator
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -15,15 +15,7 @@
from __future__ import annotations from __future__ import annotations
import json import json
import pprint
import re # noqa: F401
from enum import Enum from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self from typing_extensions import Self

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -18,9 +18,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -50,7 +50,6 @@ Please follow the [installation procedure](#installation--usage) and then run th
```python ```python
import datetime import datetime
import time
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -18,8 +18,6 @@ To test special tags and operation ID starting with number
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.client import Client from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -16,8 +16,6 @@ Method | HTTP request | Description
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.foo_get_default_response import FooGetDefaultResponse from petstore_api.models.foo_get_default_response import FooGetDefaultResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -40,8 +40,6 @@ test any type request body
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -105,8 +103,6 @@ test enum reference query parameter
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_class import EnumClass
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -171,8 +167,6 @@ Health check endpoint
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.health_check_result import HealthCheckResult from petstore_api.models.health_check_result import HealthCheckResult
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -235,8 +229,6 @@ test http signature authentication
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -374,8 +366,6 @@ Test serialization of outer boolean types
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -442,8 +432,6 @@ Test serialization of object with outer number type
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.outer_composite import OuterComposite from petstore_api.models.outer_composite import OuterComposite
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -511,8 +499,6 @@ Test serialization of outer number types
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -579,8 +565,6 @@ Test serialization of outer string types
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -647,8 +631,6 @@ Test serialization of enum (int) properties with examples
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty from petstore_api.models.outer_object_with_enum_property import OuterObjectWithEnumProperty
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -714,8 +696,6 @@ test ref to enum string
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_class import EnumClass
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -778,8 +758,6 @@ test returning list of objects
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.tag import Tag from petstore_api.models.tag import Tag
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -842,8 +820,6 @@ test uuid example
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -909,8 +885,6 @@ For this test, the body has to be a binary file.
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -975,8 +949,6 @@ For this test, the body for this request must reference a schema named `File`.
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.file_schema_test_class import FileSchemaTestClass from petstore_api.models.file_schema_test_class import FileSchemaTestClass
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -1040,8 +1012,6 @@ No authorization required
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -1109,8 +1079,6 @@ To test \"client\" model
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.client import Client from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -1177,8 +1145,6 @@ No authorization required
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1245,8 +1211,6 @@ test empty and non-empty responses
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1310,8 +1274,6 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
* Basic Authentication (http_basic_test): * Basic Authentication (http_basic_test):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1414,8 +1376,6 @@ test error responses with model
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1480,8 +1440,6 @@ Fake endpoint to test group parameters (optional)
* Bearer (JWT) Authentication (bearer_test): * Bearer (JWT) Authentication (bearer_test):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1566,8 +1524,6 @@ test inline additionalProperties
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1633,8 +1589,6 @@ test inline free-form additionalProperties
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest from petstore_api.models.test_inline_freeform_additional_properties_request import TestInlineFreeformAdditionalPropertiesRequest
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -1701,8 +1655,6 @@ test json serialization of form data
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -1770,8 +1722,6 @@ To test the collection format in query parameters
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint

View File

@ -19,8 +19,6 @@ To test class name in snake case
* Api Key Authentication (api_key_query): * Api Key Authentication (api_key_query):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.client import Client from petstore_api.models.client import Client
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -27,8 +27,6 @@ Add a new pet to the store
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -166,8 +164,6 @@ Deletes a pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -243,8 +239,6 @@ Multiple status values can be provided with comma separated strings
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -384,8 +378,6 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -525,8 +517,6 @@ Returns a single pet
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -608,8 +598,6 @@ Update an existing pet
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -749,8 +737,6 @@ Updates a pet in the store with form data
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -828,8 +814,6 @@ uploads an image
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -909,8 +893,6 @@ uploads an image (required)
* OAuth Authentication (petstore_auth): * OAuth Authentication (petstore_auth):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.api_response import ApiResponse from petstore_api.models.api_response import ApiResponse
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -21,8 +21,6 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -90,8 +88,6 @@ Returns a map of status codes to quantities
* Api Key Authentication (api_key): * Api Key Authentication (api_key):
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -165,8 +161,6 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.order import Order from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -237,8 +231,6 @@ Place an order for a pet
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.order import Order from petstore_api.models.order import Order
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -25,8 +25,6 @@ This can only be done by the logged in user.
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -93,8 +91,6 @@ Creates list of users with given input array
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -161,8 +157,6 @@ Creates list of users with given input array
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -229,8 +223,6 @@ This can only be done by the logged in user.
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -297,8 +289,6 @@ Get user by user name
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
@ -369,8 +359,6 @@ Logs user into the system
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -441,8 +429,6 @@ Logs out current logged in user session
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.rest import ApiException from petstore_api.rest import ApiException
from pprint import pprint from pprint import pprint
@ -504,8 +490,6 @@ This can only be done by the logged in user.
```python ```python
import time
import os
import petstore_api import petstore_api
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.rest import ApiException from petstore_api.rest import ApiException

View File

@ -11,12 +11,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated

View File

@ -11,12 +11,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated

View File

@ -11,26 +11,19 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field
from typing_extensions import Annotated
from datetime import date, datetime from datetime import date, datetime
from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator
from pydantic import StrictBool, StrictBytes, StrictInt, StrictStr, field_validator
from typing import Any, Dict, List, Optional, Union from typing import Any, Dict, List, Optional, Union
from typing_extensions import Annotated
from petstore_api.models.client import Client from petstore_api.models.client import Client
from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_class import EnumClass
from petstore_api.models.file_schema_test_class import FileSchemaTestClass from petstore_api.models.file_schema_test_class import FileSchemaTestClass
@ -3409,7 +3402,7 @@ class FakeApi:
if body is not None: if body is not None:
# convert to byte array if the input is a file name (str) # convert to byte array if the input is a file name (str)
if isinstance(body, str): if isinstance(body, str):
with io.open(body, "rb") as _fp: with open(body, "rb") as _fp:
_body_params = _fp.read() _body_params = _fp.read()
else: else:
_body_params = body _body_params = body

View File

@ -11,12 +11,9 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated

View File

@ -11,24 +11,18 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field from pydantic import Field, StrictBytes, StrictInt, StrictStr, field_validator
from typing_extensions import Annotated
from pydantic import StrictBytes, StrictInt, StrictStr, field_validator
from typing import List, Optional, Union from typing import List, Optional, Union
from typing_extensions import Annotated
from petstore_api.models.api_response import ApiResponse from petstore_api.models.api_response import ApiResponse
from petstore_api.models.pet import Pet from petstore_api.models.pet import Pet

View File

@ -11,24 +11,17 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field from pydantic import Field, StrictStr
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import StrictStr
from typing import Dict
from petstore_api.models.order import Order from petstore_api.models.order import Order
from petstore_api.api_client import ApiClient from petstore_api.api_client import ApiClient

View File

@ -11,24 +11,18 @@
Do not edit the class manually. Do not edit the class manually.
""" # noqa: E501 """ # noqa: E501
import io
import warnings import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Any, Dict, List, Optional, Tuple, Union
try: try:
from typing import Annotated from typing import Annotated
except ImportError: except ImportError:
from typing_extensions import Annotated from typing_extensions import Annotated
from pydantic import Field from pydantic import Field, StrictStr
from typing_extensions import Annotated
from pydantic import StrictStr
from typing import List from typing import List
from typing_extensions import Annotated
from petstore_api.models.user import User from petstore_api.models.user import User
from petstore_api.api_client import ApiClient from petstore_api.api_client import ApiClient

View File

@ -12,7 +12,6 @@
""" # noqa: E501 """ # noqa: E501
import atexit
import datetime import datetime
from dateutil.parser import parse from dateutil.parser import parse
import json import json

View File

@ -1,7 +1,7 @@
"""API response object.""" """API response object."""
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Optional, Generic, TypeVar from typing import Dict, Optional, Generic, TypeVar
from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel
T = TypeVar("T") T = TypeVar("T")

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr from pydantic import BaseModel, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
from petstore_api.models.single_ref_type import SingleRefType from petstore_api.models.single_ref_type import SingleRefType
try: try:
from typing import Self from typing import Self

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Any, ClassVar, Dict, List, Optional, Union
from pydantic import BaseModel, StrictStr
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,18 +17,11 @@ from inspect import getfullargspec
import json import json
import pprint import pprint
import re # noqa: F401 import re # noqa: F401
from typing import List, Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
from pydantic import Field from typing import List, Optional
from typing_extensions import Annotated from typing_extensions import Annotated
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal from typing_extensions import Literal, Self
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"] ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"]

View File

@ -17,18 +17,12 @@ from inspect import getfullargspec
import json import json
import pprint import pprint
import re # noqa: F401 import re # noqa: F401
from typing import Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
from typing import Optional
from petstore_api.models.basque_pig import BasquePig from petstore_api.models.basque_pig import BasquePig
from petstore_api.models.danish_pig import DanishPig from petstore_api.models.danish_pig import DanishPig
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal from typing_extensions import Literal, Self
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"] ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"]

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel from pydantic import BaseModel
from typing import Any, ClassVar, Dict, List, Optional
from petstore_api.models.tag import Tag from petstore_api.models.tag import Tag
try: try:
from typing import Self from typing import Self

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr
from pydantic import Field
from typing_extensions import Annotated from typing_extensions import Annotated
from petstore_api.models.read_only_first import ReadOnlyFirst from petstore_api.models.read_only_first import ReadOnlyFirst
try: try:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictStr
from typing import Any, ClassVar, Dict, List from typing import Any, ClassVar, Dict, List
from pydantic import BaseModel, StrictStr
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import StrictBool from pydantic import StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from petstore_api.models.animal import Animal from petstore_api.models.animal import Animal
try: try:
from typing import Self from typing import Self

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr from pydantic import BaseModel, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,9 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt from pydantic import BaseModel, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

View File

@ -17,10 +17,8 @@ import pprint
import re # noqa: F401 import re # noqa: F401
import json import json
from pydantic import BaseModel, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try: try:
from typing import Self from typing import Self
except ImportError: except ImportError:

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