diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java index b2b3a53092a..4906edb8312 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/DefaultCodegen.java @@ -430,6 +430,8 @@ public void processOpts() { this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); } + requiredAddPropUnsetSchema = fromSchema(new Schema(), null, null); + } /*** @@ -1560,7 +1562,7 @@ public String toModelName(final String name, String jsonPath) { Map codegenParameterCache = new HashMap<>(); HashMap> sourceJsonPathToKeyToQty = new HashMap<>(); Map codegenTagCache = new HashMap<>(); - private final CodegenSchema requiredAddPropUnsetSchema = fromSchema(new Schema(), null, null); + private CodegenSchema requiredAddPropUnsetSchema = null; protected void updateModelForComposedSchema(CodegenSchema m, Schema schema, String sourceJsonPath) { final ComposedSchema composed = (ComposedSchema) schema; @@ -2265,6 +2267,8 @@ public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJ setSchemaLocationInfo(null, sourceJsonPath, currentJsonPath, property); HashMap requiredAndOptionalProperties = new HashMap<>(); property.properties = getProperties(((Schema) p).getProperties(), sourceJsonPath, currentJsonPath, requiredAndOptionalProperties); + LinkedHashSet required = p.getRequired() == null ? new LinkedHashSet<>() + : new LinkedHashSet<>(((Schema) p).getRequired()); List oneOfs = ((Schema) p).getOneOf(); if (oneOfs != null && !oneOfs.isEmpty()) { property.oneOf = getComposedProperties(oneOfs, "oneOf", sourceJsonPath, currentJsonPath); @@ -2286,6 +2290,21 @@ public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJ property.allOf = getComposedProperties(allOfs, "allOf", sourceJsonPath, currentJsonPath); } property.additionalProperties = getAdditionalProperties(p, sourceJsonPath, currentJsonPath); + // ideally requiredProperties would come before properties + property.requiredProperties = getRequiredProperties(required, property.properties, property.additionalProperties, requiredAndOptionalProperties, sourceJsonPath, ((Schema) p).getProperties()); + property.optionalProperties = getOptionalProperties(property.properties, required, sourceJsonPath); + if ((property.types == null || property.types.contains("object")) && sourceJsonPath != null) { + // only set mapInputJsonPathPiece when object input is possible + if (property.requiredProperties != null && property.optionalProperties == null) { + property.mapInputJsonPathPiece = property.requiredProperties.jsonPathPiece(); + } else if (property.requiredProperties == null && property.optionalProperties != null) { + property.mapInputJsonPathPiece = property.optionalProperties.jsonPathPiece(); + } else if (property.requiredProperties != null && property.optionalProperties != null) { + property.mapInputJsonPathPiece = getKey("DictInput", "schemaProperty", sourceJsonPath); + } else { + property.mapInputJsonPathPiece = getKey("DictInput", "schemaProperty", sourceJsonPath); + } + } // end of properties that need to be ordered to set correct camelCase jsonPathPieces if (currentJsonPath != null) { @@ -2352,10 +2371,6 @@ public CodegenSchema fromSchema(Schema p, String sourceJsonPath, String currentJ } } property.patternInfo = getPatternInfo(p.getPattern()); - LinkedHashSet required = p.getRequired() == null ? new LinkedHashSet<>() - : new LinkedHashSet<>(((Schema) p).getRequired()); - property.optionalProperties = getOptionalProperties(property.properties, required); - property.requiredProperties = getRequiredProperties(required, property.properties, property.additionalProperties, requiredAndOptionalProperties); property.example = toExampleValue(p); if (addSchemaImportsFromV3SpecLocations && sourceJsonPath != null && sourceJsonPath.equals(currentJsonPath)) { @@ -3295,26 +3310,41 @@ protected LinkedHashMapWithContext getProperties(Map< * @param required a set of required properties' name * @return the optional properties */ - protected LinkedHashMap getOptionalProperties(LinkedHashMap properties, Set required) { + protected LinkedHashMapWithContext getOptionalProperties(LinkedHashMapWithContext properties, Set required, String sourceJsonPath) { if (properties == null) { return null; } - if (required.size() == properties.size()) { - return null; - } if (required.isEmpty()) { - return properties; + // all properties optional and there is no required + LinkedHashMapWithContext optionalProperties = new LinkedHashMapWithContext<>(); + optionalProperties.putAll(properties); + optionalProperties.setAllAreInline(properties.allAreInline()); + CodegenKey jsonPathPiece = getKey("DictInput", "schemaProperty", sourceJsonPath); + optionalProperties.setJsonPathPiece(jsonPathPiece); + return optionalProperties; } - LinkedHashMap optionalProperties = new LinkedHashMap<>(); + // required exists and it can come from addProps or props + LinkedHashMapWithContext optionalProperties = new LinkedHashMapWithContext<>(); + boolean allAreInline = true; for (Map.Entry entry : properties.entrySet()) { final CodegenKey key = entry.getKey(); if (required.contains(key.original)) { continue; } final CodegenSchema prop = entry.getValue(); + if (prop.refInfo != null) { + allAreInline = false; + } optionalProperties.put(key, prop); } + if (optionalProperties.isEmpty()) { + // no optional props, all required properties came from props + return null; + } + optionalProperties.setAllAreInline(allAreInline); + CodegenKey jsonPathPiece = getKey("OptionalDictInput", "schemaProperty", sourceJsonPath); + optionalProperties.setJsonPathPiece(jsonPathPiece); return optionalProperties; } @@ -4280,8 +4310,8 @@ public CodegenRequestBody fromRequestBody(RequestBody requestBody, String source } @Override - public CodegenKey getKey(String key, String expectedComponentType) { - return getKey(key, expectedComponentType, null); + public CodegenKey getKey(String key, String keyType) { + return getKey(key, keyType, null); } public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { @@ -4299,9 +4329,13 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { if (!sourceJsonPathToKeyToQty.containsKey(sourceJsonPath)) { sourceJsonPathToKeyToQty.put(sourceJsonPath, keyToQty); } - Integer qty = keyToQty.getOrDefault(usedKey, 0); + /* + saw use case with component named Client and nested property named client + lowercase to ensure they increment the same key + */ + Integer qty = keyToQty.getOrDefault(usedKey.toLowerCase(Locale.ROOT), 0); qty += 1; - keyToQty.put(usedKey, qty); + keyToQty.put(usedKey.toLowerCase(Locale.ROOT), qty); if (qty > 1) { suffix = qty.toString(); } @@ -4352,18 +4386,31 @@ public CodegenKey getKey(String key, String keyType, String sourceJsonPath) { ); } - protected LinkedHashMap getRequiredProperties(LinkedHashSet required, LinkedHashMap properties, CodegenSchema additionalProperties, HashMap requiredAndOptionalProperties) { + protected LinkedHashMapWithContext getRequiredProperties(LinkedHashSet required, LinkedHashMap properties, CodegenSchema additionalProperties, HashMap requiredAndOptionalProperties, String sourceJsonPath, Map schemaProperties) { if (required.isEmpty()) { return null; } /* + requiredProperties use cases: + - no required properties: null or empty list + - requiredProperties + optionalProperties (properties must exist) + - requiredProperties + no optionalProperties + - 1. requiredPropsWithDefAllFromProp - required all come from properties + - 2. requiredPropsWithDefAllFromAddProp - required all come from addProp and there is no properties + - 3. required consume all properties and remainder from addProps this should be called after vars and additionalProperties are set Features added by storing codegenProperty values: - refClass stores reference to additionalProperties definition - baseName stores original name (can be invalid in a programming language) - nameInSnakeCase can store valid name for a programming language */ - LinkedHashMap requiredProperties = new LinkedHashMap<>(); + boolean requiredPropsWithDefAllFromProp = true; + boolean requiredPropsWithDefAllFromAddProp = true; + int propReqProps = 0; + int addPropReqProps = 0; + int reqPropsWithDef = 0; + LinkedHashMapWithContext requiredProperties = new LinkedHashMapWithContext<>(); + boolean allAreInline = true; for (String requiredPropertyName: required) { // required property is defined in properties, value is that CodegenSchema if (properties != null && requiredAndOptionalProperties.containsKey(requiredPropertyName)) { @@ -4371,19 +4418,29 @@ protected LinkedHashMap getRequiredProperties(LinkedH // get cp from property CodegenSchema prop = properties.get(key); if (prop != null) { + requiredPropsWithDefAllFromAddProp = false; requiredProperties.put(key, prop); + reqPropsWithDef++; + propReqProps++; + if (prop.refInfo != null) { + allAreInline = false; + } } else { throw new RuntimeException("Property " + requiredPropertyName + " is missing from getVars"); } } else if (additionalProperties != null && additionalProperties.isBooleanSchemaFalse) { // required property is not defined in properties, and additionalProperties is false, value is null - CodegenKey key = getKey(requiredPropertyName, "schemas"); + // no schema definition: error use case? + CodegenKey key = getKey(requiredPropertyName, "schemas", null); requiredProperties.put(key, null); requiredAndOptionalProperties.put(requiredPropertyName, key); } else { // required property is not defined in properties if (supportsAdditionalPropertiesWithComposedSchema && !disallowAdditionalPropertiesIfNotPresent) { CodegenSchema prop; + requiredPropsWithDefAllFromProp = false; + reqPropsWithDef++; + addPropReqProps++; if (additionalProperties == null) { // additionalProperties is null // there is NO schema definition for this so the json paths are null @@ -4394,13 +4451,28 @@ protected LinkedHashMap getRequiredProperties(LinkedH } else { // additionalProperties is schema prop = additionalProperties; + if (prop.refInfo != null) { + allAreInline = false; + } } - CodegenKey key = getKey(requiredPropertyName, "schemas"); + CodegenKey key = getKey(requiredPropertyName, "schemas", sourceJsonPath); requiredProperties.put(key, prop); requiredAndOptionalProperties.put(requiredPropertyName, key); } } } + String keyName; + boolean onlyReqPropsCase1 = (requiredPropsWithDefAllFromProp && properties != null && requiredProperties.size() == properties.size()); + boolean onlyReqPropsCase2 = (requiredPropsWithDefAllFromAddProp && properties == null); + boolean onlyReqPropsCase3 = (propReqProps != 0 && addPropReqProps != 0 && propReqProps + addPropReqProps == reqPropsWithDef && schemaProperties != null && required.containsAll(schemaProperties.keySet())); + if (onlyReqPropsCase1 || onlyReqPropsCase2 || onlyReqPropsCase3) { + keyName = "DictInput"; + } else { + keyName = "RequiredDictInput"; + } + requiredProperties.setAllAreInline(allAreInline); + CodegenKey jsonPathPiece = getKey(keyName, "schemaProperty", sourceJsonPath); + requiredProperties.setJsonPathPiece(jsonPathPiece); return requiredProperties; } @@ -4783,7 +4855,7 @@ private ArrayListWithContext getComposedProperties(List x i += 1; } xOf.setAllAreInline(allAreInline); - CodegenKey jsonPathPiece = getKey(collectionName, "schemaProperty"); + CodegenKey jsonPathPiece = getKey(collectionName, "schemaProperty", sourceJsonPath); xOf.setJsonPathPiece(jsonPathPiece); return xOf; } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java index f789a687c0d..991790364b0 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java @@ -1285,6 +1285,10 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o if (modelName != null) { openChars = modelName + "("; closeChars = ")"; + if (ModelUtils.isTypeObjectSchema(schema)) { + openChars = openChars + "{"; + closeChars = "}" + closeChars; + } } String fullPrefix = currentIndentation + prefix + openChars; @@ -1361,7 +1365,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o String schemaName = getSchemaName(mm.modelName); Schema modelSchema = getModelNameToSchemaCache().get(schemaName); CodegenSchema cp = new CodegenSchema(); - cp.jsonPathPiece = getKey(disc.propertyName.original, "misc"); + cp.jsonPathPiece = getKey(disc.propertyName.original, "misc", null); cp.example = discPropNameValue; return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); } @@ -1483,8 +1487,8 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o } } else if (ModelUtils.isTypeObjectSchema(schema)) { if (modelName == null) { - fullPrefix += "dict("; - closeChars = ")"; + fullPrefix += "{"; + closeChars = "}"; } if (cycleFound) { return fullPrefix + closeChars; @@ -1528,7 +1532,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o String schemaName = getSchemaName(mm.modelName); Schema modelSchema = getModelNameToSchemaCache().get(schemaName); CodegenSchema cp = new CodegenSchema(); - cp.jsonPathPiece = getKey(disc.propertyName.original, "misc"); + cp.jsonPathPiece = getKey(disc.propertyName.original, "misc", null); cp.example = discPropNameValue; return exampleForObjectModel(modelSchema, fullPrefix, closeChars, cp, indentationLevel, exampleLine, closingIndentation, includedSchemas); } @@ -1544,10 +1548,7 @@ private String toExampleValueRecursive(String modelName, Schema schema, Object o key = addPropsSchema.getEnum().get(0).toString(); } addPropsExample = exampleFromStringOrArraySchema(addPropsSchema, addPropsExample, key); - String addPropPrefix = key + "="; - if (modelName == null) { - addPropPrefix = ensureQuotes(key) + ": "; - } + String addPropPrefix = ensureQuotes(key) + ": "; String addPropsModelName = getRefClassWithRefModule(addPropsSchema); if(includedSchemas.contains(schema)) { return ""; @@ -1602,7 +1603,7 @@ private String exampleForObjectModel(Schema schema, String fullPrefix, String cl propSchema, propExample, indentationLevel + 1, - propName + "=", + "\"" + propName + "\": ", exampleLine + 1, includedSchemas)).append(",\n"); } diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java index 73abe3441cd..be612923129 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/CodegenSchema.java @@ -44,7 +44,7 @@ public class CodegenSchema { public Boolean uniqueItems; public Integer maxProperties; public Integer minProperties; - public LinkedHashMap requiredProperties; // used to store required info + public LinkedHashMapWithContext requiredProperties; // used to store required info public LinkedHashMap enumValueToName; // enum info public String type; public ArrayListWithContext allOf = null; @@ -84,7 +84,8 @@ public class CodegenSchema { public TreeSet imports; public CodegenKey jsonPathPiece; public String unescapedDescription; - public LinkedHashMap optionalProperties; + public LinkedHashMapWithContext optionalProperties; + public CodegenKey mapInputJsonPathPiece; public boolean schemaIsFromAdditionalProperties; public HashMap testCases = new HashMap<>(); /** @@ -221,6 +222,63 @@ private void getAllSchemas(ArrayList schemasBeforeImports, ArrayL schemasAfterImports.add(extraSchema); } } + boolean additionalPropertiesIsBooleanSchemaFalse = (additionalProperties != null && additionalProperties.isBooleanSchemaFalse); + boolean typedDictUseCase = (requiredProperties != null && additionalPropertiesIsBooleanSchemaFalse); + boolean mappingUseCase = (requiredProperties != null && !additionalPropertiesIsBooleanSchemaFalse && optionalProperties == null); + if (typedDictUseCase || mappingUseCase) { + CodegenSchema extraSchema = new CodegenSchema(); + extraSchema.instanceType = "requiredPropertiesInputType"; + extraSchema.requiredProperties = requiredProperties; + extraSchema.additionalProperties = additionalProperties; + if (requiredProperties.allAreInline()) { + schemasBeforeImports.add(extraSchema); + } else { + schemasAfterImports.add(extraSchema); + } + } + typedDictUseCase = (optionalProperties != null && additionalPropertiesIsBooleanSchemaFalse); + mappingUseCase = (optionalProperties != null && !additionalPropertiesIsBooleanSchemaFalse && requiredProperties == null); + if (typedDictUseCase || mappingUseCase) { + CodegenSchema extraSchema = new CodegenSchema(); + extraSchema.instanceType = "optionalPropertiesInputType"; + extraSchema.optionalProperties = optionalProperties; + extraSchema.additionalProperties = additionalProperties; + if (optionalProperties.allAreInline()) { + schemasBeforeImports.add(extraSchema); + } else { + schemasAfterImports.add(extraSchema); + } + } + boolean requiredPropsAndOptionalPropsSet = (requiredProperties != null && optionalProperties != null); + boolean requiredPropsAndOptionalPropsUnset = (requiredProperties == null && optionalProperties == null); + if ((requiredPropsAndOptionalPropsSet || requiredPropsAndOptionalPropsUnset) && mapInputJsonPathPiece != null) { + CodegenSchema extraSchema = new CodegenSchema(); + extraSchema.instanceType = "propertiesInputType"; + extraSchema.optionalProperties = optionalProperties; + extraSchema.requiredProperties = requiredProperties; + extraSchema.mapInputJsonPathPiece = mapInputJsonPathPiece; + extraSchema.additionalProperties = additionalProperties; + boolean allAreInline; + if (requiredPropsAndOptionalPropsSet) { + if (additionalProperties == null) { + allAreInline = (requiredProperties.allAreInline() && optionalProperties.allAreInline()); + } else { + allAreInline = (requiredProperties.allAreInline() && optionalProperties.allAreInline() && additionalProperties.refInfo == null); + } + } else { + if (additionalProperties == null) { + allAreInline = true; + } else { + allAreInline = additionalProperties.refInfo == null; + } + } + if (allAreInline) { + schemasBeforeImports.add(extraSchema); + } else { + schemasAfterImports.add(extraSchema); + } + } + if (refInfo != null && level > 0) { // do not add ref to schemas return; diff --git a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/LinkedHashMapWithContext.java b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/LinkedHashMapWithContext.java index 2fe794d2bb8..b088b8674ec 100644 --- a/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/LinkedHashMapWithContext.java +++ b/modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/model/LinkedHashMapWithContext.java @@ -5,6 +5,7 @@ public class LinkedHashMapWithContext extends LinkedHashMap implements InlineContext { private boolean internalallAreInline = false; private CodegenKey internalJsonPathPiece = null; + public boolean allAreInline() { return internalallAreInline; } diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_type_newline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_type_newline.hbs new file mode 100644 index 00000000000..74d4781b585 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_type_newline.hbs @@ -0,0 +1,51 @@ +{{#eq this "array"}} +list, +tuple{{#unless @last}},{{/unless}} +{{/eq}} +{{#eq this "object"}} +dict, +frozendict.frozendict{{#unless @last}},{{/unless}} +{{/eq}} +{{#eq this "null"}} +None{{#unless @last}},{{/unless}} +{{/eq}} +{{#eq this "string" }} + {{#eq ../format null}} +str{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "date"}} +str, +datetime.date{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "date-time"}} +str, +datetime.datetime{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "uuid"}} +str, +uuid.UUID{{#unless @last}},{{/unless}} + {{else}} + {{#eq ../format "binary"}} +bytes, +io.FileIO, +io.BufferedReader{{#unless @last}},{{/unless}} + {{else}} +str{{#unless @last}},{{/unless}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} + {{/eq}} +{{/eq}} +{{#eq this "integer"}} +decimal.Decimal, +int{{#unless @last}},{{/unless}} +{{/eq}} +{{#eq this "number"}} +decimal.Decimal, +int, +float{{#unless @last}},{{/unless}} +{{/eq}} +{{#eq this "boolean"}} +bool{{#unless @last}},{{/unless}} +{{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs index 0f9b18b8eae..e20ba5bf4dd 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/_helper_schema_python_types_newline.hbs @@ -17,56 +17,6 @@ io.FileIO, io.BufferedReader {{else}} {{#each types}} - {{#eq this "array"}} -list, -tuple{{#unless @last}},{{/unless}} - {{/eq}} - {{#eq this "object"}} -dict, -frozendict.frozendict{{#unless @last}},{{/unless}} - {{/eq}} - {{#eq this "null"}} -None{{#unless @last}},{{/unless}} - {{/eq}} - {{#eq this "string" }} - {{#eq ../format null}} -str{{#unless @last}},{{/unless}} - {{else}} - {{#eq ../format "date"}} -str, -datetime.date{{#unless @last}},{{/unless}} - {{else}} - {{#eq ../format "date-time"}} -str, -datetime.datetime{{#unless @last}},{{/unless}} - {{else}} - {{#eq ../format "uuid"}} -str, -uuid.UUID{{#unless @last}},{{/unless}} - {{else}} - {{#eq ../format "binary"}} -bytes, -io.FileIO, -io.BufferedReader{{#unless @last}},{{/unless}} - {{else}} -str{{#unless @last}},{{/unless}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{/eq}} - {{#eq this "integer"}} -decimal.Decimal, -int{{#unless @last}},{{/unless}} - {{/eq}} - {{#eq this "number"}} -decimal.Decimal, -int, -float{{#unless @last}},{{/unless}} - {{/eq}} - {{#eq this "boolean"}} -bool{{#unless @last}},{{/unless}} - {{/eq}} +{{> _helper_schema_python_type_newline }} {{/each}} {{/eq}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs index 097dd580ea9..c253ccb0e5f 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/api_client.hbs @@ -717,13 +717,13 @@ class __HeaderParameterBase(ParameterBase, StyleSimpleSerializer): """ if cls.style: extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) - return cls.schema.from_openapi_data_(extracted_data) + return cls.schema(extracted_data) assert cls.content is not None for content_type, media_type in cls.content.items(): if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) assert media_type.schema is not None - return media_type.schema.from_openapi_data_(cast_in_data) + return media_type.schema(cast_in_data) else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) raise ValueError('Invalid value for content, it was empty and must have 1 key value pair') @@ -938,8 +938,12 @@ class OpenApiResponse(JSONDetector, TypedDictInputVerifier, typing.Generic[T]): content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_( - body_data, configuration_=configuration) + body_schema = schemas._get_class(body_schema) + if body_schema is schemas.BinarySchema: + deserialized_body = body_schema(body_data) + else: + deserialized_body = body_schema( + body_data, configuration=configuration) elif streamed: response.release_conn() @@ -1408,8 +1412,6 @@ class RequestBody(StyleFormSerializer, JSONDetector): schema = schemas._get_class(media_type.schema) if isinstance(in_data, schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = schema(**in_data) else: cast_in_data = schema(in_data) # TODO check for and use encoding if it exists diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getschemas.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getschemas.hbs index bdd628ed31f..6bd85772d14 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getschemas.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_getschemas.hbs @@ -15,9 +15,21 @@ {{#eq instanceType "propertiesType" }} {{> components/schemas/_helper_properties_type }} {{else}} - {{#eq instanceType "importsType" }} + {{#eq instanceType "requiredPropertiesInputType" }} +{{> components/schemas/_helper_required_properties_input_type }} + {{else}} + {{#eq instanceType "optionalPropertiesInputType" }} +{{> components/schemas/_helper_optional_properties_input_type }} + {{else}} + {{#eq instanceType "propertiesInputType" }} +{{> components/schemas/_helper_properties_input_type }} + {{else}} + {{#eq instanceType "importsType" }} {{> _helper_imports }} + {{/eq}} + {{/eq}} + {{/eq}} {{/eq}} {{/eq}} {{/eq}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs index 98fa170b55d..600cfa3198b 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_new.hbs @@ -3,7 +3,7 @@ def __new__( {{#if types}} {{#eq types.size 1}} {{#contains types "array"}} - arg_: typing.Sequence[ + arg: typing.Sequence[ {{#with ../items}} {{#if refInfo.refClass}} typing.Union[ @@ -18,108 +18,49 @@ def __new__( ], {{/contains}} {{#contains types "object"}} - *args_: typing.Union[{{> _helper_schema_python_types }}], + arg: typing.Union[ + {{mapInputJsonPathPiece.camelCase}}, + {{jsonPathPiece.camelCase}}[frozendict.frozendict], + ], {{/contains}} {{#contains types "string"}} - arg_: {{> _helper_schema_python_types }}, + arg: {{> _helper_schema_python_types }}, {{/contains}} {{#contains types "number"}} - arg_: typing.Union[{{> _helper_schema_python_types }}], + arg: typing.Union[{{> _helper_schema_python_types }}], {{/contains}} {{#contains types "integer"}} - arg_: {{> _helper_schema_python_types }}, + arg: {{> _helper_schema_python_types }}, {{/contains}} {{#contains types "boolean"}} - arg_: {{> _helper_schema_python_types }}, + arg: {{> _helper_schema_python_types }}, {{/contains}} {{#contains types "null"}} - arg_: {{> _helper_schema_python_types }}, + arg: {{> _helper_schema_python_types }}, {{/contains}} {{else}} - {{#contains types "object"}} - *args_: typing.Union[ - {{> _helper_schema_python_types_newline }} - ], - {{else}} - arg_: typing.Union[ - {{> _helper_schema_python_types_newline }} + arg: typing.Union[ + {{#each types}} + {{#eq this "object"}} + {{mapInputJsonPathPiece.camelCase}}, + {{jsonPathPiece.camelCase}}[frozendict.frozendict], + {{else}} + {{> _helper_schema_python_type_newline }} + {{/eq}} + {{/each}} ], - {{/contains}} {{/eq}} {{else}} - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, -{{/if}} -{{#if types}} - {{#eq types.size 1}} - {{#contains types "object"}} - {{#each requiredProperties}} - {{#if @key.isValid}} - {{#with this}} - {{#if refInfo.refClass}} - {{@key.original}}: typing.Union[ - {{> components/schemas/_helper_new_ref_property_value_type optional=false }} - ], - {{else}} - {{#if jsonPathPiece}} - {{#if schemaIsFromAdditionalProperties}} - {{@key.original}}: typing.Union[ - {{> components/schemas/_helper_new_property_value_type optional=false }} + {{#if mapInputJsonPathPiece}} + arg: typing.Union[ + {{mapInputJsonPathPiece.camelCase}}, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA ], - {{else}} - {{@key.original}}: typing.Union[ - {{> components/schemas/_helper_new_property_value_type optional=false }} - ], - {{/if}} - {{else}} - {{@key.original}}: typing.Union[ - schemas.AnyTypeSchema[typing.Union[ - {{> components/schemas/_helper_schema_python_base_types_newline }} - ]], - {{> _helper_schema_python_types_newline }} - ], - {{/if}} - {{/if}} - {{/with}} - {{/if}} - {{/each}} - {{/contains}} - {{/eq}} -{{/if}} -{{#each optionalProperties}} - {{#if @key.isValid}} - {{#if refInfo.refClass}} - {{@key.original}}: typing.Union[ - {{> components/schemas/_helper_new_ref_property_value_type optional=true }} - ] = schemas.unset, - {{else}} - {{@key.original}}: typing.Union[ - {{> components/schemas/_helper_new_property_value_type optional=true }} - ] = schemas.unset, - {{/if}} - {{/if}} -{{/each}} - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, -{{#with additionalProperties}} - {{#unless isBooleanSchemaFalse}} - {{#if refInfo.refClass}} - **kwargs: typing.Union[ - {{> components/schemas/_helper_new_ref_property_value_type optional=false }} - ], - {{else}} - **kwargs: typing.Union[ - {{> components/schemas/_helper_new_property_value_type optional=false }} - ], - {{/if}} - {{/unless}} -{{else}} - {{#eq types null}} - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA {{else}} - {{#contains types "object"}} - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA - {{/contains}} - {{/eq}} -{{/with}} + arg: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, + {{/if}} +{{/if}} + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None {{#if types}} {{#eq types.size 1}} ) -> {{jsonPathPiece.camelCase}}[{{> components/schemas/_helper_schema_python_base_types }}]: @@ -139,47 +80,8 @@ def __new__( {{/if}} inst = super().__new__( cls, -{{#eq types null}} - *args_, -{{else}} - {{#contains types "object"}} - *args_, - {{else}} - arg_, - {{/contains}} -{{/eq}} -{{#if types}} - {{#eq types.size 1}} - {{#contains types "object"}} - {{#each requiredProperties}} - {{#if @key.isValid}} - {{#with this}} - {{@key.original}}={{@key.original}}, - {{/with}} - {{/if}} - {{/each}} - {{/contains}} - {{/eq}} -{{/if}} -{{#each optionalProperties}} - {{#if @key.isValid}} - {{@key.original}}={{@key.original}}, - {{/if}} -{{/each}} - configuration_=configuration_, -{{#with additionalProperties}} - {{#unless isBooleanSchemaFalse}} - **kwargs, - {{/unless}} -{{else}} - {{#eq types null}} - **kwargs, - {{else}} - {{#contains types "object"}} - **kwargs, - {{/contains}} - {{/eq}} -{{/with}} + arg, + configuration=configuration, ) inst = typing.cast( {{#if types}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_optional_properties_input_type.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_optional_properties_input_type.hbs new file mode 100644 index 00000000000..dabe0e3a938 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_optional_properties_input_type.hbs @@ -0,0 +1,49 @@ +{{#if additionalProperties}} + {{#if additionalProperties.isBooleanSchemaFalse}} +{{optionalProperties.jsonPathPiece.camelCase}} = typing_extensions.TypedDict( + '{{optionalProperties.jsonPathPiece.camelCase}}', + { + {{#each optionalProperties}} + {{#with this}} + {{#if refInfo.refClass}} + "{{{@key.original}}}": typing.Union[ + {{> components/schemas/_helper_new_ref_property_value_type optional=false }} + ], + {{else}} + "{{{@key.original}}}": typing.Union[ + {{> components/schemas/_helper_new_property_value_type optional=false }} + ], + {{/if}} + {{/with}} + {{/each}} + }, + total=False +) + {{else}} +{{optionalProperties.jsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each optionalProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + {{#with additionalProperties}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + ] +] + {{/if}} +{{else}} +{{optionalProperties.jsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each optionalProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] +{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_properties_input_type.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_properties_input_type.hbs new file mode 100644 index 00000000000..d7f3c5d6682 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_properties_input_type.hbs @@ -0,0 +1,63 @@ +{{#if additionalProperties}} + {{#if additionalProperties.isBooleanSchemaFalse}} + {{#and requiredProperties optionalProperties}} + + +class {{mapInputJsonPathPiece.camelCase}}({{requiredProperties.jsonPathPiece.camelCase}}, {{optionalProperties.jsonPathPiece.camelCase}}): + pass + {{else}} + {{! empty mapping }} +{{mapInputJsonPathPiece.camelCase}} = typing.Mapping # mapping must be empty + {{/and}} + {{else}} + {{! addProps True/schema}} + {{#and requiredProperties optionalProperties}} +{{mapInputJsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each requiredProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + {{#each optionalProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + {{#with additionalProperties}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + ] +] + {{else}} +{{mapInputJsonPathPiece.camelCase}} = typing.Mapping[ + str, + {{#with additionalProperties}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} +] + {{/and}} + {{/if}} +{{else}} + {{#and requiredProperties optionalProperties}} +{{mapInputJsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each requiredProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + {{#each optionalProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] + {{else}} +{{mapInputJsonPathPiece.camelCase}} = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] + {{/and}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_value_type.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_value_type.hbs new file mode 100644 index 00000000000..90974e6e9e4 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_property_value_type.hbs @@ -0,0 +1,18 @@ +{{#if refInfo.refClass}} +typing.Union[ + {{> components/schemas/_helper_new_ref_property_value_type optional=false }} +], +{{else}} + {{#if jsonPathPiece}} +typing.Union[ + {{> components/schemas/_helper_new_property_value_type optional=false }} +], + {{else}} +typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + {{> components/schemas/_helper_schema_python_base_types_newline }} + ]], + {{> _helper_schema_python_types_newline }} +], + {{/if}} +{{/if}} \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_required_properties_input_type.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_required_properties_input_type.hbs new file mode 100644 index 00000000000..ef361671c89 --- /dev/null +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/_helper_required_properties_input_type.hbs @@ -0,0 +1,57 @@ +{{#if additionalProperties}} + {{#if additionalProperties.isBooleanSchemaFalse}} +{{requiredProperties.jsonPathPiece.camelCase}} = typing_extensions.TypedDict( + '{{requiredProperties.jsonPathPiece.camelCase}}', + { + {{#each requiredProperties}} + {{#with this}} + {{#if refInfo.refClass}} + "{{{@key.original}}}": typing.Union[ + {{> components/schemas/_helper_new_ref_property_value_type optional=false }} + ], + {{else}} + {{#if jsonPathPiece}} + "{{{@key.original}}}": typing.Union[ + {{> components/schemas/_helper_new_property_value_type optional=false }} + ], + {{else}} + "{{{@key.original}}}": typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + {{> components/schemas/_helper_schema_python_base_types_newline }} + ]], + {{> _helper_schema_python_types_newline }} + ], + {{/if}} + {{/if}} + {{/with}} + {{/each}} + } +) + {{else}} +{{requiredProperties.jsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each requiredProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + {{#with additionalProperties}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + ] +] + {{/if}} +{{else}} +{{requiredProperties.jsonPathPiece.camelCase}} = typing.Mapping[ + str, + typing.Union[ + {{#each requiredProperties}} + {{#with this}} + {{> components/schemas/_helper_property_value_type }} + {{/with}} + {{/each}} + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] +{{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs index dc481868581..e9c9fa002e4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/components/schemas/schema_test.hbs @@ -12,26 +12,26 @@ from {{packageName}}.configurations import schema_configuration class Test{{jsonPathPiece.camelCase}}(unittest.TestCase): """{{jsonPathPiece.camelCase}} unit test stubs""" - configuration_ = schema_configuration.SchemaConfiguration() + configuration = schema_configuration.SchemaConfiguration() {{#each testCases}} {{#with this }} def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): # {{description}} {{#if valid}} - {{jsonPathPiece.camelCase}}.from_openapi_data_( + {{jsonPathPiece.camelCase}}( {{#with data}} {{> components/schemas/_helper_payload_renderer endChar=',' }} {{/with}} - configuration_=self.configuration_ + configuration=self.configuration ) {{else}} with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - {{jsonPathPiece.camelCase}}.from_openapi_data_( + {{jsonPathPiece.camelCase}}( {{#with data}} {{> components/schemas/_helper_payload_renderer endChar=','}} {{/with}} - configuration_=self.configuration_ + configuration=self.configuration ) {{/if}} {{/with}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs index 9c694f75e59..7d2f0e05627 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/_helper_operation_test_response_content.hbs @@ -27,9 +27,9 @@ def test_{{@key}}_{{#if valid}}passes{{else}}fails{{/if}}(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body {{else}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs index 4e94c9ba6c5..cdbf4b95f49 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/paths/path/verb/operation_test.hbs @@ -87,9 +87,9 @@ class Test{{httpMethod.camelCase}}(ApiTestMixin, unittest.TestCase): {{/with}} ) {{#if valid}} - body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema.from_openapi_data_( + body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -101,9 +101,9 @@ class Test{{httpMethod.camelCase}}(ApiTestMixin, unittest.TestCase): assert isinstance(api_response.body, schemas.Unset) {{else}} with self.assertRaises(({{packageName}}.ApiValueError, {{packageName}}.ApiTypeError)): - body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema.from_openapi_data_( + body = {{httpMethod.original}}.request_body.RequestBody.content["{{{../@key.original}}}"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.{{httpMethod.original}}(body=body) {{/if}} diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs index 640cb5365b7..ef9bec715cf 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/schemas.hbs @@ -41,18 +41,18 @@ class FileIO(io.FileIO): Note: this class is not immutable """ - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(arg_, (io.FileIO, io.BufferedReader)): - if arg_.closed: + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') - arg_.close() + arg.close() super_cls: typing.Type = super(FileIO, cls) - inst = super_cls.__new__(cls, arg_.name) - super(FileIO, inst).__init__(arg_.name) + inst = super_cls.__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) return inst - raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + raise exceptions.ApiValueError('FileIO must be passed arg which contains the open file') - def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): """ if this does not exist, then classes with FileIO as a mixin (AnyType etc) will see the io.FileIO __init__ signature rather than the __new__ one @@ -124,11 +124,11 @@ class SingletonMeta(type): class Singleton: """ Enums and singletons are the same - The same instance is returned for a given key of (cls, arg_) + The same instance is returned for a given key of (cls, arg) """ _instances = {} - def __new__(cls, arg_: typing.Any, **kwargs): + def __new__(cls, arg: typing.Any, **kwargs): """ cls base classes: BoolClass, NoneClass, str, decimal.Decimal The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 @@ -136,16 +136,16 @@ class Singleton: Decimal('1.0') == Decimal('1') But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 """ - key = (cls, arg_, str(arg_)) + key = (cls, arg, str(arg)) if key not in cls._instances: - if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + if isinstance(arg, (none_type_, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: super_inst: typing.Type = super() - cls._instances[key] = super_inst.__new__(cls, arg_) + cls._instances[key] = super_inst.__new__(cls, arg) return cls._instances[key] def __repr__(self): @@ -1184,7 +1184,8 @@ def _get_discriminated_class_and_exception( ) -> typing.Tuple[typing.Optional['Schema'], typing.Optional[Exception]]: if not isinstance(arg, frozendict.frozendict): return None, None - discriminator = cls_schema().discriminator() + cls_schema = cls.Schema_() + discriminator = cls_schema.discriminator disc_prop_name = list(discriminator.keys())[0] try: __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) @@ -1314,7 +1315,6 @@ class Schema(typing.Generic[T]): not in validation_metadata.configuration.disabled_json_schema_python_keywords } {{#if nonCompliantUseDiscriminatorIfCompositionFails}} - print(f'json_schema_data {json_schema_data}') kwargs = {} if 'discriminator' in json_schema_data: discriminated_cls, ensure_discriminator_value_present_exc = _get_discriminated_class_and_exception( @@ -1491,89 +1491,29 @@ class Schema(typing.Generic[T]): used_arg = arg return super_cls.__new__(cls, used_arg) - @classmethod - def from_openapi_data_( - cls, - arg: typing.Union[ - str, - int, - float, - bool, - None, - dict, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None - ): - """ - Schema from_openapi_data_ - """ - from_server = True - validated_path_to_schemas = {} - path_to_type = {} - cast_arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) - validation_metadata = ValidationMetadata( - path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), - validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) - ) - path_to_schemas = cls.__get_new_cls(cast_arg, validation_metadata, path_to_type) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion( - cast_arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ {{> _helper_types_all_incl_schema }} ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - Unset, - {{> _helper_types_all_incl_schema }} - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ Schema __new__ Args: - args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + arg (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + configuration: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords like minItems, minLength etc Note: double underscores are used here because pycharm thinks that these variables are instance properties if they are named normally :( """ - __kwargs = cls.__remove_unsets(kwargs) - if not args_ and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and args_ and not isinstance(args_[0], dict): - __arg = args_[0] - else: - __arg = cls.__get_input_dict(*args_, **__kwargs) + __arg = arg __from_server = False __validated_path_to_schemas = {} __path_to_type = {} @@ -1581,7 +1521,7 @@ class Schema(typing.Generic[T]): __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) __validation_metadata = ValidationMetadata( path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), + configuration=configuration or schema_configuration.SchemaConfiguration(), validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) ) __path_to_schemas = cls.__get_new_cls(cast_arg, __validation_metadata, __path_to_type) @@ -2218,12 +2158,12 @@ class ListSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - @classmethod - def from_openapi_data_(cls, arg: typing.Sequence[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Sequence[typing.Any], **kwargs: typing.Optional[schema_configuration.SchemaConfiguration]) -> ListSchema[tuple]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Sequence[typing.Any], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> ListSchema[tuple]: + return super().__new__(cls, arg, configuration=configuration) class NoneSchema( @@ -2235,12 +2175,12 @@ class NoneSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({NoneClass}) - @classmethod - def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration) -> NoneSchema[NoneClass]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: None, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NoneSchema[NoneClass]: + return super().__new__(cls, arg, configuration=configuration) class NumberSchema( @@ -2256,12 +2196,12 @@ class NumberSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) - @classmethod - def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> NumberSchema[decimal.Decimal]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NumberSchema[decimal.Decimal]: + return super().__new__(cls, arg, configuration=configuration) class IntBase: @@ -2282,12 +2222,12 @@ class IntSchema(IntBase, NumberSchema[T]): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int' - @classmethod - def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> IntSchema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> IntSchema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration) return typing.cast(IntSchema[decimal.Decimal], inst) @@ -2299,8 +2239,12 @@ class Int32Schema( types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int32' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int32Schema[decimal.Decimal], inst) @@ -2312,8 +2256,12 @@ class Int64Schema( types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int64' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int64Schema[decimal.Decimal], inst) @@ -2325,12 +2273,12 @@ class Float32Schema( types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'float' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float32Schema[decimal.Decimal], inst) @@ -2342,12 +2290,12 @@ class Float64Schema( types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'double' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float64Schema[decimal.Decimal], inst) @@ -2366,12 +2314,12 @@ class StrSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) - @classmethod - def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> StrSchema[str]: - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> StrSchema[str]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> StrSchema[str]: + return super().__new__(cls, arg, configuration=configuration) class UUIDSchema(UUIDBase, StrSchema[T]): @@ -2380,8 +2328,12 @@ class UUIDSchema(UUIDBase, StrSchema[T]): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'uuid' - def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> UUIDSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> UUIDSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(UUIDSchema[str], inst) @@ -2391,8 +2343,12 @@ class DateSchema(DateBase, StrSchema[T]): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date' - def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration) -> DateSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateSchema[str], inst) @@ -2402,8 +2358,12 @@ class DateTimeSchema(DateTimeBase, StrSchema[T]): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date-time' - def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration) -> DateTimeSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.datetime], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateTimeSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateTimeSchema[str], inst) @@ -2413,7 +2373,11 @@ class DecimalSchema(DecimalBase, StrSchema[T]): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'number' - def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) -> DecimalSchema[str]: + def __new__( + cls, + arg: str, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DecimalSchema[str]: """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -2422,7 +2386,7 @@ class DecimalSchema(DecimalBase, StrSchema[T]): if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema where it should stay as Decimal. """ - inst = super().__new__(cls, arg_, **kwargs) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DecimalSchema[str], inst) @@ -2437,9 +2401,13 @@ class BytesSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({bytes}) - def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration) -> BytesSchema[bytes]: + def __new__( + cls, + arg: bytes, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BytesSchema[bytes]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class FileSchema( @@ -2466,9 +2434,13 @@ class FileSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({FileIO}) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration) -> FileSchema[FileIO]: + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> FileSchema[FileIO]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class BinarySchema( @@ -2485,8 +2457,12 @@ class BinarySchema( FileSchema, ) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration) -> BinarySchema[typing.Union[FileIO, bytes]]: - return super().__new__(cls, arg_) + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader, bytes], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BinarySchema[typing.Union[FileIO, bytes]]: + return super().__new__(cls, arg) class BoolSchema( @@ -2498,12 +2474,12 @@ class BoolSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({BoolClass}) - @classmethod - def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: bool, **kwargs: ValidationMetadata) -> BoolSchema[bool]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: bool, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BoolSchema[bool]: + return super().__new__(cls, arg, configuration=configuration) class AnyTypeSchema( @@ -2523,7 +2499,7 @@ class AnyTypeSchema( def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2541,26 +2517,7 @@ class AnyTypeSchema( io.FileIO, io.BufferedReader ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader, - Unset - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None ) -> AnyTypeSchema[typing.Union[ NoneClass, frozendict.frozendict, @@ -2569,30 +2526,11 @@ class AnyTypeSchema( decimal.Decimal, BoolClass ]]: - return super().__new__(cls, *args_, configuration_=configuration_, **kwargs) + return super().__new__(cls, arg, configuration=configuration) def __init__( self, - *args_: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2610,6 +2548,7 @@ class AnyTypeSchema( io.FileIO, io.BufferedReader ], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ this exists to override the __init__ method form FileIO in NoneFrozenDictTupleStrDecimalBoolFileBytesMixin @@ -2635,10 +2574,10 @@ class NotAnyTypeSchema(AnyTypeSchema[T]): def __new__( cls, - *args_, - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + arg, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> NotAnyTypeSchema[T]: - inst = super().__new__(cls, *args_, configuration_=configuration_) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(NotAnyTypeSchema[T], inst) @@ -2651,17 +2590,12 @@ class DictSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({frozendict.frozendict}) - @classmethod - def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, Schema, Unset, ValidationMetadata], + arg: typing.Union[dict[str, INPUT_TYPES_ALL_INCL_SCHEMA], frozendict.frozendict[str, INPUT_TYPES_ALL_INCL_SCHEMA]], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> DictSchema[frozendict.frozendict]: - return super().__new__(cls, *args_, **kwargs, configuration_=configuration_) + return super().__new__(cls, arg, configuration=configuration) schema_type_classes = frozenset({NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}) diff --git a/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs index 18435f062fc..8f2d34ef5d4 100644 --- a/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs +++ b/modules/openapi-json-schema-generator/src/main/resources/python/servers/server.hbs @@ -22,7 +22,7 @@ class {{jsonPathPiece.camelCase}}(server.Server{{#if variables}}With{{else}}With ''' {{/if}} {{#if variables}} - variables: Variables[frozendict.frozendict] = Variables.from_openapi_data_({ + variables: Variables[frozendict.frozendict] = Variables({ {{#with variables}} {{#each properties}} "{{{@key.original}}}": {{jsonPathPiece.camelCase}}.Schema_.default, diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt index 2d004d9d37e..8faf1c6e6a8 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_geometry_collection_expected_value.txt @@ -1,4 +1,4 @@ -geometry_collection.GeometryCollection( - type="GeometryCollection", - geometries=[], - ) \ No newline at end of file +geometry_collection.GeometryCollection({ + "type": "GeometryCollection", + "geometries": [], + }) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml index fec5944e7a2..a9771fdaf1b 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model.yaml @@ -49,6 +49,7 @@ paths: components: schemas: GeoJsonGeometry: + type: object title: GeoJsonGeometry description: GeoJSON geometry oneOf: diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt index fb9d3068d74..5cf2cc8f379 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_13043_recursive_model_expected_value.txt @@ -1,4 +1,4 @@ -geo_json_geometry.GeoJsonGeometry( - type="GeometryCollection", - geometries=[], - ) \ No newline at end of file +geo_json_geometry.GeoJsonGeometry({ + "type": "GeometryCollection", + "geometries": [], + }) \ No newline at end of file diff --git a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt index db85c8b22cb..c5b7c53fffb 100644 --- a/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt +++ b/modules/openapi-json-schema-generator/src/test/resources/3_0/issue_7532_tree_example_value_expected.txt @@ -1,15 +1,15 @@ -dict( - trees=tree.Tree( - id=1, - name="name_example", - description="description_example", - children=[ - tree.Tree() +{ + "trees": tree.Tree({ + "id": 1, + "name": "name_example", + "description": "description_example", + "children": [ + tree.Tree({}) ], - parent=tree.Tree(), - forest=forest.Forest(), - additional=dict( - "key": tree.Tree(), - ), - ), - ) \ No newline at end of file + "parent": tree.Tree({}), + "forest": forest.Forest({}), + "additional": { + "key": tree.Tree({}), + }, + }), + } \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION index 4a36342fcab..56fea8a08d2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0 +3.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/3_0_3_unit_test/python/README.md b/samples/openapi3/client/3_0_3_unit_test/python/README.md index fbf4e78db78..564ccd2d4b2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/README.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/README.md @@ -183,10 +183,10 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) + body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate({ + "foo": None, + "bar": None, + }) try: api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md index ba7f83e0f06..ff55ae7ec6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/components/schema/_not.md @@ -10,9 +10,9 @@ dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, i ## not Class Name | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -[_not](#_not) | decimal.Decimal, int | decimal.Decimal | | +[_not](#not2) | decimal.Decimal, int | decimal.Decimal | | -# _Not +# Not2 ## Type Info Input Type | Accessed Type | Description | Notes diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md index 42d8ff5c339..81ee375a10f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/post.md @@ -94,10 +94,10 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate( - foo=None, - bar=None, - ) + body = additionalproperties_allows_a_schema_which_should_validate.AdditionalpropertiesAllowsASchemaWhichShouldValidate({ + "foo": None, + "bar": None, + }) try: api_response = api_instance.post_additionalproperties_allows_a_schema_which_should_validate_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md index 76ec9939fae..fa11e5691fe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_additionalproperties_can_exist_by_itself_request_body/post.md @@ -94,9 +94,9 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself( - key=True, - ) + body = additionalproperties_can_exist_by_itself.AdditionalpropertiesCanExistByItself({ + "key": True, + }) try: api_response = api_instance.post_additionalproperties_can_exist_by_itself_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md index ca3f27bbecc..3e9f7af7e6d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_enums_in_properties_request_body/post.md @@ -94,10 +94,10 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = enums_in_properties.EnumsInProperties( - foo="foo", - bar="bar", - ) + body = enums_in_properties.EnumsInProperties({ + "foo": "foo", + "bar": "bar", + }) try: api_response = api_instance.post_enums_in_properties_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md index 4840af7bb70..e82663b3f89 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_object_type_matches_objects_request_body/post.md @@ -94,7 +94,7 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = object_type_matches_objects.ObjectTypeMatchesObjects() + body = object_type_matches_objects.ObjectTypeMatchesObjects({}) try: api_response = api_instance.post_object_type_matches_objects_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md index b5b16922ad5..2da14957daa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_oneof_with_required_request_body/post.md @@ -94,7 +94,7 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = oneof_with_required.OneofWithRequired() + body = oneof_with_required.OneofWithRequired({}) try: api_response = api_instance.post_oneof_with_required_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md index 1c648efec64..3a5727bd1b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_ref_in_additionalproperties_request_body/post.md @@ -94,9 +94,9 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = ref_in_additionalproperties.RefInAdditionalproperties( - key=property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference(None), - ) + body = ref_in_additionalproperties.RefInAdditionalproperties({ + "key": property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference(None), + }) try: api_response = api_instance.post_ref_in_additionalproperties_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md index 30ea2bf3093..3b0135f26ef 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md +++ b/samples/openapi3/client/3_0_3_unit_test/python/docs/paths/request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/post.md @@ -94,9 +94,9 @@ with unit_test_api.ApiClient(used_configuration) as api_client: api_instance = operation_request_body_api.OperationRequestBodyApi(api_client) # example passing only required values which don't have defaults set - body = the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( - alpha=5, - ) + body = the_default_keyword_does_not_do_anything_if_the_property_is_missing.TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing({ + "alpha": 5, + }) try: api_response = api_instance.post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body( body=body, diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py index 141bbdded25..2317e3781f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/api_client.py @@ -719,13 +719,13 @@ def deserialize( """ if cls.style: extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) - return cls.schema.from_openapi_data_(extracted_data) + return cls.schema(extracted_data) assert cls.content is not None for content_type, media_type in cls.content.items(): if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) assert media_type.schema is not None - return media_type.schema.from_openapi_data_(cast_in_data) + return media_type.schema(cast_in_data) else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) raise ValueError('Invalid value for content, it was empty and must have 1 key value pair') @@ -940,8 +940,12 @@ def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_confi content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_( - body_data, configuration_=configuration) + body_schema = schemas._get_class(body_schema) + if body_schema is schemas.BinarySchema: + deserialized_body = body_schema(body_data) + else: + deserialized_body = body_schema( + body_data, configuration=configuration) elif streamed: response.release_conn() @@ -1410,8 +1414,6 @@ def serialize( schema = schemas._get_class(media_type.schema) if isinstance(in_data, schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = schema(**in_data) else: cast_in_data = schema(in_data) # TODO check for and use encoding if it exists diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py index cf5f06288e1..69cf3c22dc1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/_not.py @@ -10,7 +10,8 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * -_Not: typing_extensions.TypeAlias = schemas.IntSchema[U] +Not2: typing_extensions.TypeAlias = schemas.IntSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _Not( @@ -26,14 +27,16 @@ class _Not( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - not_: typing.Type[_Not] = dataclasses.field(default_factory=lambda: _Not) # type: ignore + not_: typing.Type[Not2] = dataclasses.field(default_factory=lambda: Not2) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _Not[ typing.Union[ frozendict.frozendict, @@ -48,9 +51,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _Not[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py index 141c2c50833..28dbd5a7229 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_allows_a_schema_which_should_validate.py @@ -11,7 +11,9 @@ from unit_test_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.BoolSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Bar: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -20,6 +22,57 @@ "bar": typing.Type[Bar], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Bar[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AdditionalProperties[schemas.BoolClass], + bool + ], + ] +] class AdditionalpropertiesAllowsASchemaWhichShouldValidate( @@ -78,64 +131,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - bar: typing.Union[ - Bar[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[schemas.BoolClass], - bool + arg: typing.Union[ + DictInput3, + AdditionalpropertiesAllowsASchemaWhichShouldValidate[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalpropertiesAllowsASchemaWhichShouldValidate[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - foo=foo, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalpropertiesAllowsASchemaWhichShouldValidate[frozendict.frozendict], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py index 3c9a5a69a48..19628b6367c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_are_allowed_by_default.py @@ -10,7 +10,9 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Bar: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -19,6 +21,54 @@ "bar": typing.Type[Bar], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Bar[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class AdditionalpropertiesAreAllowedByDefault( @@ -86,53 +136,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - bar: typing.Union[ - Bar[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalpropertiesAreAllowedByDefault[ typing.Union[ frozendict.frozendict, @@ -147,11 +155,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalpropertiesAreAllowedByDefault[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py index 9ac63345f54..24e1e170158 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_can_exist_by_itself.py @@ -11,6 +11,13 @@ from unit_test_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.BoolSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[schemas.BoolClass], + bool + ], +] class AdditionalpropertiesCanExistByItself( @@ -34,18 +41,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[schemas.BoolClass]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[schemas.BoolClass], - bool + arg: typing.Union[ + DictInput, + AdditionalpropertiesCanExistByItself[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalpropertiesCanExistByItself[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalpropertiesCanExistByItself[frozendict.frozendict], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py index 59b5fb746a2..b8708f55f53 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/additionalproperties_should_not_look_in_applicators.py @@ -11,6 +11,7 @@ from unit_test_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.BoolSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -18,6 +19,33 @@ "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -67,31 +95,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -106,10 +114,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -131,6 +137,13 @@ def __new__( AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput3 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[schemas.BoolClass], + bool + ], +] class AdditionalpropertiesShouldNotLookInApplicators( @@ -156,12 +169,11 @@ def __getitem__(self, name: str) -> AdditionalProperties[schemas.BoolClass]: def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[schemas.BoolClass], - bool + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalpropertiesShouldNotLookInApplicators[ typing.Union[ frozendict.frozendict, @@ -176,9 +188,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalpropertiesShouldNotLookInApplicators[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py index 6abfcd95011..eb94d29bbf4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof.py @@ -17,6 +17,17 @@ "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -64,9 +75,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -81,9 +94,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -109,6 +121,16 @@ def __new__( "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -156,9 +178,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -173,9 +197,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -194,10 +217,11 @@ def __new__( ) return inst -AllOf = typing.Tuple[ +AllOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Allof( @@ -213,14 +237,16 @@ class Allof( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - all_of: AllOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AllOf)) # type: ignore + all_of: AllOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AllOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Allof[ typing.Union[ frozendict.frozendict, @@ -235,9 +261,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Allof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py index bc30c9f4b8c..bf74b017371 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_combined_with_anyof_oneof.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _03( @@ -25,9 +26,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _03[ typing.Union[ frozendict.frozendict, @@ -42,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _03[ @@ -66,6 +68,7 @@ def __new__( AllOf = typing.Tuple[ typing.Type[_03[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _02( @@ -81,9 +84,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _02[ typing.Union[ frozendict.frozendict, @@ -98,9 +103,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _02[ @@ -122,6 +126,7 @@ def __new__( AnyOf = typing.Tuple[ typing.Type[_02[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -137,9 +142,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -154,9 +161,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -178,6 +184,7 @@ def __new__( OneOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofCombinedWithAnyofOneof( @@ -200,9 +207,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput4, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofCombinedWithAnyofOneof[ typing.Union[ frozendict.frozendict, @@ -217,9 +226,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofCombinedWithAnyofOneof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py index 3861d8dd52a..394de256dfe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_simple_types.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -25,9 +26,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -42,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -63,6 +65,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _1( @@ -78,9 +81,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -95,9 +100,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -120,6 +124,7 @@ def __new__( typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofSimpleTypes( @@ -140,9 +145,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofSimpleTypes[ typing.Union[ frozendict.frozendict, @@ -157,9 +164,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofSimpleTypes[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py index e66fd69a09e..776f780487a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_base_schema.py @@ -17,6 +17,16 @@ "foo": typing.Type[Foo], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -64,9 +74,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -81,9 +93,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -109,6 +120,16 @@ def __new__( "baz": typing.Type[Baz], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Baz[schemas.NoneClass], + None + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -156,9 +177,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -173,9 +196,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -205,6 +227,17 @@ def __new__( "bar": typing.Type[Bar], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class AllofWithBaseSchema( @@ -258,9 +291,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofWithBaseSchema[ typing.Union[ frozendict.frozendict, @@ -275,9 +310,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofWithBaseSchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py index 55d03fc6311..a5e59052b5c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_one_empty_schema.py @@ -10,10 +10,12 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofWithOneEmptySchema( @@ -34,9 +36,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofWithOneEmptySchema[ typing.Union[ frozendict.frozendict, @@ -51,9 +55,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofWithOneEmptySchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py index e640c00767e..203852e5973 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_first_empty_schema.py @@ -10,12 +10,14 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] _1: typing_extensions.TypeAlias = schemas.NumberSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofWithTheFirstEmptySchema( @@ -36,9 +38,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofWithTheFirstEmptySchema[ typing.Union[ frozendict.frozendict, @@ -53,9 +57,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofWithTheFirstEmptySchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py index 18bd961fba1..1c0ce12f391 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_the_last_empty_schema.py @@ -11,11 +11,13 @@ from unit_test_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.NumberSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _1: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofWithTheLastEmptySchema( @@ -36,9 +38,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofWithTheLastEmptySchema[ typing.Union[ frozendict.frozendict, @@ -53,9 +57,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofWithTheLastEmptySchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py index bcb530a8db9..6083a4b1fd0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/allof_with_two_empty_schemas.py @@ -10,12 +10,15 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _1: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AllofWithTwoEmptySchemas( @@ -36,9 +39,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AllofWithTwoEmptySchemas[ typing.Union[ frozendict.frozendict, @@ -53,9 +58,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AllofWithTwoEmptySchemas[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py index db5ab8f98c5..d16da9f7b51 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof.py @@ -11,6 +11,7 @@ from unit_test_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.IntSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _1( @@ -26,9 +27,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -43,9 +46,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -64,10 +66,11 @@ def __new__( ) return inst -AnyOf = typing.Tuple[ +AnyOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Anyof( @@ -83,14 +86,16 @@ class Anyof( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - any_of: AnyOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AnyOf)) # type: ignore + any_of: AnyOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AnyOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Anyof[ typing.Union[ frozendict.frozendict, @@ -105,9 +110,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Anyof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py index a437baabc35..a04591d6dfa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_complex_types.py @@ -17,6 +17,17 @@ "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -64,9 +75,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -81,9 +94,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -109,6 +121,16 @@ def __new__( "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -156,9 +178,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -173,9 +197,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -198,6 +221,7 @@ def __new__( typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AnyofComplexTypes( @@ -218,9 +242,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyofComplexTypes[ typing.Union[ frozendict.frozendict, @@ -235,9 +261,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AnyofComplexTypes[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py index ff8e02bf23d..30e94846688 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_base_schema.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -25,9 +26,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -42,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -63,6 +65,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _1( @@ -78,9 +81,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -95,9 +100,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -142,13 +146,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: str, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: str, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyofWithBaseSchema[str]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( AnyofWithBaseSchema[str], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py index ead1b940c10..90f282870cf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/anyof_with_one_empty_schema.py @@ -11,11 +11,13 @@ from unit_test_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.NumberSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _1: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AnyOf = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AnyofWithOneEmptySchema( @@ -36,9 +38,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyofWithOneEmptySchema[ typing.Union[ frozendict.frozendict, @@ -53,9 +57,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AnyofWithOneEmptySchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py index 68aae77b810..8454fc24556 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/array_type_matches_arrays.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -30,7 +31,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -53,12 +54,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayTypeMatchesArrays[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayTypeMatchesArrays[tuple], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py index 8d48c6ff0a1..8c8b9b3ba2e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_int.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ByInt( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ByInt[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ByInt[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py index 6b8c819d611..2c5e9a1e983 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_number.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ByNumber( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ByNumber[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ByNumber[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py index 5eaa6cdac4e..3280d002587 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/by_small_number.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class BySmallNumber( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> BySmallNumber[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( BySmallNumber[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py index 2d202d5bdd6..f911669ebf5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/date_time_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class DateTimeFormat( @@ -31,9 +32,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DateTimeFormat[ typing.Union[ frozendict.frozendict, @@ -48,9 +51,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( DateTimeFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py index 8ec0d70100d..0c309ac1877 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/email_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class EmailFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EmailFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( EmailFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py index ee45bbd69ec..689257df234 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/enums_in_properties.py @@ -59,6 +59,20 @@ def BAR(cls) -> Bar[str]: "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[str], + str + ], + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class EnumsInProperties( @@ -114,26 +128,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - bar: typing.Union[ - Bar[str], - str + arg: typing.Union[ + DictInput, + EnumsInProperties[frozendict.frozendict], ], - foo: typing.Union[ - Foo[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EnumsInProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - bar=bar, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( EnumsInProperties[frozendict.frozendict], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py index dd596562f38..7b267335233 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/forbidden_property.py @@ -17,6 +17,33 @@ "foo": typing.Type[Foo], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ForbiddenProperty( @@ -71,31 +98,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ForbiddenProperty[ typing.Union[ frozendict.frozendict, @@ -110,10 +117,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ForbiddenProperty[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py index 11d784597b8..480e399f52f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/hostname_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class HostnameFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> HostnameFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( HostnameFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py index 9e2bb008e57..a60c731cae6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/invalid_string_value_for_default.py @@ -30,6 +30,16 @@ class Schema_(metaclass=schemas.SingletonMeta): "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class InvalidStringValueForDefault( @@ -75,14 +85,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - bar: typing.Union[ - Bar[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> InvalidStringValueForDefault[ typing.Union[ frozendict.frozendict, @@ -97,10 +104,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( InvalidStringValueForDefault[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py index 5a05f608b8b..2a755da93bf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv4_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Ipv4Format( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Ipv4Format[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Ipv4Format[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py index be23fd2b76c..3adf3b8614d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ipv6_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Ipv6Format( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Ipv6Format[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Ipv6Format[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py index 42e84fce010..068694c7933 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/json_pointer_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class JsonPointerFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> JsonPointerFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( JsonPointerFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py index 14714346cb3..3deb7d9788b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MaximumValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MaximumValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MaximumValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py index 9d3b5f2d81a..728307c35a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maximum_validation_with_unsigned_integer.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MaximumValidationWithUnsignedInteger( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MaximumValidationWithUnsignedInteger[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MaximumValidationWithUnsignedInteger[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py index 296641f1fe1..abc670311e4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxitems_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MaxitemsValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MaxitemsValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MaxitemsValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py index 8f3481fc68b..e967cc113d2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxlength_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MaxlengthValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MaxlengthValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MaxlengthValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py index 4258f1d4f9d..692756ecfc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties0_means_the_object_is_empty.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Maxproperties0MeansTheObjectIsEmpty( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Maxproperties0MeansTheObjectIsEmpty[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Maxproperties0MeansTheObjectIsEmpty[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py index 4a0f296bbb1..a8f25faeb57 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/maxproperties_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MaxpropertiesValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MaxpropertiesValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MaxpropertiesValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py index 3f47f668e0d..c7c03046e71 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MinimumValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MinimumValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MinimumValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py index 663669f8064..5d66211df71 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minimum_validation_with_signed_integer.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MinimumValidationWithSignedInteger( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MinimumValidationWithSignedInteger[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MinimumValidationWithSignedInteger[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py index b5c7396656c..7403c9563fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minitems_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MinitemsValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MinitemsValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MinitemsValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py index fd84680732a..df08640fb8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minlength_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MinlengthValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MinlengthValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MinlengthValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py index 3bee8da4cf1..ae6954fb43b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/minproperties_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class MinpropertiesValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MinpropertiesValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MinpropertiesValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py index 183cd7b7ca7..9e06181e805 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_allof_to_check_validation_semantics.py @@ -14,6 +14,7 @@ AllOf = typing.Tuple[ typing.Type[_02[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -29,9 +30,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -46,9 +49,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -67,9 +69,10 @@ def __new__( ) return inst -AllOf = typing.Tuple[ +AllOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class NestedAllofToCheckValidationSemantics( @@ -85,14 +88,16 @@ class NestedAllofToCheckValidationSemantics( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - all_of: AllOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AllOf)) # type: ignore + all_of: AllOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AllOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NestedAllofToCheckValidationSemantics[ typing.Union[ frozendict.frozendict, @@ -107,9 +112,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NestedAllofToCheckValidationSemantics[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py index 018fbed6bb9..b308074c44e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_anyof_to_check_validation_semantics.py @@ -14,6 +14,7 @@ AnyOf = typing.Tuple[ typing.Type[_02[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -29,9 +30,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -46,9 +49,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -67,9 +69,10 @@ def __new__( ) return inst -AnyOf = typing.Tuple[ +AnyOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class NestedAnyofToCheckValidationSemantics( @@ -85,14 +88,16 @@ class NestedAnyofToCheckValidationSemantics( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - any_of: AnyOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AnyOf)) # type: ignore + any_of: AnyOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(AnyOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NestedAnyofToCheckValidationSemantics[ typing.Union[ frozendict.frozendict, @@ -107,9 +112,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NestedAnyofToCheckValidationSemantics[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py index 282da9cd705..7a8601899f9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_items.py @@ -25,7 +25,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items4[decimal.Decimal], decimal.Decimal, @@ -33,12 +33,12 @@ def __new__( float ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items3[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items3[tuple], @@ -63,19 +63,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items3[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items2[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items2[tuple], @@ -100,19 +100,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items2[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items[tuple], @@ -142,19 +142,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NestedItems[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( NestedItems[tuple], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py index 92dbb5d3bf5..d008609ded8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/nested_oneof_to_check_validation_semantics.py @@ -14,6 +14,7 @@ OneOf = typing.Tuple[ typing.Type[_02[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -29,9 +30,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -46,9 +49,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -67,9 +69,10 @@ def __new__( ) return inst -OneOf = typing.Tuple[ +OneOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class NestedOneofToCheckValidationSemantics( @@ -85,14 +88,16 @@ class NestedOneofToCheckValidationSemantics( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - one_of: OneOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf)) # type: ignore + one_of: OneOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NestedOneofToCheckValidationSemantics[ typing.Union[ frozendict.frozendict, @@ -107,9 +112,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NestedOneofToCheckValidationSemantics[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py index 7d6875a4d83..9d579acc109 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/not_more_complex_schema.py @@ -17,6 +17,16 @@ "foo": typing.Type[Foo], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _Not( @@ -56,21 +66,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - foo: typing.Union[ - Foo[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _Not[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _Not[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _Not[frozendict.frozendict], @@ -78,6 +83,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class NotMoreComplexSchema( @@ -98,9 +104,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NotMoreComplexSchema[ typing.Union[ frozendict.frozendict, @@ -115,9 +123,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NotMoreComplexSchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py index 3bf18389483..3ec9d874748 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_properties_validation.py @@ -19,6 +19,21 @@ "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Bar[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectPropertiesValidation( @@ -68,20 +83,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - bar: typing.Union[ - Bar[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectPropertiesValidation[ typing.Union[ frozendict.frozendict, @@ -96,11 +102,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectPropertiesValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py index f95a814a561..fe1585ec78c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/object_type_matches_objects.py @@ -10,4 +10,5 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] ObjectTypeMatchesObjects: typing_extensions.TypeAlias = schemas.DictSchema[U] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py index b920d695a4f..6c9f89f0e83 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof.py @@ -11,6 +11,7 @@ from unit_test_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.IntSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _1( @@ -26,9 +27,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -43,9 +46,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -64,10 +66,11 @@ def __new__( ) return inst -OneOf = typing.Tuple[ +OneOf2 = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Oneof( @@ -83,14 +86,16 @@ class Oneof( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): # any type - one_of: OneOf = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf)) # type: ignore + one_of: OneOf2 = dataclasses.field(default_factory=lambda: schemas.tuple_to_instance(OneOf2)) # type: ignore def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Oneof[ typing.Union[ frozendict.frozendict, @@ -105,9 +110,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Oneof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py index 9a95c94c98c..6b12e24286b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_complex_types.py @@ -17,6 +17,17 @@ "bar": typing.Type[Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -64,9 +75,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -81,9 +94,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -109,6 +121,16 @@ def __new__( "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -156,9 +178,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -173,9 +197,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -198,6 +221,7 @@ def __new__( typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class OneofComplexTypes( @@ -218,9 +242,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> OneofComplexTypes[ typing.Union[ frozendict.frozendict, @@ -235,9 +261,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( OneofComplexTypes[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py index b8ba029a4eb..31c60cf077f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_base_schema.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _0( @@ -25,9 +26,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -42,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -63,6 +65,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _1( @@ -78,9 +81,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -95,9 +100,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -142,13 +146,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: str, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: str, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> OneofWithBaseSchema[str]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( OneofWithBaseSchema[str], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py index ca8705889a2..e03a993813b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_empty_schema.py @@ -11,11 +11,13 @@ from unit_test_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.NumberSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _1: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] OneOf = typing.Tuple[ typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class OneofWithEmptySchema( @@ -36,9 +38,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> OneofWithEmptySchema[ typing.Union[ frozendict.frozendict, @@ -53,9 +57,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( OneofWithEmptySchema[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py index 535bdd7fdac..f2cd25e173c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/oneof_with_required.py @@ -10,6 +10,68 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _0( @@ -101,9 +163,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[ typing.Union[ frozendict.frozendict, @@ -118,9 +182,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[ @@ -139,6 +202,68 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -230,9 +355,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[ typing.Union[ frozendict.frozendict, @@ -247,9 +374,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[ @@ -272,6 +398,7 @@ def __new__( typing.Type[_0[schemas.U]], typing.Type[_1[schemas.U]], ] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class OneofWithRequired( @@ -294,15 +421,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + OneofWithRequired[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> OneofWithRequired[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( OneofWithRequired[frozendict.frozendict], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py index 16416b2de31..5f07a775146 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_is_not_anchored.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class PatternIsNotAnchored( @@ -32,9 +33,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> PatternIsNotAnchored[ typing.Union[ frozendict.frozendict, @@ -49,9 +52,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( PatternIsNotAnchored[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py index cd28f452f0d..8f61d8c643e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/pattern_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class PatternValidation( @@ -32,9 +33,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> PatternValidation[ typing.Union[ frozendict.frozendict, @@ -49,9 +52,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( PatternValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py index cfb37ff352d..6feee3c4c07 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/properties_with_escaped_characters.py @@ -27,6 +27,48 @@ "foo\fbar": typing.Type[FooFbar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + FooNbar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + FooBar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + FooBar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + FooRbar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + FooTbar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + FooFbar[decimal.Decimal], + decimal.Decimal, + int, + float + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class PropertiesWithEscapedCharacters( @@ -92,9 +134,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> PropertiesWithEscapedCharacters[ typing.Union[ frozendict.frozendict, @@ -109,9 +153,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( PropertiesWithEscapedCharacters[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py index 6f1a114f1b7..88192629a7e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/property_named_ref_that_is_not_a_reference.py @@ -17,6 +17,16 @@ "$ref": typing.Type[Ref], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Ref[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class PropertyNamedRefThatIsNotAReference( @@ -62,9 +72,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> PropertyNamedRefThatIsNotAReference[ typing.Union[ frozendict.frozendict, @@ -79,9 +91,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( PropertyNamedRefThatIsNotAReference[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py index aec11997502..08ce2decd55 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_additionalproperties.py @@ -42,35 +42,16 @@ def __getitem__(self, name: str) -> property_named_ref_that_is_not_a_reference.P def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + RefInAdditionalproperties[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInAdditionalproperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInAdditionalproperties[frozendict.frozendict], @@ -80,3 +61,27 @@ def __new__( from unit_test_api.components.schema import property_named_ref_that_is_not_a_reference +DictInput = typing.Mapping[ + str, + typing.Union[ + property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], +] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py index 4dca37c7804..1080f2956f3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_allof.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class RefInAllof( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInAllof[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInAllof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py index 5f4b98a0e92..d16651b9af7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_anyof.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class RefInAnyof( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInAnyof[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInAnyof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py index 51d6c06e927..b61a56f16f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_items.py @@ -29,7 +29,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference[ schemas.INPUT_BASE_TYPES @@ -52,12 +52,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInItems[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( RefInItems[tuple], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py index 5a9f9a7e7b6..be775bc9b21 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_not.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class RefInNot( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInNot[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInNot[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py index 58548748ba2..86de4ac60b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_oneof.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class RefInOneof( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInOneof[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInOneof[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py index 9be138cf449..f49e2024e5b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/ref_in_property.py @@ -64,31 +64,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - a: typing.Union[ - property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RefInProperty[ typing.Union[ frozendict.frozendict, @@ -103,10 +83,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - a=a, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RefInProperty[ @@ -133,3 +111,30 @@ def __new__( "a": typing.Type[property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + property_named_ref_that_is_not_a_reference.PropertyNamedRefThatIsNotAReference[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py index fcacf281873..ccef05eab5b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_default_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -17,6 +18,33 @@ "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class RequiredDefaultValidation( @@ -71,31 +99,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RequiredDefaultValidation[ typing.Union[ frozendict.frozendict, @@ -110,10 +118,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RequiredDefaultValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py index 216367e2b8e..0a223a43458 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_validation.py @@ -10,7 +10,9 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Bar: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -19,6 +21,54 @@ "bar": typing.Type[Bar], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Bar[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class RequiredValidation( @@ -102,31 +152,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - bar: typing.Union[ - Bar[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RequiredValidation[ typing.Union[ frozendict.frozendict, @@ -141,10 +171,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RequiredValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py index 127ee15485b..95222531811 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_empty_array.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Foo: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -17,6 +18,33 @@ "foo": typing.Type[Foo], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Foo[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class RequiredWithEmptyArray( @@ -71,31 +99,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - foo: typing.Union[ - Foo[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RequiredWithEmptyArray[ typing.Union[ frozendict.frozendict, @@ -110,10 +118,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RequiredWithEmptyArray[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py index 26295127b1f..4d589f0ea1e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/required_with_escaped_characters.py @@ -10,6 +10,180 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class RequiredWithEscapedCharacters( @@ -136,9 +310,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> RequiredWithEscapedCharacters[ typing.Union[ frozendict.frozendict, @@ -153,9 +329,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( RequiredWithEscapedCharacters[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py index c33552ffbef..0272a23578d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/the_default_keyword_does_not_do_anything_if_the_property_is_missing.py @@ -30,6 +30,18 @@ class Schema_(metaclass=schemas.SingletonMeta): "alpha": typing.Type[Alpha], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Alpha[decimal.Decimal], + decimal.Decimal, + int, + float + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( @@ -74,23 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - alpha: typing.Union[ - Alpha[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - alpha=alpha, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing[frozendict.frozendict], diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py index 276bb8fd317..861e8eb01c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_false_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class UniqueitemsFalseValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> UniqueitemsFalseValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( UniqueitemsFalseValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py index 144918fc43a..69acad75bae 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uniqueitems_validation.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class UniqueitemsValidation( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> UniqueitemsValidation[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( UniqueitemsValidation[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py index a5d4cc3df6e..c7434fb77cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class UriFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> UriFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( UriFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py index 0459886ab18..0d70d9f1efd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_reference_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class UriReferenceFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> UriReferenceFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( UriReferenceFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py index 24ae897eecd..6ff207b7f24 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/components/schema/uri_template_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from unit_test_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class UriTemplateFormat( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> UriTemplateFormat[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( UriTemplateFormat[ diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py deleted file mode 100644 index 17b28cf44aa..00000000000 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/configuration.py +++ /dev/null @@ -1,404 +0,0 @@ -# coding: utf-8 - -""" - openapi 3.0.3 sample spec - - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - - The version of the OpenAPI document: 0.0.1 - Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator -""" - -import copy -from http import client as http_client -import logging -import multiprocessing -import sys -import typing - -import urllib3 - -from unit_test_api import exceptions - - -PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD = { - 'types': 'type', - 'enum_value_to_name': 'enum', - 'unique_items': 'uniqueItems', - 'min_items': 'minItems', - 'max_items': 'maxItems', - 'min_properties': 'minProperties', - 'max_properties': 'maxProperties', - 'min_length': 'minLength', - 'max_length': 'maxLength', - 'inclusive_minimum': 'minimum', - 'exclusive_minimum': 'exclusiveMinimum', - 'inclusive_maximum': 'maximum', - 'exclusive_maximum': 'exclusiveMaximum', - 'multiple_of': 'multipleOf', - 'regex': 'pattern', - 'format': 'format', - 'required': 'required', - 'items': 'items', - 'Items': 'items', - 'Properties': 'properties', - 'additional_properties': 'additionalProperties', - 'additionalProperties': 'additionalProperties', - 'OneOf': 'oneOf', - 'AnyOf': 'anyOf', - 'AllOf': 'allOf', - '_not': 'not', - '_Not': 'not', - 'discriminator': 'discriminator' -} - -class Configuration(object): - """NOTE: This class is auto generated by OpenAPI JSON Schema Generator - - Ref: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator - Do not edit the class manually. - - :param host: Base url - :param disabled_json_schema_keywords (set): Set of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_json_schema_keywords is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - """ - - _default = None - - def __init__( - self, - host: typing.Optional[str] = None, - disabled_json_schema_keywords = frozenset(), - server_index: typing.Optional[int] = None, - server_variables = None, - server_operation_index = None, - server_operation_variables = None, - ): - """Constructor - """ - self._base_path = host or "https://someserver.com/v1" - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.auth_info = {} - self.disabled_json_schema_keywords = disabled_json_schema_keywords - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("unit_test_api") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = None - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - # Options to pass down to the underlying urllib3 socket - self.socket_options = None - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - @property - def disabled_json_schema_keywords(self) -> typing.Set[str]: - return self.__disabled_json_schema_keywords - - @property - def disabled_json_schema_python_keywords(self) -> typing.Set[str]: - return self.__disabled_json_schema_python_keywords - - @disabled_json_schema_keywords.setter - def disabled_json_schema_keywords(self, json_keywords: typing.Set[str]): - disabled_json_schema_keywords = set() - disabled_json_schema_python_keywords = set() - for k in json_keywords: - python_keywords = {key for key, val in PYTHON_KEYWORD_TO_JSON_SCHEMA_KEYWORD.items() if val == k} - if not python_keywords: - raise exceptions.ApiValueError( - "Invalid keyword: '{0}''".format(k)) - disabled_json_schema_keywords.add(k) - disabled_json_schema_python_keywords.update(python_keywords) - self.__disabled_json_schema_keywords = disabled_json_schema_keywords - self.__disabled_json_schema_python_keywords = disabled_json_schema_python_keywords - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = copy.deepcopy(default) - - @classmethod - def get_default_copy(cls): - """Return new instance of configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration passed by the set_default method. - - :return: The configuration object. - """ - if cls._default is not None: - return copy.deepcopy(cls._default) - return Configuration() - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on http_client debug - http_client.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off http_client debug - http_client.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 0.0.1\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "https://someserver.com/v1", - 'description': "No description provided", - } - ] - - def get_host_from_settings( - self, - index: typing.Optional[int], - variables: typing.Optional[typing.Dict[str, dict]] = None, - servers: typing.Optional[typing.List[dict]] = None - ) -> str: - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = variables or {} - servers = servers or self.get_host_settings() - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self) -> str: - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py index 58ba9d009c3..80b292c8ab9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/src/unit_test_api/schemas.py @@ -46,18 +46,18 @@ class FileIO(io.FileIO): Note: this class is not immutable """ - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(arg_, (io.FileIO, io.BufferedReader)): - if arg_.closed: + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') - arg_.close() + arg.close() super_cls: typing.Type = super(FileIO, cls) - inst = super_cls.__new__(cls, arg_.name) - super(FileIO, inst).__init__(arg_.name) + inst = super_cls.__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) return inst - raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + raise exceptions.ApiValueError('FileIO must be passed arg which contains the open file') - def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): """ if this does not exist, then classes with FileIO as a mixin (AnyType etc) will see the io.FileIO __init__ signature rather than the __new__ one @@ -129,11 +129,11 @@ def __call__(cls, *args, **kwargs): class Singleton: """ Enums and singletons are the same - The same instance is returned for a given key of (cls, arg_) + The same instance is returned for a given key of (cls, arg) """ _instances = {} - def __new__(cls, arg_: typing.Any, **kwargs): + def __new__(cls, arg: typing.Any, **kwargs): """ cls base classes: BoolClass, NoneClass, str, decimal.Decimal The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 @@ -141,16 +141,16 @@ def __new__(cls, arg_: typing.Any, **kwargs): Decimal('1.0') == Decimal('1') But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 """ - key = (cls, arg_, str(arg_)) + key = (cls, arg, str(arg)) if key not in cls._instances: - if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + if isinstance(arg, (none_type_, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: super_inst: typing.Type = super() - cls._instances[key] = super_inst.__new__(cls, arg_) + cls._instances[key] = super_inst.__new__(cls, arg) return cls._instances[key] def __repr__(self): @@ -1350,60 +1350,13 @@ def _get_new_instance_without_conversion( used_arg = arg return super_cls.__new__(cls, used_arg) - @classmethod - def from_openapi_data_( - cls, - arg: typing.Union[ - str, - int, - float, - bool, - None, - dict, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None - ): - """ - Schema from_openapi_data_ - """ - from_server = True - validated_path_to_schemas = {} - path_to_type = {} - cast_arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) - validation_metadata = ValidationMetadata( - path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), - validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) - ) - path_to_schemas = cls.__get_new_cls(cast_arg, validation_metadata, path_to_type) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion( - cast_arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ dict, frozendict.frozendict, list, @@ -1422,49 +1375,20 @@ def __new__( io.BufferedReader, 'Schema', ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - Unset, - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - bool, - None, - bytes, - io.FileIO, - io.BufferedReader, - 'Schema', - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ Schema __new__ Args: - args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + arg (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + configuration: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords like minItems, minLength etc Note: double underscores are used here because pycharm thinks that these variables are instance properties if they are named normally :( """ - __kwargs = cls.__remove_unsets(kwargs) - if not args_ and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and args_ and not isinstance(args_[0], dict): - __arg = args_[0] - else: - __arg = cls.__get_input_dict(*args_, **__kwargs) + __arg = arg __from_server = False __validated_path_to_schemas = {} __path_to_type = {} @@ -1472,7 +1396,7 @@ def __new__( __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) __validation_metadata = ValidationMetadata( path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), + configuration=configuration or schema_configuration.SchemaConfiguration(), validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) ) __path_to_schemas = cls.__get_new_cls(cast_arg, __validation_metadata, __path_to_type) @@ -2131,12 +2055,12 @@ class ListSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - @classmethod - def from_openapi_data_(cls, arg: typing.Sequence[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Sequence[typing.Any], **kwargs: typing.Optional[schema_configuration.SchemaConfiguration]) -> ListSchema[tuple]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Sequence[typing.Any], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> ListSchema[tuple]: + return super().__new__(cls, arg, configuration=configuration) class NoneSchema( @@ -2148,12 +2072,12 @@ class NoneSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({NoneClass}) - @classmethod - def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration) -> NoneSchema[NoneClass]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: None, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NoneSchema[NoneClass]: + return super().__new__(cls, arg, configuration=configuration) class NumberSchema( @@ -2169,12 +2093,12 @@ class NumberSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) - @classmethod - def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> NumberSchema[decimal.Decimal]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NumberSchema[decimal.Decimal]: + return super().__new__(cls, arg, configuration=configuration) class IntBase: @@ -2195,12 +2119,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int' - @classmethod - def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> IntSchema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> IntSchema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration) return typing.cast(IntSchema[decimal.Decimal], inst) @@ -2212,8 +2136,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int32' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int32Schema[decimal.Decimal], inst) @@ -2225,8 +2153,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int64' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int64Schema[decimal.Decimal], inst) @@ -2238,12 +2170,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'float' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float32Schema[decimal.Decimal], inst) @@ -2255,12 +2187,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'double' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float64Schema[decimal.Decimal], inst) @@ -2279,12 +2211,12 @@ class StrSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) - @classmethod - def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> StrSchema[str]: - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> StrSchema[str]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> StrSchema[str]: + return super().__new__(cls, arg, configuration=configuration) class UUIDSchema(UUIDBase, StrSchema[T]): @@ -2293,8 +2225,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'uuid' - def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> UUIDSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> UUIDSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(UUIDSchema[str], inst) @@ -2304,8 +2240,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date' - def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration) -> DateSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateSchema[str], inst) @@ -2315,8 +2255,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date-time' - def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration) -> DateTimeSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.datetime], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateTimeSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateTimeSchema[str], inst) @@ -2326,7 +2270,11 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'number' - def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) -> DecimalSchema[str]: + def __new__( + cls, + arg: str, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DecimalSchema[str]: """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -2335,7 +2283,7 @@ def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema where it should stay as Decimal. """ - inst = super().__new__(cls, arg_, **kwargs) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DecimalSchema[str], inst) @@ -2350,9 +2298,13 @@ class BytesSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({bytes}) - def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration) -> BytesSchema[bytes]: + def __new__( + cls, + arg: bytes, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BytesSchema[bytes]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class FileSchema( @@ -2379,9 +2331,13 @@ class FileSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({FileIO}) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration) -> FileSchema[FileIO]: + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> FileSchema[FileIO]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class BinarySchema( @@ -2398,8 +2354,12 @@ class Schema_(metaclass=SingletonMeta): FileSchema, ) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration) -> BinarySchema[typing.Union[FileIO, bytes]]: - return super().__new__(cls, arg_) + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader, bytes], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BinarySchema[typing.Union[FileIO, bytes]]: + return super().__new__(cls, arg) class BoolSchema( @@ -2411,12 +2371,12 @@ class BoolSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({BoolClass}) - @classmethod - def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: bool, **kwargs: ValidationMetadata) -> BoolSchema[bool]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: bool, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BoolSchema[bool]: + return super().__new__(cls, arg, configuration=configuration) class AnyTypeSchema( @@ -2436,7 +2396,7 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2454,26 +2414,7 @@ def __new__( io.FileIO, io.BufferedReader ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader, - Unset - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None ) -> AnyTypeSchema[typing.Union[ NoneClass, frozendict.frozendict, @@ -2482,30 +2423,11 @@ def __new__( decimal.Decimal, BoolClass ]]: - return super().__new__(cls, *args_, configuration_=configuration_, **kwargs) + return super().__new__(cls, arg, configuration=configuration) def __init__( self, - *args_: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2523,6 +2445,7 @@ def __init__( io.FileIO, io.BufferedReader ], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ this exists to override the __init__ method form FileIO in NoneFrozenDictTupleStrDecimalBoolFileBytesMixin @@ -2548,10 +2471,10 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_, - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + arg, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> NotAnyTypeSchema[T]: - inst = super().__new__(cls, *args_, configuration_=configuration_) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(NotAnyTypeSchema[T], inst) @@ -2564,17 +2487,12 @@ class DictSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({frozendict.frozendict}) - @classmethod - def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, Schema, Unset, ValidationMetadata], + arg: typing.Union[dict[str, INPUT_TYPES_ALL_INCL_SCHEMA], frozendict.frozendict[str, INPUT_TYPES_ALL_INCL_SCHEMA]], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> DictSchema[frozendict.frozendict]: - return super().__new__(cls, *args_, **kwargs, configuration_=configuration_) + return super().__new__(cls, arg, configuration=configuration) schema_type_classes = frozenset({NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py index bbb7d32ed78..5c4d7f9a44b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test__not.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema._not import _Not -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class Test_Not(unittest.TestCase): """_Not unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_allowed_passes(self): # allowed - _Not.from_openapi_data_( + _Not( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_disallowed_fails(self): # disallowed with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - _Not.from_openapi_data_( + _Not( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py index d0ce12be1db..7d194f69114 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_allows_a_schema_which_should_validate.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,27 +11,27 @@ import unit_test_api from unit_test_api.components.schema.additionalproperties_allows_a_schema_which_should_validate import AdditionalpropertiesAllowsASchemaWhichShouldValidate -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAdditionalpropertiesAllowsASchemaWhichShouldValidate(unittest.TestCase): """AdditionalpropertiesAllowsASchemaWhichShouldValidate unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_no_additional_properties_is_valid_passes(self): # no additional properties is valid - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( + AdditionalpropertiesAllowsASchemaWhichShouldValidate( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_additional_invalid_property_is_invalid_fails(self): # an additional invalid property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( + AdditionalpropertiesAllowsASchemaWhichShouldValidate( { "foo": 1, @@ -42,12 +40,12 @@ def test_an_additional_invalid_property_is_invalid_fails(self): "quux": 12, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_additional_valid_property_is_valid_passes(self): # an additional valid property is valid - AdditionalpropertiesAllowsASchemaWhichShouldValidate.from_openapi_data_( + AdditionalpropertiesAllowsASchemaWhichShouldValidate( { "foo": 1, @@ -56,7 +54,7 @@ def test_an_additional_valid_property_is_valid_passes(self): "quux": True, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py index 8709b7d9db1..0b909cd0b1c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_are_allowed_by_default.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.additionalproperties_are_allowed_by_default import AdditionalpropertiesAreAllowedByDefault -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAdditionalpropertiesAreAllowedByDefault(unittest.TestCase): """AdditionalpropertiesAreAllowedByDefault unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_additional_properties_are_allowed_passes(self): # additional properties are allowed - AdditionalpropertiesAreAllowedByDefault.from_openapi_data_( + AdditionalpropertiesAreAllowedByDefault( { "foo": 1, @@ -31,7 +29,7 @@ def test_additional_properties_are_allowed_passes(self): "quux": True, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py index eed4d864085..6bfde5e61b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_can_exist_by_itself.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.additionalproperties_can_exist_by_itself import AdditionalpropertiesCanExistByItself -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAdditionalpropertiesCanExistByItself(unittest.TestCase): """AdditionalpropertiesCanExistByItself unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_an_additional_invalid_property_is_invalid_fails(self): # an additional invalid property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesCanExistByItself.from_openapi_data_( + AdditionalpropertiesCanExistByItself( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_additional_valid_property_is_valid_passes(self): # an additional valid property is valid - AdditionalpropertiesCanExistByItself.from_openapi_data_( + AdditionalpropertiesCanExistByItself( { "foo": True, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py index 27eaf50edd4..9771b705624 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_additionalproperties_should_not_look_in_applicators.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,36 +11,36 @@ import unit_test_api from unit_test_api.components.schema.additionalproperties_should_not_look_in_applicators import AdditionalpropertiesShouldNotLookInApplicators -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAdditionalpropertiesShouldNotLookInApplicators(unittest.TestCase): """AdditionalpropertiesShouldNotLookInApplicators unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_properties_defined_in_allof_are_not_examined_fails(self): # properties defined in allOf are not examined with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_( + AdditionalpropertiesShouldNotLookInApplicators( { "foo": 1, "bar": True, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_valid_test_case_passes(self): # valid test case - AdditionalpropertiesShouldNotLookInApplicators.from_openapi_data_( + AdditionalpropertiesShouldNotLookInApplicators( { "foo": False, "bar": True, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py index eb16ed0282a..2909e6dd2e0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,58 +11,58 @@ import unit_test_api from unit_test_api.components.schema.allof import Allof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllof(unittest.TestCase): """Allof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_allof_passes(self): # allOf - Allof.from_openapi_data_( + Allof( { "foo": "baz", "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_first_fails(self): # mismatch first with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_( + Allof( { "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_second_fails(self): # mismatch second with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_( + Allof( { "foo": "baz", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_wrong_type_fails(self): # wrong type with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Allof.from_openapi_data_( + Allof( { "foo": "baz", "bar": "quux", }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py index bf527f8361a..bd73cae8077 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_combined_with_anyof_oneof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,74 +11,74 @@ import unit_test_api from unit_test_api.components.schema.allof_combined_with_anyof_oneof import AllofCombinedWithAnyofOneof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofCombinedWithAnyofOneof(unittest.TestCase): """AllofCombinedWithAnyofOneof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_allof_true_anyof_false_oneof_false_fails(self): # allOf: true, anyOf: false, oneOf: false with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 2, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_false_anyof_false_oneof_true_fails(self): # allOf: false, anyOf: false, oneOf: true with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_false_anyof_true_oneof_true_fails(self): # allOf: false, anyOf: true, oneOf: true with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 15, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_true_anyof_true_oneof_false_fails(self): # allOf: true, anyOf: true, oneOf: false with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 6, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_true_anyof_true_oneof_true_passes(self): # allOf: true, anyOf: true, oneOf: true - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 30, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_true_anyof_false_oneof_true_fails(self): # allOf: true, anyOf: false, oneOf: true with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 10, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_false_anyof_true_oneof_false_fails(self): # allOf: false, anyOf: true, oneOf: false with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 3, - configuration_=self.configuration_ + configuration=self.configuration ) def test_allof_false_anyof_false_oneof_false_fails(self): # allOf: false, anyOf: false, oneOf: false with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofCombinedWithAnyofOneof.from_openapi_data_( + AllofCombinedWithAnyofOneof( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py index 016d4576f0e..5df90b2cce7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_simple_types.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.allof_simple_types import AllofSimpleTypes -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofSimpleTypes(unittest.TestCase): """AllofSimpleTypes unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_valid_passes(self): # valid - AllofSimpleTypes.from_openapi_data_( + AllofSimpleTypes( 25, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_one_fails(self): # mismatch one with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofSimpleTypes.from_openapi_data_( + AllofSimpleTypes( 35, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py index 48715e20dcd..c6c3bda036b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_base_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.allof_with_base_schema import AllofWithBaseSchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofWithBaseSchema(unittest.TestCase): """AllofWithBaseSchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_valid_passes(self): # valid - AllofWithBaseSchema.from_openapi_data_( + AllofWithBaseSchema( { "foo": "quux", @@ -31,57 +29,57 @@ def test_valid_passes(self): "baz": None, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_first_allof_fails(self): # mismatch first allOf with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_( + AllofWithBaseSchema( { "bar": 2, "baz": None, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_base_schema_fails(self): # mismatch base schema with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_( + AllofWithBaseSchema( { "foo": "quux", "baz": None, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_both_fails(self): # mismatch both with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_( + AllofWithBaseSchema( { "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_second_allof_fails(self): # mismatch second allOf with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithBaseSchema.from_openapi_data_( + AllofWithBaseSchema( { "foo": "quux", "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py index 5244f65e2ce..4333bdce15f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_one_empty_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,18 +11,18 @@ import unit_test_api from unit_test_api.components.schema.allof_with_one_empty_schema import AllofWithOneEmptySchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofWithOneEmptySchema(unittest.TestCase): """AllofWithOneEmptySchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_any_data_is_valid_passes(self): # any data is valid - AllofWithOneEmptySchema.from_openapi_data_( + AllofWithOneEmptySchema( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py index 0fbeda18acf..3c2de516e5c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_first_empty_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.allof_with_the_first_empty_schema import AllofWithTheFirstEmptySchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofWithTheFirstEmptySchema(unittest.TestCase): """AllofWithTheFirstEmptySchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_string_is_invalid_fails(self): # string is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithTheFirstEmptySchema.from_openapi_data_( + AllofWithTheFirstEmptySchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_number_is_valid_passes(self): # number is valid - AllofWithTheFirstEmptySchema.from_openapi_data_( + AllofWithTheFirstEmptySchema( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py index 6269c24cd45..0a5d45effcd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_the_last_empty_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.allof_with_the_last_empty_schema import AllofWithTheLastEmptySchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofWithTheLastEmptySchema(unittest.TestCase): """AllofWithTheLastEmptySchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_string_is_invalid_fails(self): # string is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AllofWithTheLastEmptySchema.from_openapi_data_( + AllofWithTheLastEmptySchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_number_is_valid_passes(self): # number is valid - AllofWithTheLastEmptySchema.from_openapi_data_( + AllofWithTheLastEmptySchema( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py index 804c23dec52..2fda31cc249 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_allof_with_two_empty_schemas.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,18 +11,18 @@ import unit_test_api from unit_test_api.components.schema.allof_with_two_empty_schemas import AllofWithTwoEmptySchemas -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAllofWithTwoEmptySchemas(unittest.TestCase): """AllofWithTwoEmptySchemas unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_any_data_is_valid_passes(self): # any data is valid - AllofWithTwoEmptySchemas.from_openapi_data_( + AllofWithTwoEmptySchemas( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py index da1014d45e9..c6f3990113b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,40 +11,40 @@ import unit_test_api from unit_test_api.components.schema.anyof import Anyof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAnyof(unittest.TestCase): """Anyof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_second_anyof_valid_passes(self): # second anyOf valid - Anyof.from_openapi_data_( + Anyof( 2.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_neither_anyof_valid_fails(self): # neither anyOf valid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Anyof.from_openapi_data_( + Anyof( 1.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_anyof_valid_passes(self): # both anyOf valid - Anyof.from_openapi_data_( + Anyof( 3, - configuration_=self.configuration_ + configuration=self.configuration ) def test_first_anyof_valid_passes(self): # first anyOf valid - Anyof.from_openapi_data_( + Anyof( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py index 0c4891de94c..3452c368e98 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_complex_types.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,56 +11,56 @@ import unit_test_api from unit_test_api.components.schema.anyof_complex_types import AnyofComplexTypes -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAnyofComplexTypes(unittest.TestCase): """AnyofComplexTypes unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_second_anyof_valid_complex_passes(self): # second anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_( + AnyofComplexTypes( { "foo": "baz", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_neither_anyof_valid_complex_fails(self): # neither anyOf valid (complex) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofComplexTypes.from_openapi_data_( + AnyofComplexTypes( { "foo": 2, "bar": "quux", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_anyof_valid_complex_passes(self): # both anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_( + AnyofComplexTypes( { "foo": "baz", "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_first_anyof_valid_complex_passes(self): # first anyOf valid (complex) - AnyofComplexTypes.from_openapi_data_( + AnyofComplexTypes( { "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py index 0440a3ce9a0..af11fbbe3c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_base_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,34 +11,34 @@ import unit_test_api from unit_test_api.components.schema.anyof_with_base_schema import AnyofWithBaseSchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAnyofWithBaseSchema(unittest.TestCase): """AnyofWithBaseSchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_one_anyof_valid_passes(self): # one anyOf valid - AnyofWithBaseSchema.from_openapi_data_( + AnyofWithBaseSchema( "foobar", - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_anyof_invalid_fails(self): # both anyOf invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofWithBaseSchema.from_openapi_data_( + AnyofWithBaseSchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_base_schema_fails(self): # mismatch base schema with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - AnyofWithBaseSchema.from_openapi_data_( + AnyofWithBaseSchema( 3, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py index c46f62e9c38..a87c3b6ea8f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_anyof_with_one_empty_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,25 +11,25 @@ import unit_test_api from unit_test_api.components.schema.anyof_with_one_empty_schema import AnyofWithOneEmptySchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestAnyofWithOneEmptySchema(unittest.TestCase): """AnyofWithOneEmptySchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_string_is_valid_passes(self): # string is valid - AnyofWithOneEmptySchema.from_openapi_data_( + AnyofWithOneEmptySchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_number_is_valid_passes(self): # number is valid - AnyofWithOneEmptySchema.from_openapi_data_( + AnyofWithOneEmptySchema( 123, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py index a087a7fa3af..f07feeeaa5e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_array_type_matches_arrays.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,68 +11,68 @@ import unit_test_api from unit_test_api.components.schema.array_type_matches_arrays import ArrayTypeMatchesArrays -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestArrayTypeMatchesArrays(unittest.TestCase): """ArrayTypeMatchesArrays unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_a_float_is_not_an_array_fails(self): # a float is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_boolean_is_not_an_array_fails(self): # a boolean is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_an_array_fails(self): # null is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_not_an_array_fails(self): # an object is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_an_array_fails(self): # a string is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_an_array_passes(self): # an array is an array - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_not_an_array_fails(self): # an integer is not an array with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ArrayTypeMatchesArrays.from_openapi_data_( + ArrayTypeMatchesArrays( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py index b12796d3b31..e60a9d7c0ca 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_boolean_type_matches_booleans.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,91 +11,91 @@ import unit_test_api from unit_test_api.components.schema.boolean_type_matches_booleans import BooleanTypeMatchesBooleans -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestBooleanTypeMatchesBooleans(unittest.TestCase): """BooleanTypeMatchesBooleans unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_an_empty_string_is_not_a_boolean_fails(self): # an empty string is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_is_not_a_boolean_fails(self): # a float is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_a_boolean_fails(self): # null is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_zero_is_not_a_boolean_fails(self): # zero is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( 0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_not_a_boolean_fails(self): # an array is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_a_boolean_fails(self): # a string is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_false_is_a_boolean_passes(self): # false is a boolean - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_not_a_boolean_fails(self): # an integer is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_true_is_a_boolean_passes(self): # true is a boolean - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_not_a_boolean_fails(self): # an object is not a boolean with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BooleanTypeMatchesBooleans.from_openapi_data_( + BooleanTypeMatchesBooleans( { }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py index 7a8030a869f..3bb0be29ea8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_int.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,33 +11,33 @@ import unit_test_api from unit_test_api.components.schema.by_int import ByInt -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestByInt(unittest.TestCase): """ByInt unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_int_by_int_fail_fails(self): # int by int fail with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ByInt.from_openapi_data_( + ByInt( 7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_int_by_int_passes(self): # int by int - ByInt.from_openapi_data_( + ByInt( 10, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_numbers_passes(self): # ignores non-numbers - ByInt.from_openapi_data_( + ByInt( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py index db65c18d414..385672f5e5e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_number.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,33 +11,33 @@ import unit_test_api from unit_test_api.components.schema.by_number import ByNumber -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestByNumber(unittest.TestCase): """ByNumber unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_45_is_multiple_of15_passes(self): # 4.5 is multiple of 1.5 - ByNumber.from_openapi_data_( + ByNumber( 4.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_35_is_not_multiple_of15_fails(self): # 35 is not multiple of 1.5 with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ByNumber.from_openapi_data_( + ByNumber( 35, - configuration_=self.configuration_ + configuration=self.configuration ) def test_zero_is_multiple_of_anything_passes(self): # zero is multiple of anything - ByNumber.from_openapi_data_( + ByNumber( 0, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py index aa6eb5afa11..7db55b34e1f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_by_small_number.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.by_small_number import BySmallNumber -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestBySmallNumber(unittest.TestCase): """BySmallNumber unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_000751_is_not_multiple_of00001_fails(self): # 0.00751 is not multiple of 0.0001 with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - BySmallNumber.from_openapi_data_( + BySmallNumber( 0.00751, - configuration_=self.configuration_ + configuration=self.configuration ) def test_00075_is_multiple_of00001_passes(self): # 0.0075 is multiple of 0.0001 - BySmallNumber.from_openapi_data_( + BySmallNumber( 0.0075, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py index a9c14bed53e..a2baa8c5e72 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_date_time_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.date_time_format import DateTimeFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestDateTimeFormat(unittest.TestCase): """DateTimeFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - DateTimeFormat.from_openapi_data_( + DateTimeFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - DateTimeFormat.from_openapi_data_( + DateTimeFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - DateTimeFormat.from_openapi_data_( + DateTimeFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - DateTimeFormat.from_openapi_data_( + DateTimeFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - DateTimeFormat.from_openapi_data_( + DateTimeFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - DateTimeFormat.from_openapi_data_( + DateTimeFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py index 1c30f9a17b3..0b0ef44fe4a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_email_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.email_format import EmailFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEmailFormat(unittest.TestCase): """EmailFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - EmailFormat.from_openapi_data_( + EmailFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - EmailFormat.from_openapi_data_( + EmailFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - EmailFormat.from_openapi_data_( + EmailFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - EmailFormat.from_openapi_data_( + EmailFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - EmailFormat.from_openapi_data_( + EmailFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - EmailFormat.from_openapi_data_( + EmailFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py index 3f63ae781b1..4b42d9600ab 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with0_does_not_match_false.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,33 +11,33 @@ import unit_test_api from unit_test_api.components.schema.enum_with0_does_not_match_false import EnumWith0DoesNotMatchFalse -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumWith0DoesNotMatchFalse(unittest.TestCase): """EnumWith0DoesNotMatchFalse unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_integer_zero_is_valid_passes(self): # integer zero is valid - EnumWith0DoesNotMatchFalse.from_openapi_data_( + EnumWith0DoesNotMatchFalse( 0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_float_zero_is_valid_passes(self): # float zero is valid - EnumWith0DoesNotMatchFalse.from_openapi_data_( + EnumWith0DoesNotMatchFalse( 0.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_false_is_invalid_fails(self): # false is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWith0DoesNotMatchFalse.from_openapi_data_( + EnumWith0DoesNotMatchFalse( False, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py index ca8b10ad53e..d28985e2fc4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with1_does_not_match_true.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,33 +11,33 @@ import unit_test_api from unit_test_api.components.schema.enum_with1_does_not_match_true import EnumWith1DoesNotMatchTrue -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumWith1DoesNotMatchTrue(unittest.TestCase): """EnumWith1DoesNotMatchTrue unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_true_is_invalid_fails(self): # true is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWith1DoesNotMatchTrue.from_openapi_data_( + EnumWith1DoesNotMatchTrue( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_integer_one_is_valid_passes(self): # integer one is valid - EnumWith1DoesNotMatchTrue.from_openapi_data_( + EnumWith1DoesNotMatchTrue( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_float_one_is_valid_passes(self): # float one is valid - EnumWith1DoesNotMatchTrue.from_openapi_data_( + EnumWith1DoesNotMatchTrue( 1.0, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py index aef87626eaf..e4d6e83bc60 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_escaped_characters.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,33 +11,33 @@ import unit_test_api from unit_test_api.components.schema.enum_with_escaped_characters import EnumWithEscapedCharacters -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumWithEscapedCharacters(unittest.TestCase): """EnumWithEscapedCharacters unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_member2_is_valid_passes(self): # member 2 is valid - EnumWithEscapedCharacters.from_openapi_data_( + EnumWithEscapedCharacters( "foo\rbar", - configuration_=self.configuration_ + configuration=self.configuration ) def test_member1_is_valid_passes(self): # member 1 is valid - EnumWithEscapedCharacters.from_openapi_data_( + EnumWithEscapedCharacters( "foo\nbar", - configuration_=self.configuration_ + configuration=self.configuration ) def test_another_string_is_invalid_fails(self): # another string is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithEscapedCharacters.from_openapi_data_( + EnumWithEscapedCharacters( "abc", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py index f220f2dbe40..0a7748bbe52 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_false_does_not_match0.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,34 +11,34 @@ import unit_test_api from unit_test_api.components.schema.enum_with_false_does_not_match0 import EnumWithFalseDoesNotMatch0 -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumWithFalseDoesNotMatch0(unittest.TestCase): """EnumWithFalseDoesNotMatch0 unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_false_is_valid_passes(self): # false is valid - EnumWithFalseDoesNotMatch0.from_openapi_data_( + EnumWithFalseDoesNotMatch0( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_float_zero_is_invalid_fails(self): # float zero is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithFalseDoesNotMatch0.from_openapi_data_( + EnumWithFalseDoesNotMatch0( 0.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_integer_zero_is_invalid_fails(self): # integer zero is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithFalseDoesNotMatch0.from_openapi_data_( + EnumWithFalseDoesNotMatch0( 0, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py index 1a0d4ebad27..d86f6df2ef4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enum_with_true_does_not_match1.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,34 +11,34 @@ import unit_test_api from unit_test_api.components.schema.enum_with_true_does_not_match1 import EnumWithTrueDoesNotMatch1 -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumWithTrueDoesNotMatch1(unittest.TestCase): """EnumWithTrueDoesNotMatch1 unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_float_one_is_invalid_fails(self): # float one is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithTrueDoesNotMatch1.from_openapi_data_( + EnumWithTrueDoesNotMatch1( 1.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_true_is_valid_passes(self): # true is valid - EnumWithTrueDoesNotMatch1.from_openapi_data_( + EnumWithTrueDoesNotMatch1( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_integer_one_is_invalid_fails(self): # integer one is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumWithTrueDoesNotMatch1.from_openapi_data_( + EnumWithTrueDoesNotMatch1( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py index 8d5b30a54c1..3ca3692fd27 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_enums_in_properties.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,79 +11,79 @@ import unit_test_api from unit_test_api.components.schema.enums_in_properties import EnumsInProperties -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestEnumsInProperties(unittest.TestCase): """EnumsInProperties unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_missing_optional_property_is_valid_passes(self): # missing optional property is valid - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { "bar": "bar", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_wrong_foo_value_fails(self): # wrong foo value with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { "foo": "foot", "bar": "bar", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_properties_are_valid_passes(self): # both properties are valid - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { "foo": "foo", "bar": "bar", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_wrong_bar_value_fails(self): # wrong bar value with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { "foo": "foo", "bar": "bart", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_missing_all_properties_is_invalid_fails(self): # missing all properties is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_missing_required_property_is_invalid_fails(self): # missing required property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - EnumsInProperties.from_openapi_data_( + EnumsInProperties( { "foo": "foo", }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py index cff830e09dc..ea1ace820f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_forbidden_property.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,36 +11,36 @@ import unit_test_api from unit_test_api.components.schema.forbidden_property import ForbiddenProperty -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestForbiddenProperty(unittest.TestCase): """ForbiddenProperty unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_present_fails(self): # property present with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ForbiddenProperty.from_openapi_data_( + ForbiddenProperty( { "foo": 1, "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_absent_passes(self): # property absent - ForbiddenProperty.from_openapi_data_( + ForbiddenProperty( { "bar": 1, "baz": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py index 362faa86f05..00cc8c35d76 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_hostname_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.hostname_format import HostnameFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestHostnameFormat(unittest.TestCase): """HostnameFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - HostnameFormat.from_openapi_data_( + HostnameFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - HostnameFormat.from_openapi_data_( + HostnameFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - HostnameFormat.from_openapi_data_( + HostnameFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - HostnameFormat.from_openapi_data_( + HostnameFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - HostnameFormat.from_openapi_data_( + HostnameFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - HostnameFormat.from_openapi_data_( + HostnameFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py index ef95b0c43be..6c79363cf6e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_integer_type_matches_integers.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,83 +11,83 @@ import unit_test_api from unit_test_api.components.schema.integer_type_matches_integers import IntegerTypeMatchesIntegers -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestIntegerTypeMatchesIntegers(unittest.TestCase): """IntegerTypeMatchesIntegers unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_an_object_is_not_an_integer_fails(self): # an object is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_an_integer_fails(self): # a string is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_an_integer_fails(self): # null is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): # a float with zero fractional part is an integer - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( 1.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_is_not_an_integer_fails(self): # a float is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_boolean_is_not_an_integer_fails(self): # a boolean is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_an_integer_passes(self): # an integer is an integer - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): # a string is still not an integer, even if it looks like one with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( "1", - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_not_an_integer_fails(self): # an array is not an integer with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - IntegerTypeMatchesIntegers.from_openapi_data_( + IntegerTypeMatchesIntegers( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py index b64ade95373..208dd277224 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_instance_should_not_raise_error_when_float_division_inf.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.invalid_instance_should_not_raise_error_when_float_division_inf import InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestInvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf(unittest.TestCase): """InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fails(self): # always invalid, but naive implementations may raise an overflow error with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_( + InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( 1.0E308, - configuration_=self.configuration_ + configuration=self.configuration ) def test_valid_integer_with_multipleof_float_passes(self): # valid integer with multipleOf float - InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf.from_openapi_data_( + InvalidInstanceShouldNotRaiseErrorWhenFloatDivisionInf( 123456789, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py index 4fd17ddd242..d7a862fef82 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_invalid_string_value_for_default.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,29 +11,29 @@ import unit_test_api from unit_test_api.components.schema.invalid_string_value_for_default import InvalidStringValueForDefault -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestInvalidStringValueForDefault(unittest.TestCase): """InvalidStringValueForDefault unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_valid_when_property_is_specified_passes(self): # valid when property is specified - InvalidStringValueForDefault.from_openapi_data_( + InvalidStringValueForDefault( { "bar": "good", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_still_valid_when_the_invalid_default_is_used_passes(self): # still valid when the invalid default is used - InvalidStringValueForDefault.from_openapi_data_( + InvalidStringValueForDefault( { }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py index e9587042749..fc35328df9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv4_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.ipv4_format import Ipv4Format -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestIpv4Format(unittest.TestCase): """Ipv4Format unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - Ipv4Format.from_openapi_data_( + Ipv4Format( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - Ipv4Format.from_openapi_data_( + Ipv4Format( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - Ipv4Format.from_openapi_data_( + Ipv4Format( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - Ipv4Format.from_openapi_data_( + Ipv4Format( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - Ipv4Format.from_openapi_data_( + Ipv4Format( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - Ipv4Format.from_openapi_data_( + Ipv4Format( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py index 007df1984f6..06194738181 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ipv6_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.ipv6_format import Ipv6Format -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestIpv6Format(unittest.TestCase): """Ipv6Format unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - Ipv6Format.from_openapi_data_( + Ipv6Format( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - Ipv6Format.from_openapi_data_( + Ipv6Format( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - Ipv6Format.from_openapi_data_( + Ipv6Format( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - Ipv6Format.from_openapi_data_( + Ipv6Format( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - Ipv6Format.from_openapi_data_( + Ipv6Format( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - Ipv6Format.from_openapi_data_( + Ipv6Format( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py index bfa9ba29028..7a8ed396c26 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_json_pointer_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.json_pointer_format import JsonPointerFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestJsonPointerFormat(unittest.TestCase): """JsonPointerFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - JsonPointerFormat.from_openapi_data_( + JsonPointerFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py index b845b1cef97..307816539bd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,40 +11,40 @@ import unit_test_api from unit_test_api.components.schema.maximum_validation import MaximumValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaximumValidation(unittest.TestCase): """MaximumValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_below_the_maximum_is_valid_passes(self): # below the maximum is valid - MaximumValidation.from_openapi_data_( + MaximumValidation( 2.6, - configuration_=self.configuration_ + configuration=self.configuration ) def test_boundary_point_is_valid_passes(self): # boundary point is valid - MaximumValidation.from_openapi_data_( + MaximumValidation( 3.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_above_the_maximum_is_invalid_fails(self): # above the maximum is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaximumValidation.from_openapi_data_( + MaximumValidation( 3.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_numbers_passes(self): # ignores non-numbers - MaximumValidation.from_openapi_data_( + MaximumValidation( "x", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py index f4bcfb9bbbc..0da49190b8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maximum_validation_with_unsigned_integer.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,40 +11,40 @@ import unit_test_api from unit_test_api.components.schema.maximum_validation_with_unsigned_integer import MaximumValidationWithUnsignedInteger -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaximumValidationWithUnsignedInteger(unittest.TestCase): """MaximumValidationWithUnsignedInteger unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_below_the_maximum_is_invalid_passes(self): # below the maximum is invalid - MaximumValidationWithUnsignedInteger.from_openapi_data_( + MaximumValidationWithUnsignedInteger( 299.97, - configuration_=self.configuration_ + configuration=self.configuration ) def test_above_the_maximum_is_invalid_fails(self): # above the maximum is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaximumValidationWithUnsignedInteger.from_openapi_data_( + MaximumValidationWithUnsignedInteger( 300.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_boundary_point_integer_is_valid_passes(self): # boundary point integer is valid - MaximumValidationWithUnsignedInteger.from_openapi_data_( + MaximumValidationWithUnsignedInteger( 300, - configuration_=self.configuration_ + configuration=self.configuration ) def test_boundary_point_float_is_valid_passes(self): # boundary point float is valid - MaximumValidationWithUnsignedInteger.from_openapi_data_( + MaximumValidationWithUnsignedInteger( 300.0, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py index 2ca30ca1ae9..00f90826033 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxitems_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,49 +11,49 @@ import unit_test_api from unit_test_api.components.schema.maxitems_validation import MaxitemsValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaxitemsValidation(unittest.TestCase): """MaxitemsValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_too_long_is_invalid_fails(self): # too long is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxitemsValidation.from_openapi_data_( + MaxitemsValidation( [ 1, 2, 3, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_arrays_passes(self): # ignores non-arrays - MaxitemsValidation.from_openapi_data_( + MaxitemsValidation( "foobar", - configuration_=self.configuration_ + configuration=self.configuration ) def test_shorter_is_valid_passes(self): # shorter is valid - MaxitemsValidation.from_openapi_data_( + MaxitemsValidation( [ 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MaxitemsValidation.from_openapi_data_( + MaxitemsValidation( [ 1, 2, ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py index 37c6c376580..3642b160502 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxlength_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,47 +11,47 @@ import unit_test_api from unit_test_api.components.schema.maxlength_validation import MaxlengthValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaxlengthValidation(unittest.TestCase): """MaxlengthValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_too_long_is_invalid_fails(self): # too long is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxlengthValidation.from_openapi_data_( + MaxlengthValidation( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_strings_passes(self): # ignores non-strings - MaxlengthValidation.from_openapi_data_( + MaxlengthValidation( 100, - configuration_=self.configuration_ + configuration=self.configuration ) def test_shorter_is_valid_passes(self): # shorter is valid - MaxlengthValidation.from_openapi_data_( + MaxlengthValidation( "f", - configuration_=self.configuration_ + configuration=self.configuration ) def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): # two supplementary Unicode code points is long enough - MaxlengthValidation.from_openapi_data_( + MaxlengthValidation( "💩💩", - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MaxlengthValidation.from_openapi_data_( + MaxlengthValidation( "fo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py index 7d15b4a8c56..040d6fce4a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties0_means_the_object_is_empty.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,30 +11,30 @@ import unit_test_api from unit_test_api.components.schema.maxproperties0_means_the_object_is_empty import Maxproperties0MeansTheObjectIsEmpty -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaxproperties0MeansTheObjectIsEmpty(unittest.TestCase): """Maxproperties0MeansTheObjectIsEmpty unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_no_properties_is_valid_passes(self): # no properties is valid - Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_( + Maxproperties0MeansTheObjectIsEmpty( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_property_is_invalid_fails(self): # one property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Maxproperties0MeansTheObjectIsEmpty.from_openapi_data_( + Maxproperties0MeansTheObjectIsEmpty( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py index 58feb9cda40..6e541c1cfd2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_maxproperties_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,17 +11,17 @@ import unit_test_api from unit_test_api.components.schema.maxproperties_validation import MaxpropertiesValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMaxpropertiesValidation(unittest.TestCase): """MaxpropertiesValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_too_long_is_invalid_fails(self): # too long is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( { "foo": 1, @@ -32,54 +30,54 @@ def test_too_long_is_invalid_fails(self): "baz": 3, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_arrays_passes(self): # ignores arrays - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( [ 1, 2, 3, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_other_non_objects_passes(self): # ignores other non-objects - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_strings_passes(self): # ignores strings - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( "foobar", - configuration_=self.configuration_ + configuration=self.configuration ) def test_shorter_is_valid_passes(self): # shorter is valid - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MaxpropertiesValidation.from_openapi_data_( + MaxpropertiesValidation( { "foo": 1, "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py index 67276896b3c..4293444164e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,40 +11,40 @@ import unit_test_api from unit_test_api.components.schema.minimum_validation import MinimumValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMinimumValidation(unittest.TestCase): """MinimumValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_boundary_point_is_valid_passes(self): # boundary point is valid - MinimumValidation.from_openapi_data_( + MinimumValidation( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_below_the_minimum_is_invalid_fails(self): # below the minimum is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidation.from_openapi_data_( + MinimumValidation( 0.6, - configuration_=self.configuration_ + configuration=self.configuration ) def test_above_the_minimum_is_valid_passes(self): # above the minimum is valid - MinimumValidation.from_openapi_data_( + MinimumValidation( 2.6, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_numbers_passes(self): # ignores non-numbers - MinimumValidation.from_openapi_data_( + MinimumValidation( "x", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py index a8876922664..c1c64a6c177 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minimum_validation_with_signed_integer.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,62 +11,62 @@ import unit_test_api from unit_test_api.components.schema.minimum_validation_with_signed_integer import MinimumValidationWithSignedInteger -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMinimumValidationWithSignedInteger(unittest.TestCase): """MinimumValidationWithSignedInteger unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_boundary_point_is_valid_passes(self): # boundary point is valid - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( -2, - configuration_=self.configuration_ + configuration=self.configuration ) def test_positive_above_the_minimum_is_valid_passes(self): # positive above the minimum is valid - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( 0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_int_below_the_minimum_is_invalid_fails(self): # int below the minimum is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( -3, - configuration_=self.configuration_ + configuration=self.configuration ) def test_float_below_the_minimum_is_invalid_fails(self): # float below the minimum is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( -2.0001, - configuration_=self.configuration_ + configuration=self.configuration ) def test_boundary_point_with_float_is_valid_passes(self): # boundary point with float is valid - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( -2.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_negative_above_the_minimum_is_valid_passes(self): # negative above the minimum is valid - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( -1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_numbers_passes(self): # ignores non-numbers - MinimumValidationWithSignedInteger.from_openapi_data_( + MinimumValidationWithSignedInteger( "x", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py index 3c91561e849..dbc288325d1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minitems_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,46 +11,46 @@ import unit_test_api from unit_test_api.components.schema.minitems_validation import MinitemsValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMinitemsValidation(unittest.TestCase): """MinitemsValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_too_short_is_invalid_fails(self): # too short is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinitemsValidation.from_openapi_data_( + MinitemsValidation( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_arrays_passes(self): # ignores non-arrays - MinitemsValidation.from_openapi_data_( + MinitemsValidation( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_longer_is_valid_passes(self): # longer is valid - MinitemsValidation.from_openapi_data_( + MinitemsValidation( [ 1, 2, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MinitemsValidation.from_openapi_data_( + MinitemsValidation( [ 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py index 80e3b7be614..1aaec9fa53f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minlength_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,48 +11,48 @@ import unit_test_api from unit_test_api.components.schema.minlength_validation import MinlengthValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMinlengthValidation(unittest.TestCase): """MinlengthValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_too_short_is_invalid_fails(self): # too short is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinlengthValidation.from_openapi_data_( + MinlengthValidation( "f", - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): # one supplementary Unicode code point is not long enough with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinlengthValidation.from_openapi_data_( + MinlengthValidation( "💩", - configuration_=self.configuration_ + configuration=self.configuration ) def test_longer_is_valid_passes(self): # longer is valid - MinlengthValidation.from_openapi_data_( + MinlengthValidation( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_non_strings_passes(self): # ignores non-strings - MinlengthValidation.from_openapi_data_( + MinlengthValidation( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MinlengthValidation.from_openapi_data_( + MinlengthValidation( "fo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py index b2b1bcb79e9..3ad32392c08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_minproperties_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,64 +11,64 @@ import unit_test_api from unit_test_api.components.schema.minproperties_validation import MinpropertiesValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestMinpropertiesValidation(unittest.TestCase): """MinpropertiesValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_ignores_arrays_passes(self): # ignores arrays - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_other_non_objects_passes(self): # ignores other non-objects - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_too_short_is_invalid_fails(self): # too short is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_strings_passes(self): # ignores strings - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_longer_is_valid_passes(self): # longer is valid - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( { "foo": 1, "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_exact_length_is_valid_passes(self): # exact length is valid - MinpropertiesValidation.from_openapi_data_( + MinpropertiesValidation( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py index 76bb018b0ea..0c521cbc65c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_allof_to_check_validation_semantics.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.nested_allof_to_check_validation_semantics import NestedAllofToCheckValidationSemantics -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNestedAllofToCheckValidationSemantics(unittest.TestCase): """NestedAllofToCheckValidationSemantics unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedAllofToCheckValidationSemantics.from_openapi_data_( + NestedAllofToCheckValidationSemantics( 123, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_valid_passes(self): # null is valid - NestedAllofToCheckValidationSemantics.from_openapi_data_( + NestedAllofToCheckValidationSemantics( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py index 256ff75148d..3fb3e2a00db 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_anyof_to_check_validation_semantics.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.nested_anyof_to_check_validation_semantics import NestedAnyofToCheckValidationSemantics -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNestedAnyofToCheckValidationSemantics(unittest.TestCase): """NestedAnyofToCheckValidationSemantics unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedAnyofToCheckValidationSemantics.from_openapi_data_( + NestedAnyofToCheckValidationSemantics( 123, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_valid_passes(self): # null is valid - NestedAnyofToCheckValidationSemantics.from_openapi_data_( + NestedAnyofToCheckValidationSemantics( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py index e9a41474070..d1f75dfa0d8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_items.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.nested_items import NestedItems -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNestedItems(unittest.TestCase): """NestedItems unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_valid_nested_array_passes(self): # valid nested array - NestedItems.from_openapi_data_( + NestedItems( [ [ [ @@ -53,13 +51,13 @@ def test_valid_nested_array_passes(self): ], ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_nested_array_with_invalid_type_fails(self): # nested array with invalid type with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedItems.from_openapi_data_( + NestedItems( [ [ [ @@ -90,13 +88,13 @@ def test_nested_array_with_invalid_type_fails(self): ], ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_not_deep_enough_fails(self): # not deep enough with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedItems.from_openapi_data_( + NestedItems( [ [ [ @@ -121,7 +119,7 @@ def test_not_deep_enough_fails(self): ], ], ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py index 3aa3e36853c..d401dede4a5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nested_oneof_to_check_validation_semantics.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.nested_oneof_to_check_validation_semantics import NestedOneofToCheckValidationSemantics -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNestedOneofToCheckValidationSemantics(unittest.TestCase): """NestedOneofToCheckValidationSemantics unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_anything_non_null_is_invalid_fails(self): # anything non-null is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NestedOneofToCheckValidationSemantics.from_openapi_data_( + NestedOneofToCheckValidationSemantics( 123, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_valid_passes(self): # null is valid - NestedOneofToCheckValidationSemantics.from_openapi_data_( + NestedOneofToCheckValidationSemantics( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py index b97514dfaf1..77e82c3d5e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_not_more_complex_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,39 +11,39 @@ import unit_test_api from unit_test_api.components.schema.not_more_complex_schema import NotMoreComplexSchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNotMoreComplexSchema(unittest.TestCase): """NotMoreComplexSchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_other_match_passes(self): # other match - NotMoreComplexSchema.from_openapi_data_( + NotMoreComplexSchema( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_fails(self): # mismatch with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NotMoreComplexSchema.from_openapi_data_( + NotMoreComplexSchema( { "foo": "bar", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_match_passes(self): # match - NotMoreComplexSchema.from_openapi_data_( + NotMoreComplexSchema( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py index befdb3a1112..96b500d829c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_nul_characters_in_strings.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.nul_characters_in_strings import NulCharactersInStrings -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNulCharactersInStrings(unittest.TestCase): """NulCharactersInStrings unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_match_string_with_nul_passes(self): # match string with nul - NulCharactersInStrings.from_openapi_data_( + NulCharactersInStrings( "hello\x00there", - configuration_=self.configuration_ + configuration=self.configuration ) def test_do_not_match_string_lacking_nul_fails(self): # do not match string lacking nul with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NulCharactersInStrings.from_openapi_data_( + NulCharactersInStrings( "hellothere", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py index e030f14e354..6e7444a4ad7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_null_type_matches_only_the_null_object.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,92 +11,92 @@ import unit_test_api from unit_test_api.components.schema.null_type_matches_only_the_null_object import NullTypeMatchesOnlyTheNullObject -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNullTypeMatchesOnlyTheNullObject(unittest.TestCase): """NullTypeMatchesOnlyTheNullObject unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_a_float_is_not_null_fails(self): # a float is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_not_null_fails(self): # an object is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_false_is_not_null_fails(self): # false is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_not_null_fails(self): # an integer is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_true_is_not_null_fails(self): # true is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_zero_is_not_null_fails(self): # zero is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( 0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_empty_string_is_not_null_fails(self): # an empty string is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_null_passes(self): # null is null - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_not_null_fails(self): # an array is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_null_fails(self): # a string is not null with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NullTypeMatchesOnlyTheNullObject.from_openapi_data_( + NullTypeMatchesOnlyTheNullObject( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py index 5d988552074..cdd52194961 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_number_type_matches_numbers.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,82 +11,82 @@ import unit_test_api from unit_test_api.components.schema.number_type_matches_numbers import NumberTypeMatchesNumbers -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestNumberTypeMatchesNumbers(unittest.TestCase): """NumberTypeMatchesNumbers unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_an_array_is_not_a_number_fails(self): # an array is not a number with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_a_number_fails(self): # null is not a number with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_not_a_number_fails(self): # an object is not a number with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_boolean_is_not_a_number_fails(self): # a boolean is not a number with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_is_a_number_passes(self): # a float is a number - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): # a string is still not a number, even if it looks like one with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( "1", - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_a_number_fails(self): # a string is not a number with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_a_number_passes(self): # an integer is a number - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(self): # a float with zero fractional part is a number (and an integer) - NumberTypeMatchesNumbers.from_openapi_data_( + NumberTypeMatchesNumbers( 1.0, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py index 9ae135d0b43..e29a58f0fc0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_properties_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.object_properties_validation import ObjectPropertiesValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestObjectPropertiesValidation(unittest.TestCase): """ObjectPropertiesValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_ignores_arrays_passes(self): # ignores arrays - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_other_non_objects_passes(self): # ignores other non-objects - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_property_invalid_is_invalid_fails(self): # one property invalid is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( { "foo": 1, @@ -46,36 +44,36 @@ def test_one_property_invalid_is_invalid_fails(self): { }, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_properties_present_and_valid_is_valid_passes(self): # both properties present and valid is valid - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( { "foo": 1, "bar": "baz", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_doesn_t_invalidate_other_properties_passes(self): # doesn't invalidate other properties - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( { "quux": [ ], }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_properties_invalid_is_invalid_fails(self): # both properties invalid is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectPropertiesValidation.from_openapi_data_( + ObjectPropertiesValidation( { "foo": [ @@ -84,7 +82,7 @@ def test_both_properties_invalid_is_invalid_fails(self): { }, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py index fd1b8d59be9..8b3e1f04070 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_object_type_matches_objects.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,68 +11,68 @@ import unit_test_api from unit_test_api.components.schema.object_type_matches_objects import ObjectTypeMatchesObjects -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestObjectTypeMatchesObjects(unittest.TestCase): """ObjectTypeMatchesObjects unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_a_float_is_not_an_object_fails(self): # a float is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_an_object_fails(self): # null is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_not_an_object_fails(self): # an array is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_an_object_passes(self): # an object is an object - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_not_an_object_fails(self): # a string is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_integer_is_not_an_object_fails(self): # an integer is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_boolean_is_not_an_object_fails(self): # a boolean is not an object with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - ObjectTypeMatchesObjects.from_openapi_data_( + ObjectTypeMatchesObjects( True, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py index ed0cd687433..39e20fe9d54 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,41 +11,41 @@ import unit_test_api from unit_test_api.components.schema.oneof import Oneof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestOneof(unittest.TestCase): """Oneof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_second_oneof_valid_passes(self): # second oneOf valid - Oneof.from_openapi_data_( + Oneof( 2.5, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_oneof_valid_fails(self): # both oneOf valid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Oneof.from_openapi_data_( + Oneof( 3, - configuration_=self.configuration_ + configuration=self.configuration ) def test_first_oneof_valid_passes(self): # first oneOf valid - Oneof.from_openapi_data_( + Oneof( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_neither_oneof_valid_fails(self): # neither oneOf valid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - Oneof.from_openapi_data_( + Oneof( 1.5, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py index 991d4249643..0dfa568aee3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_complex_types.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,57 +11,57 @@ import unit_test_api from unit_test_api.components.schema.oneof_complex_types import OneofComplexTypes -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestOneofComplexTypes(unittest.TestCase): """OneofComplexTypes unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_first_oneof_valid_complex_passes(self): # first oneOf valid (complex) - OneofComplexTypes.from_openapi_data_( + OneofComplexTypes( { "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_neither_oneof_valid_complex_fails(self): # neither oneOf valid (complex) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofComplexTypes.from_openapi_data_( + OneofComplexTypes( { "foo": 2, "bar": "quux", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_oneof_valid_complex_fails(self): # both oneOf valid (complex) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofComplexTypes.from_openapi_data_( + OneofComplexTypes( { "foo": "baz", "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_second_oneof_valid_complex_passes(self): # second oneOf valid (complex) - OneofComplexTypes.from_openapi_data_( + OneofComplexTypes( { "foo": "baz", }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py index b96c587cc36..826ca821b33 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_base_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,34 +11,34 @@ import unit_test_api from unit_test_api.components.schema.oneof_with_base_schema import OneofWithBaseSchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestOneofWithBaseSchema(unittest.TestCase): """OneofWithBaseSchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_both_oneof_valid_fails(self): # both oneOf valid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithBaseSchema.from_openapi_data_( + OneofWithBaseSchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) def test_mismatch_base_schema_fails(self): # mismatch base schema with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithBaseSchema.from_openapi_data_( + OneofWithBaseSchema( 3, - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_oneof_valid_passes(self): # one oneOf valid - OneofWithBaseSchema.from_openapi_data_( + OneofWithBaseSchema( "foobar", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py index 67d55ec667a..b82515c385a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_empty_schema.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.oneof_with_empty_schema import OneofWithEmptySchema -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestOneofWithEmptySchema(unittest.TestCase): """OneofWithEmptySchema unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_both_valid_invalid_fails(self): # both valid - invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithEmptySchema.from_openapi_data_( + OneofWithEmptySchema( 123, - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_valid_valid_passes(self): # one valid - valid - OneofWithEmptySchema.from_openapi_data_( + OneofWithEmptySchema( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py index 966783764c3..77f3fe36f1e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_oneof_with_required.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,17 +11,17 @@ import unit_test_api from unit_test_api.components.schema.oneof_with_required import OneofWithRequired -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestOneofWithRequired(unittest.TestCase): """OneofWithRequired unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_both_valid_invalid_fails(self): # both valid - invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithRequired.from_openapi_data_( + OneofWithRequired( { "foo": 1, @@ -32,42 +30,42 @@ def test_both_valid_invalid_fails(self): "baz": 3, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_both_invalid_invalid_fails(self): # both invalid - invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - OneofWithRequired.from_openapi_data_( + OneofWithRequired( { "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_first_valid_valid_passes(self): # first valid - valid - OneofWithRequired.from_openapi_data_( + OneofWithRequired( { "foo": 1, "bar": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_second_valid_valid_passes(self): # second valid - valid - OneofWithRequired.from_openapi_data_( + OneofWithRequired( { "foo": 1, "baz": 3, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py index fca5e035ce2..2066f7a3a45 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_is_not_anchored.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,18 +11,18 @@ import unit_test_api from unit_test_api.components.schema.pattern_is_not_anchored import PatternIsNotAnchored -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestPatternIsNotAnchored(unittest.TestCase): """PatternIsNotAnchored unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_matches_a_substring_passes(self): # matches a substring - PatternIsNotAnchored.from_openapi_data_( + PatternIsNotAnchored( "xxaayy", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py index e7e8a2f6d6b..cb9c8fa410b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_pattern_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,70 +11,70 @@ import unit_test_api from unit_test_api.components.schema.pattern_validation import PatternValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestPatternValidation(unittest.TestCase): """PatternValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_ignores_arrays_passes(self): # ignores arrays - PatternValidation.from_openapi_data_( + PatternValidation( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_objects_passes(self): # ignores objects - PatternValidation.from_openapi_data_( + PatternValidation( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_null_passes(self): # ignores null - PatternValidation.from_openapi_data_( + PatternValidation( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_floats_passes(self): # ignores floats - PatternValidation.from_openapi_data_( + PatternValidation( 1.0, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_non_matching_pattern_is_invalid_fails(self): # a non-matching pattern is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PatternValidation.from_openapi_data_( + PatternValidation( "abc", - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_booleans_passes(self): # ignores booleans - PatternValidation.from_openapi_data_( + PatternValidation( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_matching_pattern_is_valid_passes(self): # a matching pattern is valid - PatternValidation.from_openapi_data_( + PatternValidation( "aaa", - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_integers_passes(self): # ignores integers - PatternValidation.from_openapi_data_( + PatternValidation( 123, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py index 64a64536692..80f6a9357cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_properties_with_escaped_characters.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.properties_with_escaped_characters import PropertiesWithEscapedCharacters -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestPropertiesWithEscapedCharacters(unittest.TestCase): """PropertiesWithEscapedCharacters unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_object_with_all_numbers_is_valid_passes(self): # object with all numbers is valid - PropertiesWithEscapedCharacters.from_openapi_data_( + PropertiesWithEscapedCharacters( { "foo\nbar": 1, @@ -37,13 +35,13 @@ def test_object_with_all_numbers_is_valid_passes(self): "foo\fbar": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_object_with_strings_is_invalid_fails(self): # object with strings is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PropertiesWithEscapedCharacters.from_openapi_data_( + PropertiesWithEscapedCharacters( { "foo\nbar": "1", @@ -58,7 +56,7 @@ def test_object_with_strings_is_invalid_fails(self): "foo\fbar": "1", }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py index 458301f7fc2..24ef1725840 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_property_named_ref_that_is_not_a_reference.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestPropertyNamedRefThatIsNotAReference(unittest.TestCase): """PropertyNamedRefThatIsNotAReference unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - PropertyNamedRefThatIsNotAReference.from_openapi_data_( + PropertyNamedRefThatIsNotAReference( { "$ref": "a", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - PropertyNamedRefThatIsNotAReference.from_openapi_data_( + PropertyNamedRefThatIsNotAReference( { "$ref": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py index 16aaea2e96e..2f88b190e9e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_additionalproperties.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.ref_in_additionalproperties import RefInAdditionalproperties -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInAdditionalproperties(unittest.TestCase): """RefInAdditionalproperties unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInAdditionalproperties.from_openapi_data_( + RefInAdditionalproperties( { "someProp": { @@ -30,13 +28,13 @@ def test_property_named_ref_valid_passes(self): "a", }, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAdditionalproperties.from_openapi_data_( + RefInAdditionalproperties( { "someProp": { @@ -44,7 +42,7 @@ def test_property_named_ref_invalid_fails(self): 2, }, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py index 212046dc0a7..935af006a89 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_allof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.ref_in_allof import RefInAllof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInAllof(unittest.TestCase): """RefInAllof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInAllof.from_openapi_data_( + RefInAllof( { "$ref": "a", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAllof.from_openapi_data_( + RefInAllof( { "$ref": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py index 526ecee032c..45505177f1f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_anyof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.ref_in_anyof import RefInAnyof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInAnyof(unittest.TestCase): """RefInAnyof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInAnyof.from_openapi_data_( + RefInAnyof( { "$ref": "a", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInAnyof.from_openapi_data_( + RefInAnyof( { "$ref": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py index ff6e8101687..30fbd1be3ba 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_items.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,36 +11,36 @@ import unit_test_api from unit_test_api.components.schema.ref_in_items import RefInItems -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInItems(unittest.TestCase): """RefInItems unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInItems.from_openapi_data_( + RefInItems( [ { "$ref": "a", }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInItems.from_openapi_data_( + RefInItems( [ { "$ref": 2, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py index 5490bc5f3a7..c65a72f53a3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_not.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.ref_in_not import RefInNot -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInNot(unittest.TestCase): """RefInNot unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInNot.from_openapi_data_( + RefInNot( { "$ref": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInNot.from_openapi_data_( + RefInNot( { "$ref": "a", }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py index 387ea81e5d4..9b5a6aede10 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_oneof.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,32 +11,32 @@ import unit_test_api from unit_test_api.components.schema.ref_in_oneof import RefInOneof -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInOneof(unittest.TestCase): """RefInOneof unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInOneof.from_openapi_data_( + RefInOneof( { "$ref": "a", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInOneof.from_openapi_data_( + RefInOneof( { "$ref": 2, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py index 4500e851df9..af95d91f971 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_ref_in_property.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.ref_in_property import RefInProperty -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRefInProperty(unittest.TestCase): """RefInProperty unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_named_ref_valid_passes(self): # property named $ref valid - RefInProperty.from_openapi_data_( + RefInProperty( { "a": { @@ -30,13 +28,13 @@ def test_property_named_ref_valid_passes(self): "a", }, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_property_named_ref_invalid_fails(self): # property named $ref invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RefInProperty.from_openapi_data_( + RefInProperty( { "a": { @@ -44,7 +42,7 @@ def test_property_named_ref_invalid_fails(self): 2, }, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py index 91f63373bf1..71ae458d2da 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_default_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,19 +11,19 @@ import unit_test_api from unit_test_api.components.schema.required_default_validation import RequiredDefaultValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRequiredDefaultValidation(unittest.TestCase): """RequiredDefaultValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_not_required_by_default_passes(self): # not required by default - RequiredDefaultValidation.from_openapi_data_( + RequiredDefaultValidation( { }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py index f85e696e18e..38b80facec5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,54 +11,54 @@ import unit_test_api from unit_test_api.components.schema.required_validation import RequiredValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRequiredValidation(unittest.TestCase): """RequiredValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_ignores_arrays_passes(self): # ignores arrays - RequiredValidation.from_openapi_data_( + RequiredValidation( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_present_required_property_is_valid_passes(self): # present required property is valid - RequiredValidation.from_openapi_data_( + RequiredValidation( { "foo": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_other_non_objects_passes(self): # ignores other non-objects - RequiredValidation.from_openapi_data_( + RequiredValidation( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_ignores_strings_passes(self): # ignores strings - RequiredValidation.from_openapi_data_( + RequiredValidation( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_present_required_property_is_invalid_fails(self): # non-present required property is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RequiredValidation.from_openapi_data_( + RequiredValidation( { "bar": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py index 16b7b777b75..dd7f02f9a13 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_empty_array.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,19 +11,19 @@ import unit_test_api from unit_test_api.components.schema.required_with_empty_array import RequiredWithEmptyArray -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRequiredWithEmptyArray(unittest.TestCase): """RequiredWithEmptyArray unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_property_not_required_passes(self): # property not required - RequiredWithEmptyArray.from_openapi_data_( + RequiredWithEmptyArray( { }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py index d77fbec00aa..7a0af77092e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_required_with_escaped_characters.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,29 +11,29 @@ import unit_test_api from unit_test_api.components.schema.required_with_escaped_characters import RequiredWithEscapedCharacters -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestRequiredWithEscapedCharacters(unittest.TestCase): """RequiredWithEscapedCharacters unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_object_with_some_properties_missing_is_invalid_fails(self): # object with some properties missing is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - RequiredWithEscapedCharacters.from_openapi_data_( + RequiredWithEscapedCharacters( { "foo\nbar": "1", "foo\"bar": "1", }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_object_with_all_properties_present_is_valid_passes(self): # object with all properties present is valid - RequiredWithEscapedCharacters.from_openapi_data_( + RequiredWithEscapedCharacters( { "foo\nbar": 1, @@ -50,7 +48,7 @@ def test_object_with_all_properties_present_is_valid_passes(self): "foo\fbar": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py index fa87914530d..01bb23524a6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_simple_enum_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.simple_enum_validation import SimpleEnumValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestSimpleEnumValidation(unittest.TestCase): """SimpleEnumValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_something_else_is_invalid_fails(self): # something else is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - SimpleEnumValidation.from_openapi_data_( + SimpleEnumValidation( 4, - configuration_=self.configuration_ + configuration=self.configuration ) def test_one_of_the_enum_is_valid_passes(self): # one of the enum is valid - SimpleEnumValidation.from_openapi_data_( + SimpleEnumValidation( 1, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py index e61669a6c17..5735055c338 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_string_type_matches_strings.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,82 +11,82 @@ import unit_test_api from unit_test_api.components.schema.string_type_matches_strings import StringTypeMatchesStrings -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestStringTypeMatchesStrings(unittest.TestCase): """StringTypeMatchesStrings unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_1_is_not_a_string_fails(self): # 1 is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( 1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): # a string is still a string, even if it looks like a number - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( "1", - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_empty_string_is_still_a_string_passes(self): # an empty string is still a string - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( "", - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_float_is_not_a_string_fails(self): # a float is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( 1.1, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_object_is_not_a_string_fails(self): # an object is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_array_is_not_a_string_fails(self): # an array is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_boolean_is_not_a_string_fails(self): # a boolean is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( True, - configuration_=self.configuration_ + configuration=self.configuration ) def test_null_is_not_a_string_fails(self): # null is not a string with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( None, - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_string_is_a_string_passes(self): # a string is a string - StringTypeMatchesStrings.from_openapi_data_( + StringTypeMatchesStrings( "foo", - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py index 43e21da415c..b8d3c37595f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_the_default_keyword_does_not_do_anything_if_the_property_is_missing.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,40 +11,40 @@ import unit_test_api from unit_test_api.components.schema.the_default_keyword_does_not_do_anything_if_the_property_is_missing import TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestTheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing(unittest.TestCase): """TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_missing_properties_are_not_filled_in_with_the_default_passes(self): # missing properties are not filled in with the default - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(self): # an explicit property value is checked against maximum (passing) - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( { "alpha": 1, }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(self): # an explicit property value is checked against maximum (failing) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing.from_openapi_data_( + TheDefaultKeywordDoesNotDoAnythingIfThePropertyIsMissing( { "alpha": 5, }, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py index 20ec05f4b3b..e5dd9063622 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_false_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,26 +11,26 @@ import unit_test_api from unit_test_api.components.schema.uniqueitems_false_validation import UniqueitemsFalseValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestUniqueitemsFalseValidation(unittest.TestCase): """UniqueitemsFalseValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_non_unique_array_of_integers_is_valid_passes(self): # non-unique array of integers is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 1, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_objects_is_valid_passes(self): # unique array of objects is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { "foo": @@ -43,12 +41,12 @@ def test_unique_array_of_objects_is_valid_passes(self): "baz", }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_nested_objects_is_valid_passes(self): # non-unique array of nested objects is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { "foo": @@ -71,12 +69,12 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): }, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_objects_is_valid_passes(self): # non-unique array of objects is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { "foo": @@ -87,32 +85,32 @@ def test_non_unique_array_of_objects_is_valid_passes(self): "bar", }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_1_and_true_are_unique_passes(self): # 1 and true are unique - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 1, True, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_integers_is_valid_passes(self): # unique array of integers is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 1, 2, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_arrays_is_valid_passes(self): # non-unique array of arrays is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ [ "foo", @@ -121,33 +119,33 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): "foo", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_numbers_are_unique_if_mathematically_unequal_passes(self): # numbers are unique if mathematically unequal - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 1.0, 1.0, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_false_is_not_equal_to_zero_passes(self): # false is not equal to zero - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 0, False, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_nested_objects_is_valid_passes(self): # unique array of nested objects is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { "foo": @@ -170,22 +168,22 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_0_and_false_are_unique_passes(self): # 0 and false are unique - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 0, False, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_arrays_is_valid_passes(self): # unique array of arrays is valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ [ "foo", @@ -194,22 +192,22 @@ def test_unique_array_of_arrays_is_valid_passes(self): "bar", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_true_is_not_equal_to_one_passes(self): # true is not equal to one - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ 1, True, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_heterogeneous_types_are_valid_passes(self): # non-unique heterogeneous types are valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { }, @@ -222,12 +220,12 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): }, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_heterogeneous_types_are_valid_passes(self): # unique heterogeneous types are valid - UniqueitemsFalseValidation.from_openapi_data_( + UniqueitemsFalseValidation( [ { }, @@ -238,7 +236,7 @@ def test_unique_heterogeneous_types_are_valid_passes(self): None, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py index 97d165d9005..fafe52551cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uniqueitems_validation.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,16 +11,16 @@ import unit_test_api from unit_test_api.components.schema.uniqueitems_validation import UniqueitemsValidation -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestUniqueitemsValidation(unittest.TestCase): """UniqueitemsValidation unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_unique_array_of_objects_is_valid_passes(self): # unique array of objects is valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "foo": @@ -33,12 +31,12 @@ def test_unique_array_of_objects_is_valid_passes(self): "baz", }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_true_and_a1_are_unique_passes(self): # {"a": true} and {"a": 1} are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "a": @@ -49,13 +47,13 @@ def test_a_true_and_a1_are_unique_passes(self): 1, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_heterogeneous_types_are_invalid_fails(self): # non-unique heterogeneous types are invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { }, @@ -68,12 +66,12 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): }, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_nested0_and_false_are_unique_passes(self): # nested [0] and [false] are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ [ @@ -88,12 +86,12 @@ def test_nested0_and_false_are_unique_passes(self): "foo", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_a_false_and_a0_are_unique_passes(self): # {"a": false} and {"a": 0} are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "a": @@ -104,34 +102,34 @@ def test_a_false_and_a0_are_unique_passes(self): 0, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_numbers_are_unique_if_mathematically_unequal_fails(self): # numbers are unique if mathematically unequal with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 1.0, 1.0, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_false_is_not_equal_to_zero_passes(self): # false is not equal to zero - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 0, False, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_0_and_false_are_unique_passes(self): # [0] and [false] are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ 0, @@ -140,12 +138,12 @@ def test_0_and_false_are_unique_passes(self): False, ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_arrays_is_valid_passes(self): # unique array of arrays is valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ "foo", @@ -154,13 +152,13 @@ def test_unique_array_of_arrays_is_valid_passes(self): "bar", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_nested_objects_is_invalid_fails(self): # non-unique array of nested objects is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "foo": @@ -183,35 +181,35 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): }, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): # non-unique array of more than two integers is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 1, 2, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_true_is_not_equal_to_one_passes(self): # true is not equal to one - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 1, True, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_objects_are_non_unique_despite_key_order_fails(self): # objects are non-unique despite key order with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "a": @@ -226,23 +224,23 @@ def test_objects_are_non_unique_despite_key_order_fails(self): 1, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_strings_is_valid_passes(self): # unique array of strings is valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ "foo", "bar", "baz", ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_1_and_true_are_unique_passes(self): # [1] and [true] are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ 1, @@ -251,12 +249,12 @@ def test_1_and_true_are_unique_passes(self): True, ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_different_objects_are_unique_passes(self): # different objects are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "a": @@ -271,23 +269,23 @@ def test_different_objects_are_unique_passes(self): 1, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_integers_is_valid_passes(self): # unique array of integers is valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 1, 2, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): # non-unique array of more than two arrays is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ "foo", @@ -299,13 +297,13 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): "foo", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_objects_is_invalid_fails(self): # non-unique array of objects is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "foo": @@ -316,12 +314,12 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): "bar", }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_array_of_nested_objects_is_valid_passes(self): # unique array of nested objects is valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { "foo": @@ -344,13 +342,13 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, }, ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_arrays_is_invalid_fails(self): # non-unique array of arrays is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ "foo", @@ -359,24 +357,24 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): "foo", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_strings_is_invalid_fails(self): # non-unique array of strings is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ "foo", "bar", "foo", ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_nested1_and_true_are_unique_passes(self): # nested [1] and [true] are unique - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ [ [ @@ -391,12 +389,12 @@ def test_nested1_and_true_are_unique_passes(self): "foo", ], ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_unique_heterogeneous_types_are_valid_passes(self): # unique heterogeneous types are valid - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ { }, @@ -408,18 +406,18 @@ def test_unique_heterogeneous_types_are_valid_passes(self): 1, "{}", ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_non_unique_array_of_integers_is_invalid_fails(self): # non-unique array of integers is invalid with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - UniqueitemsValidation.from_openapi_data_( + UniqueitemsValidation( [ 1, 1, ], - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py index 87279b23274..5432e117165 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.uri_format import UriFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestUriFormat(unittest.TestCase): """UriFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - UriFormat.from_openapi_data_( + UriFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - UriFormat.from_openapi_data_( + UriFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - UriFormat.from_openapi_data_( + UriFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - UriFormat.from_openapi_data_( + UriFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - UriFormat.from_openapi_data_( + UriFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - UriFormat.from_openapi_data_( + UriFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py index 092ccd38951..02c82da19ce 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_reference_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.uri_reference_format import UriReferenceFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestUriReferenceFormat(unittest.TestCase): """UriReferenceFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - UriReferenceFormat.from_openapi_data_( + UriReferenceFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py index 09942297f6d..68467d0094e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/components/schema/test_uri_template_format.py @@ -2,9 +2,7 @@ """ openapi 3.0.3 sample spec - sample spec for testing openapi functionality, built from json schema tests for draft6 # noqa: E501 - The version of the OpenAPI document: 0.0.1 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ @@ -13,55 +11,55 @@ import unit_test_api from unit_test_api.components.schema.uri_template_format import UriTemplateFormat -from unit_test_api import configuration +from unit_test_api.configurations import schema_configuration class TestUriTemplateFormat(unittest.TestCase): """UriTemplateFormat unit test stubs""" - configuration_ = configuration.Configuration() + configuration = schema_configuration.SchemaConfiguration() def test_all_string_formats_ignore_objects_passes(self): # all string formats ignore objects - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( { }, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_booleans_passes(self): # all string formats ignore booleans - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( False, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_integers_passes(self): # all string formats ignore integers - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( 12, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_floats_passes(self): # all string formats ignore floats - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( 13.7, - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_arrays_passes(self): # all string formats ignore arrays - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( [ ], - configuration_=self.configuration_ + configuration=self.configuration ) def test_all_string_formats_ignore_nulls_passes(self): # all string formats ignore nulls - UriTemplateFormat.from_openapi_data_( + UriTemplateFormat( None, - configuration_=self.configuration_ + configuration=self.configuration ) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py index e405bd03b13..f15aeb543cb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_allows_a_schema_which_should_validate_request_body/test_post.py @@ -40,9 +40,9 @@ def test_no_additional_properties_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -78,9 +78,9 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -98,9 +98,9 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py index ff8a255f387..e0975aca036 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_are_allowed_by_default_request_body/test_post.py @@ -44,9 +44,9 @@ def test_additional_properties_are_allowed_passes(self): True, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py index deffb8bbf1a..2425510c060 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_can_exist_by_itself_request_body/test_post.py @@ -41,9 +41,9 @@ def test_an_additional_invalid_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -57,9 +57,9 @@ def test_an_additional_valid_property_is_valid_passes(self): True, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py index a22f81ef13e..86768a16864 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_additionalproperties_should_not_look_in_applicators_request_body/test_post.py @@ -43,9 +43,9 @@ def test_properties_defined_in_allof_are_not_examined_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -61,9 +61,9 @@ def test_valid_test_case_passes(self): True, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py index c8bbde097bd..261309152ad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_combined_with_anyof_oneof_request_body/test_post.py @@ -38,9 +38,9 @@ def test_allof_true_anyof_false_oneof_false_fails(self): 2 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_allof_false_anyof_false_oneof_true_fails(self): 5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -66,9 +66,9 @@ def test_allof_false_anyof_true_oneof_true_fails(self): 15 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -80,9 +80,9 @@ def test_allof_true_anyof_true_oneof_false_fails(self): 6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -93,9 +93,9 @@ def test_allof_true_anyof_true_oneof_true_passes(self): payload = ( 30 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -124,9 +124,9 @@ def test_allof_true_anyof_false_oneof_true_fails(self): 10 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -138,9 +138,9 @@ def test_allof_false_anyof_true_oneof_false_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -152,9 +152,9 @@ def test_allof_false_anyof_false_oneof_false_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py index 8482d79bf74..5df4d205e2e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_request_body/test_post.py @@ -42,9 +42,9 @@ def test_allof_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -76,9 +76,9 @@ def test_mismatch_first_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -93,9 +93,9 @@ def test_mismatch_second_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -112,9 +112,9 @@ def test_wrong_type_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py index bd08af095ca..293398325fe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_simple_types_request_body/test_post.py @@ -37,9 +37,9 @@ def test_valid_passes(self): payload = ( 25 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_mismatch_one_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py index d4ceab02644..17a7e55055f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_base_schema_request_body/test_post.py @@ -44,9 +44,9 @@ def test_valid_passes(self): None, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -80,9 +80,9 @@ def test_mismatch_first_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -99,9 +99,9 @@ def test_mismatch_base_schema_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -116,9 +116,9 @@ def test_mismatch_both_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -135,9 +135,9 @@ def test_mismatch_second_allof_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py index 20629b6cf3f..681f63c7fda 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_one_empty_schema_request_body/test_post.py @@ -37,9 +37,9 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py index c5a52d6e26e..be8428c551b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_first_empty_schema_request_body/test_post.py @@ -38,9 +38,9 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py index 2d8c950e78e..6a0258e09ac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_the_last_empty_schema_request_body/test_post.py @@ -38,9 +38,9 @@ def test_string_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_number_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py index b953f98a8d6..732383f65cd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_allof_with_two_empty_schemas_request_body/test_post.py @@ -37,9 +37,9 @@ def test_any_data_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py index cf32bd6641e..e933b12ea4d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_complex_types_request_body/test_post.py @@ -40,9 +40,9 @@ def test_second_anyof_valid_complex_passes(self): "baz", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -76,9 +76,9 @@ def test_neither_anyof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -94,9 +94,9 @@ def test_both_anyof_valid_complex_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -127,9 +127,9 @@ def test_first_anyof_valid_complex_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py index f74f07df3b8..aad966b7d3a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_request_body/test_post.py @@ -37,9 +37,9 @@ def test_second_anyof_valid_passes(self): payload = ( 2.5 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_neither_anyof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_both_anyof_valid_passes(self): payload = ( 3 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,9 +111,9 @@ def test_first_anyof_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py index d3842e63b82..d55ecd6f22b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_base_schema_request_body/test_post.py @@ -37,9 +37,9 @@ def test_one_anyof_valid_passes(self): payload = ( "foobar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_both_anyof_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -82,9 +82,9 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py index 3f2ffacc85b..600adbb752d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_anyof_with_one_empty_schema_request_body/test_post.py @@ -37,9 +37,9 @@ def test_string_is_valid_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -67,9 +67,9 @@ def test_number_is_valid_passes(self): payload = ( 123 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py index e8f6e586311..52ad8853dac 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_array_type_matches_arrays_request_body/test_post.py @@ -38,9 +38,9 @@ def test_a_float_is_not_an_array_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_a_boolean_is_not_an_array_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -66,9 +66,9 @@ def test_null_is_not_an_array_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_an_object_is_not_an_array_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -95,9 +95,9 @@ def test_a_string_is_not_an_array_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -109,9 +109,9 @@ def test_an_array_is_an_array_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -140,9 +140,9 @@ def test_an_integer_is_not_an_array_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py index 131e97d1d8f..c33cd2d5fb0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_boolean_type_matches_booleans_request_body/test_post.py @@ -38,9 +38,9 @@ def test_an_empty_string_is_not_a_boolean_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_a_float_is_not_a_boolean_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -66,9 +66,9 @@ def test_null_is_not_a_boolean_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -80,9 +80,9 @@ def test_zero_is_not_a_boolean_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -95,9 +95,9 @@ def test_an_array_is_not_a_boolean_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -109,9 +109,9 @@ def test_a_string_is_not_a_boolean_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -122,9 +122,9 @@ def test_false_is_a_boolean_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -153,9 +153,9 @@ def test_an_integer_is_not_a_boolean_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -166,9 +166,9 @@ def test_true_is_a_boolean_passes(self): payload = ( True ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -198,9 +198,9 @@ def test_an_object_is_not_a_boolean_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py index 0630223eb69..8811cb4d2f6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_int_request_body/test_post.py @@ -38,9 +38,9 @@ def test_int_by_int_fail_fails(self): 7 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_int_by_int_passes(self): payload = ( 10 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -81,9 +81,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py index 99d77ccd787..7a466e3a93b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_number_request_body/test_post.py @@ -37,9 +37,9 @@ def test_45_is_multiple_of15_passes(self): payload = ( 4.5 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_35_is_not_multiple_of15_fails(self): 35 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_zero_is_multiple_of_anything_passes(self): payload = ( 0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py index e65af0fc028..eb20a0fd2fe 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_by_small_number_request_body/test_post.py @@ -38,9 +38,9 @@ def test_000751_is_not_multiple_of00001_fails(self): 0.00751 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_00075_is_multiple_of00001_passes(self): payload = ( 0.0075 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py index 67fa3736f09..ae84b5387c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_date_time_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py index 8f7ebbdc2db..f1cad3da7a4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_email_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py index 9344ad2e3e1..28a209063aa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with0_does_not_match_false_request_body/test_post.py @@ -37,9 +37,9 @@ def test_integer_zero_is_valid_passes(self): payload = ( 0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -67,9 +67,9 @@ def test_float_zero_is_valid_passes(self): payload = ( 0.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_false_is_invalid_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py index 33e60f2aaf5..c1cabbd65ee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with1_does_not_match_true_request_body/test_post.py @@ -38,9 +38,9 @@ def test_true_is_invalid_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_integer_one_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -81,9 +81,9 @@ def test_float_one_is_valid_passes(self): payload = ( 1.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py index b68af02fbcc..a28e7be8fb4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_escaped_characters_request_body/test_post.py @@ -37,9 +37,9 @@ def test_member2_is_valid_passes(self): payload = ( "foo\rbar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -67,9 +67,9 @@ def test_member1_is_valid_passes(self): payload = ( "foo\nbar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_another_string_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py index 5f5630a0b59..c54add351ea 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_false_does_not_match0_request_body/test_post.py @@ -37,9 +37,9 @@ def test_false_is_valid_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_float_zero_is_invalid_fails(self): 0.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -82,9 +82,9 @@ def test_integer_zero_is_invalid_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py index 362b23ad685..0eb7f9e4f0e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enum_with_true_does_not_match1_request_body/test_post.py @@ -38,9 +38,9 @@ def test_float_one_is_invalid_fails(self): 1.0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_true_is_valid_passes(self): payload = ( True ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -82,9 +82,9 @@ def test_integer_one_is_invalid_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py index 0c6fb413d60..a392409d02d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_enums_in_properties_request_body/test_post.py @@ -40,9 +40,9 @@ def test_missing_optional_property_is_valid_passes(self): "bar", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -76,9 +76,9 @@ def test_wrong_foo_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -94,9 +94,9 @@ def test_both_properties_are_valid_passes(self): "bar", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -130,9 +130,9 @@ def test_wrong_bar_value_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -145,9 +145,9 @@ def test_missing_all_properties_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -162,9 +162,9 @@ def test_missing_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py index 30d2bb2c598..bcde8b44ff5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_forbidden_property_request_body/test_post.py @@ -43,9 +43,9 @@ def test_property_present_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -61,9 +61,9 @@ def test_property_absent_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py index f571547b270..a6ee24e478f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_hostname_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py index 694ab48ba35..e58a77eb2c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_integer_type_matches_integers_request_body/test_post.py @@ -39,9 +39,9 @@ def test_an_object_is_not_an_integer_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -53,9 +53,9 @@ def test_a_string_is_not_an_integer_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -67,9 +67,9 @@ def test_null_is_not_an_integer_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -80,9 +80,9 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): payload = ( 1.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,9 +111,9 @@ def test_a_float_is_not_an_integer_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -125,9 +125,9 @@ def test_a_boolean_is_not_an_integer_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -138,9 +138,9 @@ def test_an_integer_is_an_integer_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -169,9 +169,9 @@ def test_a_string_is_still_not_an_integer_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -184,9 +184,9 @@ def test_an_array_is_not_an_integer_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py index 7e08c067c59..da2a5fc1961 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_request_body/test_post.py @@ -38,9 +38,9 @@ def test_always_invalid_but_naive_implementations_may_raise_an_overflow_error_fa 1.0E308 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_valid_integer_with_multipleof_float_passes(self): payload = ( 123456789 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py index 4bea2c765a6..38be95b0f20 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_invalid_string_value_for_default_request_body/test_post.py @@ -40,9 +40,9 @@ def test_valid_when_property_is_specified_passes(self): "good", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -71,9 +71,9 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py index a9948ca5ad2..b7e8379bbfd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv4_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py index 1b1e979a101..fb8568e2952 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ipv6_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py index 93fbdd3e4bf..64384819aaa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_json_pointer_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py index ce67700b6dd..916633f55b1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_request_body/test_post.py @@ -37,9 +37,9 @@ def test_below_the_maximum_is_valid_passes(self): payload = ( 2.6 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -67,9 +67,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( 3.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_above_the_maximum_is_invalid_fails(self): 3.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -111,9 +111,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py index 344a15f4dd2..8a0a57d42a9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maximum_validation_with_unsigned_integer_request_body/test_post.py @@ -37,9 +37,9 @@ def test_below_the_maximum_is_invalid_passes(self): payload = ( 299.97 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_above_the_maximum_is_invalid_fails(self): 300.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_boundary_point_integer_is_valid_passes(self): payload = ( 300 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,9 +111,9 @@ def test_boundary_point_float_is_valid_passes(self): payload = ( 300.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py index 7619d269d9f..3063b45ada8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxitems_validation_request_body/test_post.py @@ -42,9 +42,9 @@ def test_too_long_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -55,9 +55,9 @@ def test_ignores_non_arrays_passes(self): payload = ( "foobar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -87,9 +87,9 @@ def test_shorter_is_valid_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -120,9 +120,9 @@ def test_exact_length_is_valid_passes(self): 2, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py index 5a8b29616bf..fde578d8304 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxlength_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_too_long_is_invalid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_ignores_non_strings_passes(self): payload = ( 100 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -81,9 +81,9 @@ def test_shorter_is_valid_passes(self): payload = ( "f" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,9 +111,9 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): payload = ( "💩💩" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -141,9 +141,9 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py index ac2b78f0a5e..332e765cb65 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties0_means_the_object_is_empty_request_body/test_post.py @@ -38,9 +38,9 @@ def test_no_properties_is_valid_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -72,9 +72,9 @@ def test_one_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py index f8d77c92109..5582af475e1 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_maxproperties_validation_request_body/test_post.py @@ -45,9 +45,9 @@ def test_too_long_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -62,9 +62,9 @@ def test_ignores_arrays_passes(self): 3, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -92,9 +92,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -122,9 +122,9 @@ def test_ignores_strings_passes(self): payload = ( "foobar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -155,9 +155,9 @@ def test_shorter_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -190,9 +190,9 @@ def test_exact_length_is_valid_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py index dbddf328a5d..d8262a3651b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_request_body/test_post.py @@ -37,9 +37,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( 1.1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_below_the_minimum_is_invalid_fails(self): 0.6 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_above_the_minimum_is_valid_passes(self): payload = ( 2.6 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -111,9 +111,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py index 70a8fbe0c6a..0742d31eac4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minimum_validation_with_signed_integer_request_body/test_post.py @@ -37,9 +37,9 @@ def test_boundary_point_is_valid_passes(self): payload = ( -2 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -67,9 +67,9 @@ def test_positive_above_the_minimum_is_valid_passes(self): payload = ( 0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_int_below_the_minimum_is_invalid_fails(self): -3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -112,9 +112,9 @@ def test_float_below_the_minimum_is_invalid_fails(self): -2.0001 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -125,9 +125,9 @@ def test_boundary_point_with_float_is_valid_passes(self): payload = ( -2.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -155,9 +155,9 @@ def test_negative_above_the_minimum_is_valid_passes(self): payload = ( -1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -185,9 +185,9 @@ def test_ignores_non_numbers_passes(self): payload = ( "x" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py index e3e8eef31a0..cc18bf66c08 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minitems_validation_request_body/test_post.py @@ -39,9 +39,9 @@ def test_too_short_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_ignores_non_arrays_passes(self): payload = ( "" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,9 +85,9 @@ def test_longer_is_valid_passes(self): 2, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -117,9 +117,9 @@ def test_exact_length_is_valid_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py index f067cfb2608..bab32534e66 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minlength_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_too_short_is_invalid_fails(self): "f" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_one_supplementary_unicode_code_point_is_not_long_enough_fails(self): "💩" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -65,9 +65,9 @@ def test_longer_is_valid_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -95,9 +95,9 @@ def test_ignores_non_strings_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -125,9 +125,9 @@ def test_exact_length_is_valid_passes(self): payload = ( "fo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py index 77efeefd1e3..8f4443382fd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_minproperties_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -100,9 +100,9 @@ def test_too_short_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -113,9 +113,9 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -148,9 +148,9 @@ def test_longer_is_valid_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -181,9 +181,9 @@ def test_exact_length_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py index 4cac8da4035..14ce6918c0d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_allof_to_check_validation_semantics_request_body/test_post.py @@ -38,9 +38,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py index 66bd488dba4..193edd18ec0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_anyof_to_check_validation_semantics_request_body/test_post.py @@ -38,9 +38,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py index 8b2ebd0863d..bc3920c80df 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_items_request_body/test_post.py @@ -66,9 +66,9 @@ def test_valid_nested_array_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -126,9 +126,9 @@ def test_nested_array_with_invalid_type_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -163,9 +163,9 @@ def test_not_deep_enough_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py index 79fae8b0c63..78ea94e0c0e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nested_oneof_to_check_validation_semantics_request_body/test_post.py @@ -38,9 +38,9 @@ def test_anything_non_null_is_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_null_is_valid_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py index c20953589b2..da684d22c1b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_more_complex_schema_request_body/test_post.py @@ -40,9 +40,9 @@ def test_other_match_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_mismatch_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -87,9 +87,9 @@ def test_match_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py index f323a8e8230..169efee31b7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_not_request_body/test_post.py @@ -37,9 +37,9 @@ def test_allowed_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_disallowed_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py index 7cda19888ec..c3de333ced3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_nul_characters_in_strings_request_body/test_post.py @@ -37,9 +37,9 @@ def test_match_string_with_nul_passes(self): payload = ( "hello\x00there" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_do_not_match_string_lacking_nul_fails(self): "hellothere" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py index 2b2aa3d220e..62cee8ceee0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_null_type_matches_only_the_null_object_request_body/test_post.py @@ -38,9 +38,9 @@ def test_a_float_is_not_null_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -53,9 +53,9 @@ def test_an_object_is_not_null_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -67,9 +67,9 @@ def test_false_is_not_null_fails(self): False ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_an_integer_is_not_null_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -95,9 +95,9 @@ def test_true_is_not_null_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -109,9 +109,9 @@ def test_zero_is_not_null_fails(self): 0 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -123,9 +123,9 @@ def test_an_empty_string_is_not_null_fails(self): "" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -136,9 +136,9 @@ def test_null_is_null_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -168,9 +168,9 @@ def test_an_array_is_not_null_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -182,9 +182,9 @@ def test_a_string_is_not_null_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py index 462d1c17bd7..eced3ce39a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_number_type_matches_numbers_request_body/test_post.py @@ -39,9 +39,9 @@ def test_an_array_is_not_a_number_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -53,9 +53,9 @@ def test_null_is_not_a_number_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -68,9 +68,9 @@ def test_an_object_is_not_a_number_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -82,9 +82,9 @@ def test_a_boolean_is_not_a_number_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -95,9 +95,9 @@ def test_a_float_is_a_number_passes(self): payload = ( 1.1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -126,9 +126,9 @@ def test_a_string_is_still_not_a_number_even_if_it_looks_like_one_fails(self): "1" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -140,9 +140,9 @@ def test_a_string_is_not_a_number_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -153,9 +153,9 @@ def test_an_integer_is_a_number_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -183,9 +183,9 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel payload = ( 1.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py index 5ef3c7a826a..9d2bbbe2319 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_properties_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -105,9 +105,9 @@ def test_one_property_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -123,9 +123,9 @@ def test_both_properties_present_and_valid_is_valid_passes(self): "baz", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -157,9 +157,9 @@ def test_doesn_t_invalidate_other_properties_passes(self): ], } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -195,9 +195,9 @@ def test_both_properties_invalid_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py index c96b0772c46..227eba60ff6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_object_type_matches_objects_request_body/test_post.py @@ -38,9 +38,9 @@ def test_a_float_is_not_an_object_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_null_is_not_an_object_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -67,9 +67,9 @@ def test_an_array_is_not_an_object_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_an_object_is_an_object_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -112,9 +112,9 @@ def test_a_string_is_not_an_object_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -126,9 +126,9 @@ def test_an_integer_is_not_an_object_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -140,9 +140,9 @@ def test_a_boolean_is_not_an_object_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py index 688337554a3..8efc6e74828 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_complex_types_request_body/test_post.py @@ -40,9 +40,9 @@ def test_first_oneof_valid_complex_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -76,9 +76,9 @@ def test_neither_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -95,9 +95,9 @@ def test_both_oneof_valid_complex_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -111,9 +111,9 @@ def test_second_oneof_valid_complex_passes(self): "baz", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py index b8286a3094e..63ea9fd120e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_request_body/test_post.py @@ -37,9 +37,9 @@ def test_second_oneof_valid_passes(self): payload = ( 2.5 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_both_oneof_valid_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -81,9 +81,9 @@ def test_first_oneof_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -112,9 +112,9 @@ def test_neither_oneof_valid_fails(self): 1.5 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py index c1aca49ec9f..255d481fb01 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_base_schema_request_body/test_post.py @@ -38,9 +38,9 @@ def test_both_oneof_valid_fails(self): "foo" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -52,9 +52,9 @@ def test_mismatch_base_schema_fails(self): 3 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -65,9 +65,9 @@ def test_one_oneof_valid_passes(self): payload = ( "foobar" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py index e56ca68609f..cdce9abd24b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_empty_schema_request_body/test_post.py @@ -38,9 +38,9 @@ def test_both_valid_invalid_fails(self): 123 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_one_valid_valid_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py index 6f02861219e..0c4f3a3590d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_oneof_with_required_request_body/test_post.py @@ -45,9 +45,9 @@ def test_both_valid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -62,9 +62,9 @@ def test_both_invalid_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -80,9 +80,9 @@ def test_first_valid_valid_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -115,9 +115,9 @@ def test_second_valid_valid_passes(self): 3, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py index 0d360657861..0033b8479e6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_is_not_anchored_request_body/test_post.py @@ -37,9 +37,9 @@ def test_matches_a_substring_passes(self): payload = ( "xxaayy" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py index fcd7cf37499..5b1225c2fe9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_pattern_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -69,9 +69,9 @@ def test_ignores_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -99,9 +99,9 @@ def test_ignores_null_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -129,9 +129,9 @@ def test_ignores_floats_passes(self): payload = ( 1.0 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -160,9 +160,9 @@ def test_a_non_matching_pattern_is_invalid_fails(self): "abc" ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -173,9 +173,9 @@ def test_ignores_booleans_passes(self): payload = ( True ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -203,9 +203,9 @@ def test_a_matching_pattern_is_valid_passes(self): payload = ( "aaa" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -233,9 +233,9 @@ def test_ignores_integers_passes(self): payload = ( 123 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py index e637aed94cc..9c4582a563f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_properties_with_escaped_characters_request_body/test_post.py @@ -50,9 +50,9 @@ def test_object_with_all_numbers_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -94,9 +94,9 @@ def test_object_with_strings_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py index b4de0ea88c2..165d0824cde 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_property_named_ref_that_is_not_a_reference_request_body/test_post.py @@ -40,9 +40,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py index d8a9b509097..fdbd7138e1e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_additionalproperties_request_body/test_post.py @@ -43,9 +43,9 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -80,9 +80,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py index 8c90cc228b0..eea27eecfba 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_allof_request_body/test_post.py @@ -40,9 +40,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py index e6ef6d1bc08..bc076beca9f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_anyof_request_body/test_post.py @@ -40,9 +40,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py index 85e5c628d52..f64f821b240 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_items_request_body/test_post.py @@ -42,9 +42,9 @@ def test_property_named_ref_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -78,9 +78,9 @@ def test_property_named_ref_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py index 412a9122a9a..ae61c3d2420 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_not_request_body/test_post.py @@ -40,9 +40,9 @@ def test_property_named_ref_valid_passes(self): 2, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py index 7f14d63262e..60d23e4199a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_oneof_request_body/test_post.py @@ -40,9 +40,9 @@ def test_property_named_ref_valid_passes(self): "a", } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -74,9 +74,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py index f81d4221f98..c2c4a9aa0cf 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_ref_in_property_request_body/test_post.py @@ -43,9 +43,9 @@ def test_property_named_ref_valid_passes(self): }, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -80,9 +80,9 @@ def test_property_named_ref_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py index 85ca95b6909..616c2fe7da4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_default_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_not_required_by_default_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py index b6f82d684f8..854cbd672c7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_ignores_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -71,9 +71,9 @@ def test_present_required_property_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -101,9 +101,9 @@ def test_ignores_other_non_objects_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -131,9 +131,9 @@ def test_ignores_strings_passes(self): payload = ( "" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -165,9 +165,9 @@ def test_non_present_required_property_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py index f58036a6316..0a7f19b8b09 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_empty_array_request_body/test_post.py @@ -38,9 +38,9 @@ def test_property_not_required_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py index 0835214ff4d..c1bc44bd088 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_required_with_escaped_characters_request_body/test_post.py @@ -43,9 +43,9 @@ def test_object_with_some_properties_missing_is_invalid_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -69,9 +69,9 @@ def test_object_with_all_properties_present_is_valid_passes(self): 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py index d495d345199..bf9f08f4754 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_simple_enum_validation_request_body/test_post.py @@ -38,9 +38,9 @@ def test_something_else_is_invalid_fails(self): 4 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_one_of_the_enum_is_valid_passes(self): payload = ( 1 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py index 8264b0ed117..5d4cee79e60 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_string_type_matches_strings_request_body/test_post.py @@ -38,9 +38,9 @@ def test_1_is_not_a_string_fails(self): 1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -51,9 +51,9 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): payload = ( "1" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -81,9 +81,9 @@ def test_an_empty_string_is_still_a_string_passes(self): payload = ( "" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -112,9 +112,9 @@ def test_a_float_is_not_a_string_fails(self): 1.1 ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -127,9 +127,9 @@ def test_an_object_is_not_a_string_fails(self): } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -142,9 +142,9 @@ def test_an_array_is_not_a_string_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -156,9 +156,9 @@ def test_a_boolean_is_not_a_string_fails(self): True ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -170,9 +170,9 @@ def test_null_is_not_a_string_fails(self): None ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -183,9 +183,9 @@ def test_a_string_is_a_string_passes(self): payload = ( "foo" ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py index c40840cfc15..1de20d59d3e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_request_body/test_post.py @@ -38,9 +38,9 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -71,9 +71,9 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se 1, } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -105,9 +105,9 @@ def test_an_explicit_property_value_is_checked_against_maximum_failing_fails(sel } ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py index 74d02e77830..47bd3452311 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_false_validation_request_body/test_post.py @@ -40,9 +40,9 @@ def test_non_unique_array_of_integers_is_valid_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -79,9 +79,9 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -130,9 +130,9 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -169,9 +169,9 @@ def test_non_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -202,9 +202,9 @@ def test_1_and_true_are_unique_passes(self): True, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -235,9 +235,9 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -272,9 +272,9 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -306,9 +306,9 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -339,9 +339,9 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -390,9 +390,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -423,9 +423,9 @@ def test_0_and_false_are_unique_passes(self): False, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -460,9 +460,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -493,9 +493,9 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -534,9 +534,9 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -573,9 +573,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): 1, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py index c750957e9e8..0af1bab8859 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uniqueitems_validation_request_body/test_post.py @@ -46,9 +46,9 @@ def test_unique_array_of_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -85,9 +85,9 @@ def test_a_true_and_a1_are_unique_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -127,9 +127,9 @@ def test_non_unique_heterogeneous_types_are_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -153,9 +153,9 @@ def test_nested0_and_false_are_unique_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -192,9 +192,9 @@ def test_a_false_and_a0_are_unique_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -227,9 +227,9 @@ def test_numbers_are_unique_if_mathematically_unequal_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -243,9 +243,9 @@ def test_false_is_not_equal_to_zero_passes(self): False, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -280,9 +280,9 @@ def test_0_and_false_are_unique_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -317,9 +317,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -369,9 +369,9 @@ def test_non_unique_array_of_nested_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -387,9 +387,9 @@ def test_non_unique_array_of_more_than_two_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -403,9 +403,9 @@ def test_true_is_not_equal_to_one_passes(self): True, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -447,9 +447,9 @@ def test_objects_are_non_unique_despite_key_order_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -464,9 +464,9 @@ def test_unique_array_of_strings_is_valid_passes(self): "baz", ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -501,9 +501,9 @@ def test_1_and_true_are_unique_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -544,9 +544,9 @@ def test_different_objects_are_unique_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -577,9 +577,9 @@ def test_unique_array_of_integers_is_valid_passes(self): 2, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -618,9 +618,9 @@ def test_non_unique_array_of_more_than_two_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -641,9 +641,9 @@ def test_non_unique_array_of_objects_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -675,9 +675,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): }, ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -713,9 +713,9 @@ def test_non_unique_array_of_arrays_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -731,9 +731,9 @@ def test_non_unique_array_of_strings_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) @@ -757,9 +757,9 @@ def test_nested1_and_true_are_unique_passes(self): ], ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -797,9 +797,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): "{}", ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -831,9 +831,9 @@ def test_non_unique_array_of_integers_is_invalid_fails(self): ] ) with self.assertRaises((unit_test_api.ApiValueError, unit_test_api.ApiTypeError)): - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) self.api.post(body=body) diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py index 8ace838bbe5..3cc0beabcf7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py index fca23685ddc..5c08623b302 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_reference_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py index b0f29e0e939..3bb19fef352 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_request_body_post_uri_template_format_request_body/test_post.py @@ -38,9 +38,9 @@ def test_all_string_formats_ignore_objects_passes(self): { } ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -68,9 +68,9 @@ def test_all_string_formats_ignore_booleans_passes(self): payload = ( False ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -98,9 +98,9 @@ def test_all_string_formats_ignore_integers_passes(self): payload = ( 12 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -128,9 +128,9 @@ def test_all_string_formats_ignore_floats_passes(self): payload = ( 13.7 ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -159,9 +159,9 @@ def test_all_string_formats_ignore_arrays_passes(self): [ ] ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), @@ -189,9 +189,9 @@ def test_all_string_formats_ignore_nulls_passes(self): payload = ( None ) - body = post.request_body.RequestBody.content["application/json"].schema.from_openapi_data_( + body = post.request_body.RequestBody.content["application/json"].schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) mock_request.return_value = self.response( self.json_bytes(self.response_body), diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py index 84ef58965d2..1d268e35657 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_allows_a_schema_which_should_validate_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_no_additional_properties_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -126,9 +126,9 @@ def test_an_additional_valid_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py index c571322fcd4..0e2453f4d41 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_are_allowed_by_default_response_body_for_content_types/test_post.py @@ -62,9 +62,9 @@ def test_additional_properties_are_allowed_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py index 0d1efdfb80a..39048124e4f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_can_exist_by_itself_response_body_for_content_types/test_post.py @@ -85,9 +85,9 @@ def test_an_additional_valid_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py index ab19e3d8f8e..d7b1b7ad9ed 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_additionalproperties_should_not_look_in_applicators_response_body_for_content_types/test_post.py @@ -89,9 +89,9 @@ def test_valid_test_case_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py index 341f48266b0..3467b596aa0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_combined_with_anyof_oneof_response_body_for_content_types/test_post.py @@ -151,9 +151,9 @@ def test_allof_true_anyof_true_oneof_true_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py index f82b0391fa2..f132c9458a7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_response_body_for_content_types/test_post.py @@ -60,9 +60,9 @@ def test_allof_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py index 1c673eb4462..97f5b50dcc6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_simple_types_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py index 1f927a5ef30..7e15a5dbf22 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_base_schema_response_body_for_content_types/test_post.py @@ -62,9 +62,9 @@ def test_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py index dab2d49f05c..45b9993ca8a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_one_empty_schema_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_any_data_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py index 104a4a6bfd3..4f4c8413357 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_first_empty_schema_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py index db94f6e744d..f2d2107e6c2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_the_last_empty_schema_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py index 2d27c950636..31cb1fec1a3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_allof_with_two_empty_schemas_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_any_data_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py index 024e2f521c1..cec0027e36c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_complex_types_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_second_anyof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -122,9 +122,9 @@ def test_both_anyof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -155,9 +155,9 @@ def test_first_anyof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py index c62ddd2229a..899aafa04a2 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_second_anyof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_both_anyof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -139,9 +139,9 @@ def test_first_anyof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py index 430a1d6c359..a5369d7471f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_base_schema_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_one_anyof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py index 28bec0c94f8..a9b180943b8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_anyof_with_one_empty_schema_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_string_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -85,9 +85,9 @@ def test_number_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py index f1b175875fe..1df2749ce55 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_array_type_matches_arrays_response_body_for_content_types/test_post.py @@ -177,9 +177,9 @@ def test_an_array_is_an_array_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py index 5d489bf5914..151772063c3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_boolean_type_matches_booleans_response_body_for_content_types/test_post.py @@ -200,9 +200,9 @@ def test_false_is_a_boolean_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -254,9 +254,9 @@ def test_true_is_a_boolean_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py index dff50a95b87..1c2eca4ad0f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_int_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_int_by_int_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py index f374111600d..a82d9cdbfe4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_number_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_45_is_multiple_of15_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_zero_is_multiple_of_anything_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py index 6609e16fcb3..537c66dae21 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_by_small_number_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_00075_is_multiple_of00001_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py index c4deb3012e4..1f427a52f3b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_date_time_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py index a1d6fafd790..fb74fc7ecee 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_email_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py index 95b4319ae30..ed65ea6cbbb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with0_does_not_match_false_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_integer_zero_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -85,9 +85,9 @@ def test_float_zero_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py index 9b163553252..699ac6f7a2f 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with1_does_not_match_true_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_integer_one_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_float_one_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py index 3c378a44dca..1bbf16a57b3 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_escaped_characters_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_member2_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -85,9 +85,9 @@ def test_member1_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py index c1ab1e56f79..a0be659a637 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_false_does_not_match0_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_false_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py index c89f4ad56c5..ece254eb941 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enum_with_true_does_not_match1_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_true_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py index faa860a4ab1..86398b296b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_enums_in_properties_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_missing_optional_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -122,9 +122,9 @@ def test_both_properties_are_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py index 183a30de6aa..46c9287fb5c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_forbidden_property_response_body_for_content_types/test_post.py @@ -89,9 +89,9 @@ def test_property_absent_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py index 23508a83d45..89263e703a0 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_hostname_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py index 430774aa4db..1a032861e05 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_integer_type_matches_integers_response_body_for_content_types/test_post.py @@ -128,9 +128,9 @@ def test_a_float_with_zero_fractional_part_is_an_integer_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -206,9 +206,9 @@ def test_an_integer_is_an_integer_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py index eba4e486d2b..cfbf7e9ac83 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_instance_should_not_raise_error_when_float_division_inf_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_valid_integer_with_multipleof_float_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py index 05ed381d4b2..3b14195eb2b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_invalid_string_value_for_default_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_valid_when_property_is_specified_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -89,9 +89,9 @@ def test_still_valid_when_the_invalid_default_is_used_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py index 234c247fa46..a9718c27913 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv4_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py index 969b83215bb..948f6b1ccdd 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ipv6_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py index 5638fff2d63..1835384a8e9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_json_pointer_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py index bbc38df2529..24aebdf8e0c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_below_the_maximum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -85,9 +85,9 @@ def test_boundary_point_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -139,9 +139,9 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py index 6ecedef1eed..d1c75b37ae4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maximum_validation_with_unsigned_integer_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_below_the_maximum_is_invalid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_boundary_point_integer_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -139,9 +139,9 @@ def test_boundary_point_float_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py index 019ccba3caf..bbf6beb188e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxitems_validation_response_body_for_content_types/test_post.py @@ -83,9 +83,9 @@ def test_ignores_non_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -115,9 +115,9 @@ def test_shorter_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -148,9 +148,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py index bd68f747a60..4447c6b1d96 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxlength_validation_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_ignores_non_strings_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_shorter_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -139,9 +139,9 @@ def test_two_supplementary_unicode_code_points_is_long_enough_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -169,9 +169,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py index 27a206ff5a2..22e77cd30a8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties0_means_the_object_is_empty_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_no_properties_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py index 2a36c571442..edd49351777 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_maxproperties_validation_response_body_for_content_types/test_post.py @@ -90,9 +90,9 @@ def test_ignores_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -120,9 +120,9 @@ def test_ignores_other_non_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -150,9 +150,9 @@ def test_ignores_strings_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -183,9 +183,9 @@ def test_shorter_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -218,9 +218,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py index 1bdd16c637f..0b643fda6d4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_boundary_point_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_above_the_minimum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -139,9 +139,9 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py index f9eb34610ca..8b6972c6090 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minimum_validation_with_signed_integer_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_boundary_point_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -85,9 +85,9 @@ def test_positive_above_the_minimum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -163,9 +163,9 @@ def test_boundary_point_with_float_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -193,9 +193,9 @@ def test_negative_above_the_minimum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -223,9 +223,9 @@ def test_ignores_non_numbers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py index 95f6d7c87ca..fdb60bd4b28 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minitems_validation_response_body_for_content_types/test_post.py @@ -80,9 +80,9 @@ def test_ignores_non_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -113,9 +113,9 @@ def test_longer_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -145,9 +145,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py index cca4c80930f..dcf80e6eea8 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minlength_validation_response_body_for_content_types/test_post.py @@ -103,9 +103,9 @@ def test_longer_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -133,9 +133,9 @@ def test_ignores_non_strings_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -163,9 +163,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py index 91e62513769..9f07f1ffac6 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_minproperties_validation_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_ignores_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_ignores_other_non_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -141,9 +141,9 @@ def test_ignores_strings_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -176,9 +176,9 @@ def test_longer_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -209,9 +209,9 @@ def test_exact_length_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py index 53dcc587d22..fbe2c72625e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_allof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py index fd2da48fb03..236d28b0e6d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_anyof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py index bcc2824fd75..32c5476f86d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_items_response_body_for_content_types/test_post.py @@ -84,9 +84,9 @@ def test_valid_nested_array_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py index bb40e5af7c4..99fb7a12e4e 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nested_oneof_to_check_validation_semantics_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_null_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py index 552b499cae5..a347d33b5f5 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_more_complex_schema_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_other_match_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -115,9 +115,9 @@ def test_match_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py index d4abb87b57c..c825226753d 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_not_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_allowed_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py index 9bfcf8b0cfb..126fc76eca9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_nul_characters_in_strings_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_match_string_with_nul_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py index d65ff667891..b5b495287b9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_null_type_matches_only_the_null_object_response_body_for_content_types/test_post.py @@ -224,9 +224,9 @@ def test_null_is_null_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py index df0756ec73d..b9f3e70e1ad 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_number_type_matches_numbers_response_body_for_content_types/test_post.py @@ -153,9 +153,9 @@ def test_a_float_is_a_number_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -231,9 +231,9 @@ def test_an_integer_is_a_number_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -261,9 +261,9 @@ def test_a_float_with_zero_fractional_part_is_a_number_and_an_integer_passes(sel assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py index 87f64cc7950..819833532fa 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_properties_validation_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_ignores_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_ignores_other_non_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -151,9 +151,9 @@ def test_both_properties_present_and_valid_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -185,9 +185,9 @@ def test_doesn_t_invalidate_other_properties_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py index 6c318786299..99dba93528a 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_object_type_matches_objects_response_body_for_content_types/test_post.py @@ -129,9 +129,9 @@ def test_an_object_is_an_object_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py index 05fa5051d2e..f64e4afe54c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_complex_types_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_first_oneof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -149,9 +149,9 @@ def test_second_oneof_valid_complex_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py index 88ad93279cb..8242da229c9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_second_oneof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_first_oneof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py index 43c2afa584b..bc095d91fd7 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_base_schema_response_body_for_content_types/test_post.py @@ -103,9 +103,9 @@ def test_one_oneof_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py index c2db5988b42..e3e1225e469 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_empty_schema_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_one_valid_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py index 4b9c919de05..fe51fda4388 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_oneof_with_required_response_body_for_content_types/test_post.py @@ -118,9 +118,9 @@ def test_first_valid_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -153,9 +153,9 @@ def test_second_valid_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py index ce6ec5a5bbe..e048f3a6e07 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_is_not_anchored_response_body_for_content_types/test_post.py @@ -55,9 +55,9 @@ def test_matches_a_substring_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py index d34d2ce7768..f12e6cda66b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_pattern_validation_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_ignores_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -87,9 +87,9 @@ def test_ignores_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -117,9 +117,9 @@ def test_ignores_null_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -147,9 +147,9 @@ def test_ignores_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -201,9 +201,9 @@ def test_ignores_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -231,9 +231,9 @@ def test_a_matching_pattern_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -261,9 +261,9 @@ def test_ignores_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py index 15c45d4a412..1cc8ad6ee0b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_properties_with_escaped_characters_response_body_for_content_types/test_post.py @@ -68,9 +68,9 @@ def test_object_with_all_numbers_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py index c886c16d4cd..e7a04da581b 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_property_named_ref_that_is_not_a_reference_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py index 766520ed0d0..6a53f2d55ff 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_additionalproperties_response_body_for_content_types/test_post.py @@ -61,9 +61,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py index c7139267349..df00692dd7c 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_allof_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py index 01bd7297c37..40998960a72 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_anyof_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py index 484d131ef01..1c3ec604a69 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_items_response_body_for_content_types/test_post.py @@ -60,9 +60,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py index 0c6bc902d75..1fedd1a7574 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_not_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py index 5c877f69622..72ddc1930f4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_oneof_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py index fec60bf40a9..afac8c12930 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_ref_in_property_response_body_for_content_types/test_post.py @@ -61,9 +61,9 @@ def test_property_named_ref_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py index 32999f7f304..4bd5ced0712 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_default_validation_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_not_required_by_default_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py index 894a88c11d9..0366479ca91 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_validation_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_ignores_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -89,9 +89,9 @@ def test_present_required_property_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -119,9 +119,9 @@ def test_ignores_other_non_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -149,9 +149,9 @@ def test_ignores_strings_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py index b105d03bcd0..4abddf61cb9 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_empty_array_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_property_not_required_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py index 7d3a76dc3eb..a5a548b5146 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_required_with_escaped_characters_response_body_for_content_types/test_post.py @@ -97,9 +97,9 @@ def test_object_with_all_properties_present_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py index 51206ee3cb5..d0488d213b4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_simple_enum_validation_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_one_of_the_enum_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py index a7e6548a686..d2311fe16bb 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_string_type_matches_strings_response_body_for_content_types/test_post.py @@ -79,9 +79,9 @@ def test_a_string_is_still_a_string_even_if_it_looks_like_a_number_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -109,9 +109,9 @@ def test_an_empty_string_is_still_a_string_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -261,9 +261,9 @@ def test_a_string_is_a_string_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py index ec32ca0632a..b295d5951b4 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_the_default_keyword_does_not_do_anything_if_the_property_is_missing_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_missing_properties_are_not_filled_in_with_the_default_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -89,9 +89,9 @@ def test_an_explicit_property_value_is_checked_against_maximum_passing_passes(se assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py index f2c445f51d3..132d78cdc11 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_false_validation_response_body_for_content_types/test_post.py @@ -58,9 +58,9 @@ def test_non_unique_array_of_integers_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -97,9 +97,9 @@ def test_unique_array_of_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -148,9 +148,9 @@ def test_non_unique_array_of_nested_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -187,9 +187,9 @@ def test_non_unique_array_of_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -220,9 +220,9 @@ def test_1_and_true_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -253,9 +253,9 @@ def test_unique_array_of_integers_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -290,9 +290,9 @@ def test_non_unique_array_of_arrays_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -324,9 +324,9 @@ def test_numbers_are_unique_if_mathematically_unequal_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -357,9 +357,9 @@ def test_false_is_not_equal_to_zero_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -408,9 +408,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -441,9 +441,9 @@ def test_0_and_false_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -478,9 +478,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -511,9 +511,9 @@ def test_true_is_not_equal_to_one_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -552,9 +552,9 @@ def test_non_unique_heterogeneous_types_are_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -591,9 +591,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py index 8d7a20a6744..58045f15e15 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uniqueitems_validation_response_body_for_content_types/test_post.py @@ -64,9 +64,9 @@ def test_unique_array_of_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -103,9 +103,9 @@ def test_a_true_and_a1_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -181,9 +181,9 @@ def test_nested0_and_false_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -220,9 +220,9 @@ def test_a_false_and_a0_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -281,9 +281,9 @@ def test_false_is_not_equal_to_zero_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -318,9 +318,9 @@ def test_0_and_false_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -355,9 +355,9 @@ def test_unique_array_of_arrays_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -461,9 +461,9 @@ def test_true_is_not_equal_to_one_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -532,9 +532,9 @@ def test_unique_array_of_strings_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -569,9 +569,9 @@ def test_1_and_true_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -612,9 +612,9 @@ def test_different_objects_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -645,9 +645,9 @@ def test_unique_array_of_integers_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -763,9 +763,9 @@ def test_unique_array_of_nested_objects_is_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -865,9 +865,9 @@ def test_nested1_and_true_are_unique_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -905,9 +905,9 @@ def test_unique_heterogeneous_types_are_valid_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py index f580c7f48ae..ba5f4983c54 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py index 78c81d27efd..32f2c55f804 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_reference_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py index 553a3776b24..3a452288864 100644 --- a/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py +++ b/samples/openapi3/client/3_0_3_unit_test/python/test/test_paths/test_response_body_post_uri_template_format_response_body_for_content_types/test_post.py @@ -56,9 +56,9 @@ def test_all_string_formats_ignore_objects_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -86,9 +86,9 @@ def test_all_string_formats_ignore_booleans_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -116,9 +116,9 @@ def test_all_string_formats_ignore_integers_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -146,9 +146,9 @@ def test_all_string_formats_ignore_floats_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -177,9 +177,9 @@ def test_all_string_formats_ignore_arrays_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body @@ -207,9 +207,9 @@ def test_all_string_formats_ignore_nulls_passes(self): assert isinstance(api_response.response, urllib3.HTTPResponse) assert isinstance(api_response.body, self.response_body_schema) - deserialized_response_body = self.response_body_schema.from_openapi_data_( + deserialized_response_body = self.response_body_schema( payload, - configuration_=self.schema_config + configuration=self.schema_config ) assert api_response.body == deserialized_response_body diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION index 4a36342fcab..56fea8a08d2 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0 +3.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md index 95b9d458f05..5cdda24ff2c 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md @@ -184,9 +184,9 @@ with this_package.ApiClient(used_configuration) as api_client: # example passing only optional values body = operator.Operator( - a=3.14, - b=3.14, - operator_id="ADD", + "a": 3.14, + "b": 3.14, + "operator_id": "ADD", ) try: api_response = api_instance.post_operators( diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md index 16b22e33d04..517d8cf9134 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/docs/paths/operators/post.md @@ -92,9 +92,9 @@ with this_package.ApiClient(used_configuration) as api_client: # example passing only optional values body = operator.Operator( - a=3.14, - b=3.14, - operator_id="ADD", + "a": 3.14, + "b": 3.14, + "operator_id": "ADD", ) try: api_response = api_instance.post_operators( diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py index a31aad6b161..62ef16a7352 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/api_client.py @@ -719,13 +719,13 @@ def deserialize( """ if cls.style: extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) - return cls.schema.from_openapi_data_(extracted_data) + return cls.schema(extracted_data) assert cls.content is not None for content_type, media_type in cls.content.items(): if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) assert media_type.schema is not None - return media_type.schema.from_openapi_data_(cast_in_data) + return media_type.schema(cast_in_data) else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) raise ValueError('Invalid value for content, it was empty and must have 1 key value pair') @@ -940,8 +940,12 @@ def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_confi content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_( - body_data, configuration_=configuration) + body_schema = schemas._get_class(body_schema) + if body_schema is schemas.BinarySchema: + deserialized_body = body_schema(body_data) + else: + deserialized_body = body_schema( + body_data, configuration=configuration) elif streamed: response.release_conn() @@ -1410,8 +1414,6 @@ def serialize( schema = schemas._get_class(media_type.schema) if isinstance(in_data, schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = schema(**in_data) else: cast_in_data = schema(in_data) # TODO check for and use encoding if it exists diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py index 93cc2e9090f..ae9c035dad5 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/addition_operator.py @@ -34,6 +34,27 @@ class Schema_(metaclass=schemas.SingletonMeta): "operator_id": typing.Type[OperatorId], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "a": typing.Union[ + A[decimal.Decimal], + decimal.Decimal, + int, + float + ], + "b": typing.Union[ + B[decimal.Decimal], + decimal.Decimal, + int, + float + ], + "operator_id": typing.Union[ + OperatorId[str], + str + ], + } +) class AdditionOperator( @@ -91,32 +112,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - a: typing.Union[ - A[decimal.Decimal], - decimal.Decimal, - int, - float - ], - b: typing.Union[ - B[decimal.Decimal], - decimal.Decimal, - int, - float - ], - operator_id: typing.Union[ - OperatorId[str], - str + arg: typing.Union[ + DictInput3, + AdditionOperator[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionOperator[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - a=a, - b=b, - operator_id=operator_id, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( AdditionOperator[frozendict.frozendict], diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py index 3a97af0bf1f..bd4cf512168 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/operator.py @@ -10,6 +10,7 @@ from __future__ import annotations from this_package.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Operator( @@ -40,9 +41,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Operator[ typing.Union[ frozendict.frozendict, @@ -57,9 +60,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Operator[ diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py index 3ffa4bf9909..ffa85b8aec6 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/components/schema/subtraction_operator.py @@ -34,6 +34,27 @@ class Schema_(metaclass=schemas.SingletonMeta): "operator_id": typing.Type[OperatorId], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "a": typing.Union[ + A[decimal.Decimal], + decimal.Decimal, + int, + float + ], + "b": typing.Union[ + B[decimal.Decimal], + decimal.Decimal, + int, + float + ], + "operator_id": typing.Union[ + OperatorId[str], + str + ], + } +) class SubtractionOperator( @@ -91,32 +112,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - a: typing.Union[ - A[decimal.Decimal], - decimal.Decimal, - int, - float - ], - b: typing.Union[ - B[decimal.Decimal], - decimal.Decimal, - int, - float - ], - operator_id: typing.Union[ - OperatorId[str], - str + arg: typing.Union[ + DictInput3, + SubtractionOperator[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SubtractionOperator[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - a=a, - b=b, - operator_id=operator_id, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( SubtractionOperator[frozendict.frozendict], diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py index 2ff8b5046c0..0a3387caef0 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/src/this_package/schemas.py @@ -46,18 +46,18 @@ class FileIO(io.FileIO): Note: this class is not immutable """ - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(arg_, (io.FileIO, io.BufferedReader)): - if arg_.closed: + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') - arg_.close() + arg.close() super_cls: typing.Type = super(FileIO, cls) - inst = super_cls.__new__(cls, arg_.name) - super(FileIO, inst).__init__(arg_.name) + inst = super_cls.__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) return inst - raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + raise exceptions.ApiValueError('FileIO must be passed arg which contains the open file') - def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): """ if this does not exist, then classes with FileIO as a mixin (AnyType etc) will see the io.FileIO __init__ signature rather than the __new__ one @@ -129,11 +129,11 @@ def __call__(cls, *args, **kwargs): class Singleton: """ Enums and singletons are the same - The same instance is returned for a given key of (cls, arg_) + The same instance is returned for a given key of (cls, arg) """ _instances = {} - def __new__(cls, arg_: typing.Any, **kwargs): + def __new__(cls, arg: typing.Any, **kwargs): """ cls base classes: BoolClass, NoneClass, str, decimal.Decimal The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 @@ -141,16 +141,16 @@ def __new__(cls, arg_: typing.Any, **kwargs): Decimal('1.0') == Decimal('1') But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 """ - key = (cls, arg_, str(arg_)) + key = (cls, arg, str(arg)) if key not in cls._instances: - if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + if isinstance(arg, (none_type_, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: super_inst: typing.Type = super() - cls._instances[key] = super_inst.__new__(cls, arg_) + cls._instances[key] = super_inst.__new__(cls, arg) return cls._instances[key] def __repr__(self): @@ -1134,7 +1134,8 @@ def _get_discriminated_class_and_exception( ) -> typing.Tuple[typing.Optional['Schema'], typing.Optional[Exception]]: if not isinstance(arg, frozendict.frozendict): return None, None - discriminator = cls_schema().discriminator() + cls_schema = cls.Schema_() + discriminator = cls_schema.discriminator disc_prop_name = list(discriminator.keys())[0] try: __ensure_discriminator_value_present(disc_prop_name, validation_metadata, arg) @@ -1253,7 +1254,6 @@ def _validate( and k not in validation_metadata.configuration.disabled_json_schema_python_keywords } - print(f'json_schema_data {json_schema_data}') kwargs = {} if 'discriminator' in json_schema_data: discriminated_cls, ensure_discriminator_value_present_exc = _get_discriminated_class_and_exception( @@ -1427,60 +1427,13 @@ def _get_new_instance_without_conversion( used_arg = arg return super_cls.__new__(cls, used_arg) - @classmethod - def from_openapi_data_( - cls, - arg: typing.Union[ - str, - int, - float, - bool, - None, - dict, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None - ): - """ - Schema from_openapi_data_ - """ - from_server = True - validated_path_to_schemas = {} - path_to_type = {} - cast_arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) - validation_metadata = ValidationMetadata( - path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), - validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) - ) - path_to_schemas = cls.__get_new_cls(cast_arg, validation_metadata, path_to_type) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion( - cast_arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ dict, frozendict.frozendict, list, @@ -1499,49 +1452,20 @@ def __new__( io.BufferedReader, 'Schema', ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - Unset, - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - bool, - None, - bytes, - io.FileIO, - io.BufferedReader, - 'Schema', - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ Schema __new__ Args: - args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + arg (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + configuration: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords like minItems, minLength etc Note: double underscores are used here because pycharm thinks that these variables are instance properties if they are named normally :( """ - __kwargs = cls.__remove_unsets(kwargs) - if not args_ and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and args_ and not isinstance(args_[0], dict): - __arg = args_[0] - else: - __arg = cls.__get_input_dict(*args_, **__kwargs) + __arg = arg __from_server = False __validated_path_to_schemas = {} __path_to_type = {} @@ -1549,7 +1473,7 @@ def __new__( __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) __validation_metadata = ValidationMetadata( path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), + configuration=configuration or schema_configuration.SchemaConfiguration(), validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) ) __path_to_schemas = cls.__get_new_cls(cast_arg, __validation_metadata, __path_to_type) @@ -2208,12 +2132,12 @@ class ListSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - @classmethod - def from_openapi_data_(cls, arg: typing.Sequence[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Sequence[typing.Any], **kwargs: typing.Optional[schema_configuration.SchemaConfiguration]) -> ListSchema[tuple]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Sequence[typing.Any], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> ListSchema[tuple]: + return super().__new__(cls, arg, configuration=configuration) class NoneSchema( @@ -2225,12 +2149,12 @@ class NoneSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({NoneClass}) - @classmethod - def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration) -> NoneSchema[NoneClass]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: None, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NoneSchema[NoneClass]: + return super().__new__(cls, arg, configuration=configuration) class NumberSchema( @@ -2246,12 +2170,12 @@ class NumberSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) - @classmethod - def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> NumberSchema[decimal.Decimal]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NumberSchema[decimal.Decimal]: + return super().__new__(cls, arg, configuration=configuration) class IntBase: @@ -2272,12 +2196,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int' - @classmethod - def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> IntSchema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> IntSchema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration) return typing.cast(IntSchema[decimal.Decimal], inst) @@ -2289,8 +2213,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int32' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int32Schema[decimal.Decimal], inst) @@ -2302,8 +2230,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int64' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int64Schema[decimal.Decimal], inst) @@ -2315,12 +2247,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'float' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float32Schema[decimal.Decimal], inst) @@ -2332,12 +2264,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'double' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float64Schema[decimal.Decimal], inst) @@ -2356,12 +2288,12 @@ class StrSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) - @classmethod - def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> StrSchema[str]: - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> StrSchema[str]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> StrSchema[str]: + return super().__new__(cls, arg, configuration=configuration) class UUIDSchema(UUIDBase, StrSchema[T]): @@ -2370,8 +2302,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'uuid' - def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> UUIDSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> UUIDSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(UUIDSchema[str], inst) @@ -2381,8 +2317,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date' - def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration) -> DateSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateSchema[str], inst) @@ -2392,8 +2332,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date-time' - def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration) -> DateTimeSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.datetime], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateTimeSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateTimeSchema[str], inst) @@ -2403,7 +2347,11 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'number' - def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) -> DecimalSchema[str]: + def __new__( + cls, + arg: str, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DecimalSchema[str]: """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -2412,7 +2360,7 @@ def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema where it should stay as Decimal. """ - inst = super().__new__(cls, arg_, **kwargs) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DecimalSchema[str], inst) @@ -2427,9 +2375,13 @@ class BytesSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({bytes}) - def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration) -> BytesSchema[bytes]: + def __new__( + cls, + arg: bytes, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BytesSchema[bytes]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class FileSchema( @@ -2456,9 +2408,13 @@ class FileSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({FileIO}) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration) -> FileSchema[FileIO]: + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> FileSchema[FileIO]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class BinarySchema( @@ -2475,8 +2431,12 @@ class Schema_(metaclass=SingletonMeta): FileSchema, ) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration) -> BinarySchema[typing.Union[FileIO, bytes]]: - return super().__new__(cls, arg_) + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader, bytes], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BinarySchema[typing.Union[FileIO, bytes]]: + return super().__new__(cls, arg) class BoolSchema( @@ -2488,12 +2448,12 @@ class BoolSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({BoolClass}) - @classmethod - def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: bool, **kwargs: ValidationMetadata) -> BoolSchema[bool]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: bool, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BoolSchema[bool]: + return super().__new__(cls, arg, configuration=configuration) class AnyTypeSchema( @@ -2513,7 +2473,7 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2531,26 +2491,7 @@ def __new__( io.FileIO, io.BufferedReader ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader, - Unset - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None ) -> AnyTypeSchema[typing.Union[ NoneClass, frozendict.frozendict, @@ -2559,30 +2500,11 @@ def __new__( decimal.Decimal, BoolClass ]]: - return super().__new__(cls, *args_, configuration_=configuration_, **kwargs) + return super().__new__(cls, arg, configuration=configuration) def __init__( self, - *args_: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2600,6 +2522,7 @@ def __init__( io.FileIO, io.BufferedReader ], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ this exists to override the __init__ method form FileIO in NoneFrozenDictTupleStrDecimalBoolFileBytesMixin @@ -2625,10 +2548,10 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_, - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + arg, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> NotAnyTypeSchema[T]: - inst = super().__new__(cls, *args_, configuration_=configuration_) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(NotAnyTypeSchema[T], inst) @@ -2641,17 +2564,12 @@ class DictSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({frozendict.frozendict}) - @classmethod - def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, Schema, Unset, ValidationMetadata], + arg: typing.Union[dict[str, INPUT_TYPES_ALL_INCL_SCHEMA], frozendict.frozendict[str, INPUT_TYPES_ALL_INCL_SCHEMA]], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> DictSchema[frozendict.frozendict]: - return super().__new__(cls, *args_, **kwargs, configuration_=configuration_) + return super().__new__(cls, arg, configuration=configuration) schema_type_classes = frozenset({NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}) diff --git a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py index b6084f2d402..d9d38c18647 100644 --- a/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py +++ b/samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_manual/test_operator.py @@ -20,11 +20,11 @@ class TestOperator(unittest.TestCase): """Operator unit test stubs""" def test_discriminator_works(self): - op = Operator( - operator_id='ADD', - a=3.14, - b=3.14 - ) + op = Operator({ + 'operator_id': 'ADD', + 'a': 3.14, + 'b': 3.14 + }) assert op == dict( operator_id='ADD', a=3.14, diff --git a/samples/openapi3/client/features/security/python/.openapi-generator/VERSION b/samples/openapi3/client/features/security/python/.openapi-generator/VERSION index 4a36342fcab..56fea8a08d2 100644 --- a/samples/openapi3/client/features/security/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/security/python/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0 +3.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/features/security/python/src/this_package/api_client.py b/samples/openapi3/client/features/security/python/src/this_package/api_client.py index 0d6dec316d3..3783ffc0f1e 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/api_client.py +++ b/samples/openapi3/client/features/security/python/src/this_package/api_client.py @@ -719,13 +719,13 @@ def deserialize( """ if cls.style: extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) - return cls.schema.from_openapi_data_(extracted_data) + return cls.schema(extracted_data) assert cls.content is not None for content_type, media_type in cls.content.items(): if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) assert media_type.schema is not None - return media_type.schema.from_openapi_data_(cast_in_data) + return media_type.schema(cast_in_data) else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) raise ValueError('Invalid value for content, it was empty and must have 1 key value pair') @@ -940,8 +940,12 @@ def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_confi content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_( - body_data, configuration_=configuration) + body_schema = schemas._get_class(body_schema) + if body_schema is schemas.BinarySchema: + deserialized_body = body_schema(body_data) + else: + deserialized_body = body_schema( + body_data, configuration=configuration) elif streamed: response.release_conn() @@ -1410,8 +1414,6 @@ def serialize( schema = schemas._get_class(media_type.schema) if isinstance(in_data, schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = schema(**in_data) else: cast_in_data = schema(in_data) # TODO check for and use encoding if it exists diff --git a/samples/openapi3/client/features/security/python/src/this_package/schemas.py b/samples/openapi3/client/features/security/python/src/this_package/schemas.py index 835416dd93b..e4cd79c2c49 100644 --- a/samples/openapi3/client/features/security/python/src/this_package/schemas.py +++ b/samples/openapi3/client/features/security/python/src/this_package/schemas.py @@ -46,18 +46,18 @@ class FileIO(io.FileIO): Note: this class is not immutable """ - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(arg_, (io.FileIO, io.BufferedReader)): - if arg_.closed: + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') - arg_.close() + arg.close() super_cls: typing.Type = super(FileIO, cls) - inst = super_cls.__new__(cls, arg_.name) - super(FileIO, inst).__init__(arg_.name) + inst = super_cls.__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) return inst - raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + raise exceptions.ApiValueError('FileIO must be passed arg which contains the open file') - def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): """ if this does not exist, then classes with FileIO as a mixin (AnyType etc) will see the io.FileIO __init__ signature rather than the __new__ one @@ -129,11 +129,11 @@ def __call__(cls, *args, **kwargs): class Singleton: """ Enums and singletons are the same - The same instance is returned for a given key of (cls, arg_) + The same instance is returned for a given key of (cls, arg) """ _instances = {} - def __new__(cls, arg_: typing.Any, **kwargs): + def __new__(cls, arg: typing.Any, **kwargs): """ cls base classes: BoolClass, NoneClass, str, decimal.Decimal The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 @@ -141,16 +141,16 @@ def __new__(cls, arg_: typing.Any, **kwargs): Decimal('1.0') == Decimal('1') But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 """ - key = (cls, arg_, str(arg_)) + key = (cls, arg, str(arg)) if key not in cls._instances: - if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + if isinstance(arg, (none_type_, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: super_inst: typing.Type = super() - cls._instances[key] = super_inst.__new__(cls, arg_) + cls._instances[key] = super_inst.__new__(cls, arg) return cls._instances[key] def __repr__(self): @@ -1350,60 +1350,13 @@ def _get_new_instance_without_conversion( used_arg = arg return super_cls.__new__(cls, used_arg) - @classmethod - def from_openapi_data_( - cls, - arg: typing.Union[ - str, - int, - float, - bool, - None, - dict, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None - ): - """ - Schema from_openapi_data_ - """ - from_server = True - validated_path_to_schemas = {} - path_to_type = {} - cast_arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) - validation_metadata = ValidationMetadata( - path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), - validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) - ) - path_to_schemas = cls.__get_new_cls(cast_arg, validation_metadata, path_to_type) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion( - cast_arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ dict, frozendict.frozendict, list, @@ -1422,49 +1375,20 @@ def __new__( io.BufferedReader, 'Schema', ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - Unset, - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - bool, - None, - bytes, - io.FileIO, - io.BufferedReader, - 'Schema', - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ Schema __new__ Args: - args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + arg (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + configuration: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords like minItems, minLength etc Note: double underscores are used here because pycharm thinks that these variables are instance properties if they are named normally :( """ - __kwargs = cls.__remove_unsets(kwargs) - if not args_ and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and args_ and not isinstance(args_[0], dict): - __arg = args_[0] - else: - __arg = cls.__get_input_dict(*args_, **__kwargs) + __arg = arg __from_server = False __validated_path_to_schemas = {} __path_to_type = {} @@ -1472,7 +1396,7 @@ def __new__( __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) __validation_metadata = ValidationMetadata( path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), + configuration=configuration or schema_configuration.SchemaConfiguration(), validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) ) __path_to_schemas = cls.__get_new_cls(cast_arg, __validation_metadata, __path_to_type) @@ -2131,12 +2055,12 @@ class ListSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - @classmethod - def from_openapi_data_(cls, arg: typing.Sequence[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Sequence[typing.Any], **kwargs: typing.Optional[schema_configuration.SchemaConfiguration]) -> ListSchema[tuple]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Sequence[typing.Any], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> ListSchema[tuple]: + return super().__new__(cls, arg, configuration=configuration) class NoneSchema( @@ -2148,12 +2072,12 @@ class NoneSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({NoneClass}) - @classmethod - def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration) -> NoneSchema[NoneClass]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: None, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NoneSchema[NoneClass]: + return super().__new__(cls, arg, configuration=configuration) class NumberSchema( @@ -2169,12 +2093,12 @@ class NumberSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) - @classmethod - def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> NumberSchema[decimal.Decimal]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NumberSchema[decimal.Decimal]: + return super().__new__(cls, arg, configuration=configuration) class IntBase: @@ -2195,12 +2119,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int' - @classmethod - def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> IntSchema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> IntSchema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration) return typing.cast(IntSchema[decimal.Decimal], inst) @@ -2212,8 +2136,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int32' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int32Schema[decimal.Decimal], inst) @@ -2225,8 +2153,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int64' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int64Schema[decimal.Decimal], inst) @@ -2238,12 +2170,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'float' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float32Schema[decimal.Decimal], inst) @@ -2255,12 +2187,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'double' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float64Schema[decimal.Decimal], inst) @@ -2279,12 +2211,12 @@ class StrSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) - @classmethod - def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> StrSchema[str]: - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> StrSchema[str]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> StrSchema[str]: + return super().__new__(cls, arg, configuration=configuration) class UUIDSchema(UUIDBase, StrSchema[T]): @@ -2293,8 +2225,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'uuid' - def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> UUIDSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> UUIDSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(UUIDSchema[str], inst) @@ -2304,8 +2240,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date' - def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration) -> DateSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateSchema[str], inst) @@ -2315,8 +2255,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date-time' - def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration) -> DateTimeSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.datetime], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateTimeSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateTimeSchema[str], inst) @@ -2326,7 +2270,11 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'number' - def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) -> DecimalSchema[str]: + def __new__( + cls, + arg: str, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DecimalSchema[str]: """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -2335,7 +2283,7 @@ def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema where it should stay as Decimal. """ - inst = super().__new__(cls, arg_, **kwargs) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DecimalSchema[str], inst) @@ -2350,9 +2298,13 @@ class BytesSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({bytes}) - def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration) -> BytesSchema[bytes]: + def __new__( + cls, + arg: bytes, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BytesSchema[bytes]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class FileSchema( @@ -2379,9 +2331,13 @@ class FileSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({FileIO}) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration) -> FileSchema[FileIO]: + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> FileSchema[FileIO]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class BinarySchema( @@ -2398,8 +2354,12 @@ class Schema_(metaclass=SingletonMeta): FileSchema, ) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration) -> BinarySchema[typing.Union[FileIO, bytes]]: - return super().__new__(cls, arg_) + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader, bytes], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BinarySchema[typing.Union[FileIO, bytes]]: + return super().__new__(cls, arg) class BoolSchema( @@ -2411,12 +2371,12 @@ class BoolSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({BoolClass}) - @classmethod - def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: bool, **kwargs: ValidationMetadata) -> BoolSchema[bool]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: bool, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BoolSchema[bool]: + return super().__new__(cls, arg, configuration=configuration) class AnyTypeSchema( @@ -2436,7 +2396,7 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2454,26 +2414,7 @@ def __new__( io.FileIO, io.BufferedReader ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader, - Unset - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None ) -> AnyTypeSchema[typing.Union[ NoneClass, frozendict.frozendict, @@ -2482,30 +2423,11 @@ def __new__( decimal.Decimal, BoolClass ]]: - return super().__new__(cls, *args_, configuration_=configuration_, **kwargs) + return super().__new__(cls, arg, configuration=configuration) def __init__( self, - *args_: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2523,6 +2445,7 @@ def __init__( io.FileIO, io.BufferedReader ], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ this exists to override the __init__ method form FileIO in NoneFrozenDictTupleStrDecimalBoolFileBytesMixin @@ -2548,10 +2471,10 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_, - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + arg, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> NotAnyTypeSchema[T]: - inst = super().__new__(cls, *args_, configuration_=configuration_) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(NotAnyTypeSchema[T], inst) @@ -2564,17 +2487,12 @@ class DictSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({frozendict.frozendict}) - @classmethod - def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, Schema, Unset, ValidationMetadata], + arg: typing.Union[dict[str, INPUT_TYPES_ALL_INCL_SCHEMA], frozendict.frozendict[str, INPUT_TYPES_ALL_INCL_SCHEMA]], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> DictSchema[frozendict.frozendict]: - return super().__new__(cls, *args_, **kwargs, configuration_=configuration_) + return super().__new__(cls, arg, configuration=configuration) schema_type_classes = frozenset({NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}) diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 4a36342fcab..56fea8a08d2 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0 +3.0.0 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/items.md b/samples/openapi3/client/petstore/python/docs/components/schema/items.md index dd76e5362c3..287b6a6a841 100644 --- a/samples/openapi3/client/petstore/python/docs/components/schema/items.md +++ b/samples/openapi3/client/petstore/python/docs/components/schema/items.md @@ -12,9 +12,9 @@ list, tuple | tuple | component's name collides with the inner schema name ## List Items Class Name | Input Type | Accessed Type | Description | Notes ------------- | ------------- | ------------- | ------------- | ------------- -[items](#items) | dict, frozendict.frozendict | frozendict.frozendict | | +[items](#items2) | dict, frozendict.frozendict | frozendict.frozendict | | -# Items +# Items2 ## Type Info Input Type | Accessed Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md index 0a434163e4d..33b2761bbd9 100644 --- a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.md @@ -24,6 +24,7 @@ dict, frozendict.frozendict | frozendict.frozendict | | Key | Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- | ------------- **test** | dict, frozendict.frozendict, str, datetime.date, datetime.datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, io.FileIO | | +**name** | str | str | | [optional] **any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] [[Back to top]](#top) [[Back to Component Schemas]](../../../README.md#Component-Schemas) [[Back to README]](../../../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md index a74b0cdd42c..dc2d22a2f15 100644 --- a/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md +++ b/samples/openapi3/client/petstore/python/docs/components/schema/object_with_colliding_properties.md @@ -13,7 +13,7 @@ dict, frozendict.frozendict | frozendict.frozendict | component with properties Key | Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- | ------------- **someProp** | dict, frozendict.frozendict | [properties.SomeProp](#properties-someprop) | | [optional] -**someprop** | dict, frozendict.frozendict | [properties.Someprop](#properties-someprop) | | [optional] +**someprop** | dict, frozendict.frozendict | [properties.Someprop2](#properties-someprop2) | | [optional] **any_string_name** | dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, io.FileIO, io.BufferedReader, schemas.Schema | frozendict.frozendict, tuple, decimal.Decimal, str, bytes, BoolClass, NoneClass, FileIO | any string name can be used but the value must be the correct type | [optional] # properties SomeProp @@ -23,7 +23,7 @@ Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- dict, frozendict.frozendict | frozendict.frozendict | | -# properties Someprop +# properties Someprop2 ## Type Info Input Type | Accessed Type | Description | Notes diff --git a/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md b/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md index dc437d088e5..d1e85e74574 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md +++ b/samples/openapi3/client/petstore/python/docs/paths/another_fake_dummy/patch.md @@ -95,9 +95,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = another_fake_api.AnotherFakeApi(api_client) # example passing only required values which don't have defaults set - body = client.Client( - client="client_example", - ) + body = client.Client({ + "client": "client_example", + }) try: # To test special tags api_response = api_instance.call_123_test__special_tags( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake/get.md index f192513f05a..4dbfc05776a 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake/get.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/get.md @@ -253,12 +253,12 @@ with petstore_api.ApiClient(used_configuration) as api_client: ], 'enum_header_string': "-efg", } - body = dict( - enum_form_string_array=[ + body = { + "enum_form_string_array": [ "$" ], - enum_form_string="-efg", - ) + "enum_form_string": "-efg", + } try: # To test enum parameters api_response = api_instance.enum_parameters( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md b/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md index 9d46194e575..e2b7976771d 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/patch.md @@ -95,9 +95,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only required values which don't have defaults set - body = client.Client( - client="client_example", - ) + body = client.Client({ + "client": "client_example", + }) try: # To test \"client\" model api_response = api_instance.client_model( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake/post.md index 39a833aee6b..da32cb81c51 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake/post.md @@ -143,22 +143,22 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = dict( - integer=10, - int32=20, - int64=1, - number=32.1, - _float=3.14, - double=67.8, - string="A", - pattern_without_delimiter="AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>", - byte='YQ==', - binary=open('/path/to/file', 'rb'), - date="1970-01-01", - date_time="2020-02-02T20:20:20.222220Z", - password="password_example", - callback="callback_example", - ) + body = { + "integer": 10, + "int32": 20, + "int64": 1, + "number": 32.1, + "_float": 3.14, + "double": 67.8, + "string": "A", + "pattern_without_delimiter": "AUR,rZ#UM/?R,Fp^l6$ARjbhJk C>", + "byte": 'YQ==', + "binary": open('/path/to/file', 'rb'), + "date": "1970-01-01", + "date_time": "2020-02-02T20:20:20.222220Z", + "password": "password_example", + "callback": "callback_example", + } try: # Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 api_response = api_instance.endpoint_parameters( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md index 157724a430a..2d82dc3325e 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_additional_properties_with_array_of_enums/get.md @@ -111,11 +111,11 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums( - key=[ + body = additional_properties_with_array_of_enums.AdditionalPropertiesWithArrayOfEnums({ + "key": [ enum_class.EnumClass("-efg") ], - ) + }) try: # Additional Properties with Array of Enums api_response = api_instance.additional_properties_with_array_of_enums( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md index 49686ac8b18..8d42cb4fa1d 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_file_schema/put.md @@ -82,14 +82,14 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only required values which don't have defaults set - body = file_schema_test_class.FileSchemaTestClass( - file=file.File( - source_uri="source_uri_example", - ), - files=[ - file.File() + body = file_schema_test_class.FileSchemaTestClass({ + "file": file.File({ + "source_uri": "source_uri_example", + }), + "files": [ + file.File({}) ], - ) + }) try: api_response = api_instance.body_with_file_schema( body=body, diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md index 2a930a86e41..9581f17dc3e 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_body_with_query_params/put.md @@ -104,21 +104,21 @@ with petstore_api.ApiClient(used_configuration) as api_client: query_params: operation.RequestQueryParameters.Params = { 'query': "query_example", } - body = user.User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) + body = user.User({ + "id": 1, + "username": "username_example", + "first_name": "first_name_example", + "last_name": "last_name_example", + "email": "email_example", + "password": "password_example", + "phone": "phone_example", + "user_status": 1, + "object_with_no_declared_props": {}, + "object_with_no_declared_props_nullable": {}, + "any_type_prop": None, + "any_type_except_null_prop": None, + "any_type_prop_nullable": None, + }) try: api_response = api_instance.body_with_query_params( query_params=query_params, diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md b/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md index 9ab5bf311dc..5eb7bb80023 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_classname_test/patch.md @@ -122,9 +122,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_classname_tags123_api.FakeClassnameTags123Api(api_client) # example passing only required values which don't have defaults set - body = client.Client( - client="client_example", - ) + body = client.Client({ + "client": "client_example", + }) try: # To test class name in snake case api_response = api_instance.classname( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md index a12c017e6ef..23d46582133 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_additional_properties/post.md @@ -90,9 +90,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only required values which don't have defaults set - body = dict( + body = { "key": "key_example", - ) + } try: # test inline additionalProperties api_response = api_instance.inline_additional_properties( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md index ae2725c0b34..a2081eba332 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_inline_composition/post.md @@ -275,9 +275,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only optional values query_params: operation.RequestQueryParameters.Params = { 'compositionAtRoot': None, - 'compositionInProperty': dict( - some_prop=None, - ), + 'compositionInProperty': { + "some_prop": None, + }, } body = None try: diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md index daa995c8d01..0ea8999dd88 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_json_form_data/get.md @@ -89,10 +89,10 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = dict( - param="param_example", - param2="param2_example", - ) + body = { + "param": "param_example", + "param2": "param2_example", + } try: # test json serialization of form data api_response = api_instance.json_form_data( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md index bd8e6599dc4..c5de8ee7adf 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_obj_in_query/get.md @@ -96,9 +96,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only optional values query_params: operation.RequestQueryParameters.Params = { - 'mapBean': dict( - keyword="keyword_example", - ), + 'mapBean': { + "keyword": "keyword_example", + }, } try: # user list diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md index b98215c45d7..f25507c392e 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_pet_id_upload_image_with_required_file/post.md @@ -180,10 +180,10 @@ with petstore_api.ApiClient(used_configuration) as api_client: path_params = { 'petId': 1, } - body = dict( - additional_metadata="additional_metadata_example", - required_file=open('/path/to/file', 'rb'), - ) + body = { + "additional_metadata": "additional_metadata_example", + "required_file": open('/path/to/file', 'rb'), + } try: # uploads an image (required) api_response = api_instance.upload_file_with_required_file( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md b/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md index c3f23d7a7cc..170e941e55f 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_ref_obj_in_query/get.md @@ -90,9 +90,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only optional values query_params: operation.RequestQueryParameters.Params = { - 'mapBean': foo.Foo( - bar=bar.Bar("bar"), - ), + 'mapBean': foo.Foo({ + "bar": bar.Bar("bar"), + }), } try: # user list diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md index f4b266c3338..8118eb3c394 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_arraymodel/post.md @@ -112,7 +112,7 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only optional values body = animal_farm.AnimalFarm([ - animal.Animal() + animal.Animal({}) ]) try: api_response = api_instance.array_model( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md index a8c0bcd48ce..e403a8621e4 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_mammal/post.md @@ -112,9 +112,9 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only required values which don't have defaults set body = mammal.Mammal( - has_baleen=True, - has_teeth=True, - class_name="whale", + "has_baleen": True, + "has_teeth": True, + "class_name": "whale", ) try: api_response = api_instance.mammal( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md index a664a90be34..83185da47ac 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_refs_object_model_with_ref_props/post.md @@ -111,11 +111,11 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = object_model_with_ref_props.ObjectModelWithRefProps( - my_number=number_with_validations.NumberWithValidations(10), - my_string=string.String("my_string_example"), - my_boolean=boolean.Boolean(True), - ) + body = object_model_with_ref_props.ObjectModelWithRefProps({ + "my_number": number_with_validations.NumberWithValidations(10), + "my_string": string.String("my_string_example"), + "my_boolean": boolean.Boolean(True), + }) try: api_response = api_instance.object_model_with_ref_props( body=body, diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md index 6863b5346bd..1fd8d7f0350 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_file/post.md @@ -115,10 +115,10 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = dict( - additional_metadata="additional_metadata_example", - file=open('/path/to/file', 'rb'), - ) + body = { + "additional_metadata": "additional_metadata_example", + "file": open('/path/to/file', 'rb'), + } try: # uploads a file using multipart/form-data api_response = api_instance.upload_file( diff --git a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md index 0a0e488cc3d..709d57df9a5 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/fake_upload_files/post.md @@ -126,11 +126,11 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = fake_api.FakeApi(api_client) # example passing only optional values - body = dict( - files=[ + body = { + "files": [ open('/path/to/file', 'rb') ], - ) + } try: # uploads files using multipart/form-data api_response = api_instance.upload_files( diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet/post.md index 967f46df200..ab5c06f95e2 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/pet/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/pet/post.md @@ -154,24 +154,24 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = pet_api.PetApi(api_client) # example passing only required values which don't have defaults set - body = pet.Pet( - id=1, - category=category.Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ + body = pet.Pet({ + "id": 1, + "category": category.Category({ + "id": 1, + "name": "default-name", + }), + "name": "doggie", + "photo_urls": [ "photo_urls_example" ], - tags=[ - tag.Tag( - id=1, - name="name_example", - ) + "tags": [ + tag.Tag({ + "id": 1, + "name": "name_example", + }) ], - status="available", - ) + "status": "available", + }) try: # Add a new pet to the store api_response = api_instance.add_pet( diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet/put.md b/samples/openapi3/client/petstore/python/docs/paths/pet/put.md index 58369611d13..65746085844 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/pet/put.md +++ b/samples/openapi3/client/petstore/python/docs/paths/pet/put.md @@ -166,24 +166,24 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = pet_api.PetApi(api_client) # example passing only required values which don't have defaults set - body = pet.Pet( - id=1, - category=category.Category( - id=1, - name="default-name", - ), - name="doggie", - photo_urls=[ + body = pet.Pet({ + "id": 1, + "category": category.Category({ + "id": 1, + "name": "default-name", + }), + "name": "doggie", + "photo_urls": [ "photo_urls_example" ], - tags=[ - tag.Tag( - id=1, - name="name_example", - ) + "tags": [ + tag.Tag({ + "id": 1, + "name": "name_example", + }) ], - status="available", - ) + "status": "available", + }) try: # Update an existing pet api_response = api_instance.update_pet( diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md index c6bb0995727..88118cb9542 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id/post.md @@ -183,10 +183,10 @@ with petstore_api.ApiClient(used_configuration) as api_client: path_params = { 'petId': 1, } - body = dict( - name="name_example", - status="status_example", - ) + body = { + "name": "name_example", + "status": "status_example", + } try: # Updates a pet in the store with form data api_response = api_instance.update_pet_with_form( diff --git a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md index 667b6839626..01fd351794f 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/pet_pet_id_upload_image/post.md @@ -155,10 +155,10 @@ with petstore_api.ApiClient(used_configuration) as api_client: path_params = { 'petId': 1, } - body = dict( - additional_metadata="additional_metadata_example", - file=open('/path/to/file', 'rb'), - ) + body = { + "additional_metadata": "additional_metadata_example", + "file": open('/path/to/file', 'rb'), + } try: # uploads an image api_response = api_instance.upload_image( diff --git a/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md b/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md index b218427247b..6ab573cb395 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/store_order/post.md @@ -131,14 +131,14 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = store_api.StoreApi(api_client) # example passing only required values which don't have defaults set - body = order.Order( - id=1, - pet_id=1, - quantity=1, - ship_date="2020-02-02T20:20:20.000222Z", - status="placed", - complete=False, - ) + body = order.Order({ + "id": 1, + "pet_id": 1, + "quantity": 1, + "ship_date": "2020-02-02T20:20:20.000222Z", + "status": "placed", + "complete": False, + }) try: # Place an order for a pet api_response = api_instance.place_order( diff --git a/samples/openapi3/client/petstore/python/docs/paths/user/post.md b/samples/openapi3/client/petstore/python/docs/paths/user/post.md index e299aac0562..80cad9f4180 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/user/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/user/post.md @@ -98,21 +98,21 @@ with petstore_api.ApiClient(used_configuration) as api_client: api_instance = user_api.UserApi(api_client) # example passing only required values which don't have defaults set - body = user.User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) + body = user.User({ + "id": 1, + "username": "username_example", + "first_name": "first_name_example", + "last_name": "last_name_example", + "email": "email_example", + "password": "password_example", + "phone": "phone_example", + "user_status": 1, + "object_with_no_declared_props": {}, + "object_with_no_declared_props_nullable": {}, + "any_type_prop": None, + "any_type_except_null_prop": None, + "any_type_prop_nullable": None, + }) try: # Create user api_response = api_instance.create_user( diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md index 25407e0c9e1..cfa62e3a710 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_array/post.md @@ -81,21 +81,21 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only required values which don't have defaults set body = [ - user.User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) + user.User({ + "id": 1, + "username": "username_example", + "first_name": "first_name_example", + "last_name": "last_name_example", + "email": "email_example", + "password": "password_example", + "phone": "phone_example", + "user_status": 1, + "object_with_no_declared_props": {}, + "object_with_no_declared_props_nullable": {}, + "any_type_prop": None, + "any_type_except_null_prop": None, + "any_type_prop_nullable": None, + }) ] try: # Creates list of users with given input array diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md index f063c640125..872a553fca8 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md +++ b/samples/openapi3/client/petstore/python/docs/paths/user_create_with_list/post.md @@ -81,21 +81,21 @@ with petstore_api.ApiClient(used_configuration) as api_client: # example passing only required values which don't have defaults set body = [ - user.User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) + user.User({ + "id": 1, + "username": "username_example", + "first_name": "first_name_example", + "last_name": "last_name_example", + "email": "email_example", + "password": "password_example", + "phone": "phone_example", + "user_status": 1, + "object_with_no_declared_props": {}, + "object_with_no_declared_props_nullable": {}, + "any_type_prop": None, + "any_type_except_null_prop": None, + "any_type_prop_nullable": None, + }) ] try: # Creates list of users with given input array diff --git a/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md b/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md index 9a6642cc671..d2dfb8626d0 100644 --- a/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md +++ b/samples/openapi3/client/petstore/python/docs/paths/user_username/put.md @@ -125,21 +125,21 @@ with petstore_api.ApiClient(used_configuration) as api_client: path_params: operation.RequestPathParameters.Params = { 'username': "username_example", } - body = user.User( - id=1, - username="username_example", - first_name="first_name_example", - last_name="last_name_example", - email="email_example", - password="password_example", - phone="phone_example", - user_status=1, - object_with_no_declared_props=dict(), - object_with_no_declared_props_nullable=dict(), - any_type_prop=None, - any_type_except_null_prop=None, - any_type_prop_nullable=None, - ) + body = user.User({ + "id": 1, + "username": "username_example", + "first_name": "first_name_example", + "last_name": "last_name_example", + "email": "email_example", + "password": "password_example", + "phone": "phone_example", + "user_status": 1, + "object_with_no_declared_props": {}, + "object_with_no_declared_props_nullable": {}, + "any_type_prop": None, + "any_type_except_null_prop": None, + "any_type_prop_nullable": None, + }) try: # Updated user api_response = api_instance.update_user( diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py index 0fce536bbc3..56888878eed 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/api_client.py @@ -719,13 +719,13 @@ def deserialize( """ if cls.style: extracted_data = cls._deserialize_simple(in_data, name, cls.explode, False) - return cls.schema.from_openapi_data_(extracted_data) + return cls.schema(extracted_data) assert cls.content is not None for content_type, media_type in cls.content.items(): if cls._content_type_is_json(content_type): cast_in_data = json.loads(in_data) assert media_type.schema is not None - return media_type.schema.from_openapi_data_(cast_in_data) + return media_type.schema(cast_in_data) else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) raise ValueError('Invalid value for content, it was empty and must have 1 key value pair') @@ -940,8 +940,12 @@ def deserialize(cls, response: urllib3.HTTPResponse, configuration: schema_confi content_type = 'multipart/form-data' else: raise NotImplementedError('Deserialization of {} has not yet been implemented'.format(content_type)) - deserialized_body = body_schema.from_openapi_data_( - body_data, configuration_=configuration) + body_schema = schemas._get_class(body_schema) + if body_schema is schemas.BinarySchema: + deserialized_body = body_schema(body_data) + else: + deserialized_body = body_schema( + body_data, configuration=configuration) elif streamed: response.release_conn() @@ -1410,8 +1414,6 @@ def serialize( schema = schemas._get_class(media_type.schema) if isinstance(in_data, schema): cast_in_data = in_data - elif isinstance(in_data, (dict, frozendict.frozendict)) and in_data: - cast_in_data = schema(**in_data) else: cast_in_data = schema(in_data) # TODO check for and use encoding if it exists diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py index bd05e0c284e..3b2e472d7df 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/request_bodies/request_body_user_array/content/application_json/schema.py @@ -24,19 +24,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ user.User[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py index da3877c8b2a..e735d848f7f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_success_inline_content_and_header/content/application_json/schema.py @@ -11,6 +11,14 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.Int32Schema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[decimal.Decimal], + decimal.Decimal, + int + ], +] class Schema( @@ -29,19 +37,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[decimal.Decimal]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[decimal.Decimal], - decimal.Decimal, - int + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py index 645ab0e3b45..0cc37157f48 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_json/schema.py @@ -24,19 +24,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ ref_pet.RefPet[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py index eb78d740ac9..d004980c97b 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/responses/response_successful_xml_and_json_array_of_pet/content/application_xml/schema.py @@ -24,19 +24,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ pet.Pet[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py index 3b3d5363c6d..55e91e9c7aa 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_200_response.py @@ -19,6 +19,21 @@ "class": typing.Type[_Class], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + _Class[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _200Response( @@ -70,15 +85,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - name: typing.Union[ - Name[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _200Response[ typing.Union[ frozendict.frozendict, @@ -93,10 +104,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - name=name, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _200Response[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py index 74a44220c4a..e78223ca5c6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/_return.py @@ -10,13 +10,24 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * -_Return: typing_extensions.TypeAlias = schemas.Int32Schema[U] +Return2: typing_extensions.TypeAlias = schemas.Int32Schema[U] Properties = typing_extensions.TypedDict( 'Properties', { - "return": typing.Type[_Return], + "return": typing.Type[Return2], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Return2[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _Return( @@ -38,7 +49,7 @@ class Schema_(metaclass=schemas.SingletonMeta): @typing.overload - def __getitem__(self, name: typing_extensions.Literal["return"]) -> _Return[decimal.Decimal]: ... + def __getitem__(self, name: typing_extensions.Literal["return"]) -> Return2[decimal.Decimal]: ... @typing.overload def __getitem__(self, name: str) -> schemas.AnyTypeSchema[typing.Union[ @@ -64,9 +75,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _Return[ typing.Union[ frozendict.frozendict, @@ -81,9 +94,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _Return[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py index 6a6a4c1177a..99798f3ca61 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/abstract_step_message.py @@ -17,6 +17,72 @@ "discriminator": typing.Type[Discriminator], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Discriminator[str], + str + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class AbstractStepMessage( @@ -135,78 +201,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - description: typing.Union[ - schemas.AnyTypeSchema[typing.Union[ - frozendict.frozendict, - str, - decimal.Decimal, - schemas.BoolClass, - schemas.NoneClass, - tuple, - bytes, - schemas.FileIO - ]], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ], - discriminator: typing.Union[ - Discriminator[str], - str - ], - sequenceNumber: typing.Union[ - schemas.AnyTypeSchema[typing.Union[ - frozendict.frozendict, - str, - decimal.Decimal, - schemas.BoolClass, - schemas.NoneClass, - tuple, - bytes, - schemas.FileIO - ]], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + AbstractStepMessage[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AbstractStepMessage[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - description=description, - discriminator=discriminator, - sequenceNumber=sequenceNumber, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AbstractStepMessage[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py index a8cc6180c62..8b9bf4d7bd4 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_class.py @@ -11,6 +11,13 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[str], + str + ], +] class MapProperty( @@ -29,18 +36,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[str], - str + arg: typing.Union[ + DictInput, + MapProperty[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapProperty[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapProperty[frozendict.frozendict], @@ -49,6 +54,13 @@ def __new__( return inst AdditionalProperties3: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput2 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties3[str], + str + ], +] class AdditionalProperties2( @@ -67,18 +79,16 @@ def __getitem__(self, name: str) -> AdditionalProperties3[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties3[str], - str + arg: typing.Union[ + DictInput2, + AdditionalProperties2[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties2[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties2[frozendict.frozendict], @@ -86,6 +96,14 @@ def __new__( ) return inst +DictInput3 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties2[frozendict.frozendict], + dict, + frozendict.frozendict + ], +] class MapOfMapProperty( @@ -104,19 +122,16 @@ def __getitem__(self, name: str) -> AdditionalProperties2[frozendict.frozendict] def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties2[frozendict.frozendict], - dict, - frozendict.frozendict + arg: typing.Union[ + DictInput3, + MapOfMapProperty[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapOfMapProperty[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapOfMapProperty[frozendict.frozendict], @@ -124,10 +139,38 @@ def __new__( ) return inst +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Anytype1: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput5 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] MapWithUndeclaredPropertiesAnytype1: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput6 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] MapWithUndeclaredPropertiesAnytype2: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput7 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AdditionalProperties4: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput8 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties4[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], +] class MapWithUndeclaredPropertiesAnytype3( @@ -155,35 +198,16 @@ def __getitem__(self, name: str) -> AdditionalProperties4[typing.Union[ def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties4[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput8, + MapWithUndeclaredPropertiesAnytype3[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapWithUndeclaredPropertiesAnytype3[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapWithUndeclaredPropertiesAnytype3[frozendict.frozendict], @@ -192,6 +216,7 @@ def __new__( return inst AdditionalProperties5: typing_extensions.TypeAlias = schemas.NotAnyTypeSchema[U] +DictInput11 = typing.Mapping # mapping must be empty class EmptyMap( @@ -206,13 +231,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: typing.Union[ + DictInput11, + EmptyMap[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EmptyMap[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( EmptyMap[frozendict.frozendict], @@ -221,6 +249,13 @@ def __new__( return inst AdditionalProperties6: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput12 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties6[str], + str + ], +] class MapWithUndeclaredPropertiesString( @@ -239,18 +274,16 @@ def __getitem__(self, name: str) -> AdditionalProperties6[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties6[str], - str + arg: typing.Union[ + DictInput12, + MapWithUndeclaredPropertiesString[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapWithUndeclaredPropertiesString[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapWithUndeclaredPropertiesString[frozendict.frozendict], @@ -271,6 +304,68 @@ def __new__( "map_with_undeclared_properties_string": typing.Type[MapWithUndeclaredPropertiesString], } ) +DictInput13 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + MapProperty[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + MapOfMapProperty[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + Anytype1[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + MapWithUndeclaredPropertiesAnytype1[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + MapWithUndeclaredPropertiesAnytype2[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + MapWithUndeclaredPropertiesAnytype3[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + EmptyMap[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + MapWithUndeclaredPropertiesString[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class AdditionalPropertiesClass( @@ -352,87 +447,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - map_property: typing.Union[ - MapProperty[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - map_of_map_property: typing.Union[ - MapOfMapProperty[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - anytype_1: typing.Union[ - Anytype1[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - map_with_undeclared_properties_anytype_1: typing.Union[ - MapWithUndeclaredPropertiesAnytype1[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - map_with_undeclared_properties_anytype_2: typing.Union[ - MapWithUndeclaredPropertiesAnytype2[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - map_with_undeclared_properties_anytype_3: typing.Union[ - MapWithUndeclaredPropertiesAnytype3[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - empty_map: typing.Union[ - EmptyMap[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - map_with_undeclared_properties_string: typing.Union[ - MapWithUndeclaredPropertiesString[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput13, + AdditionalPropertiesClass[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalPropertiesClass[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - map_property=map_property, - map_of_map_property=map_of_map_property, - anytype_1=anytype_1, - map_with_undeclared_properties_anytype_1=map_with_undeclared_properties_anytype_1, - map_with_undeclared_properties_anytype_2=map_with_undeclared_properties_anytype_2, - map_with_undeclared_properties_anytype_3=map_with_undeclared_properties_anytype_3, - empty_map=empty_map, - map_with_undeclared_properties_string=map_with_undeclared_properties_string, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalPropertiesClass[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py index d9d3144bdde..4d63f383ce6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_validator.py @@ -10,7 +10,32 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AdditionalProperties: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], +] class _0( @@ -38,35 +63,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[typing.Union[ def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput2, + _0[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _0[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _0[frozendict.frozendict], @@ -74,6 +80,7 @@ def __new__( ) return inst +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalProperties2( @@ -89,9 +96,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties2[ typing.Union[ frozendict.frozendict, @@ -106,9 +115,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties2[ @@ -127,6 +135,30 @@ def __new__( ) return inst +DictInput4 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties2[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], +] class _1( @@ -154,35 +186,16 @@ def __getitem__(self, name: str) -> AdditionalProperties2[typing.Union[ def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties2[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput4, + _1[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -190,6 +203,7 @@ def __new__( ) return inst +DictInput5 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalProperties3( @@ -205,9 +219,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput5, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties3[ typing.Union[ frozendict.frozendict, @@ -222,9 +238,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties3[ @@ -243,6 +258,30 @@ def __new__( ) return inst +DictInput6 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties3[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], +] class _2( @@ -270,35 +309,16 @@ def __getitem__(self, name: str) -> AdditionalProperties3[typing.Union[ def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties3[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput6, + _2[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _2[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _2[frozendict.frozendict], @@ -311,6 +331,7 @@ def __new__( typing.Type[_1[schemas.U]], typing.Type[_2[schemas.U]], ] +DictInput7 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalPropertiesValidator( @@ -333,15 +354,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput7, + AdditionalPropertiesValidator[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalPropertiesValidator[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalPropertiesValidator[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py index 3bac9db3dca..6a36c29f1a7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/additional_properties_with_array_of_enums.py @@ -24,18 +24,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ enum_class.EnumClass[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties[tuple], @@ -46,6 +46,14 @@ def __new__( def __getitem__(self, name: int) -> enum_class.EnumClass[str]: return super().__getitem__(name) +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[tuple], + list, + tuple + ], +] class AdditionalPropertiesWithArrayOfEnums( @@ -69,19 +77,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[tuple]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[tuple], - list, - tuple + arg: typing.Union[ + DictInput, + AdditionalPropertiesWithArrayOfEnums[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalPropertiesWithArrayOfEnums[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalPropertiesWithArrayOfEnums[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py index c83165420fb..5649854f272 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/address.py @@ -11,6 +11,14 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.IntSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[decimal.Decimal], + decimal.Decimal, + int + ], +] class Address( @@ -34,19 +42,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[decimal.Decimal]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[decimal.Decimal], - decimal.Decimal, - int + arg: typing.Union[ + DictInput, + Address[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Address[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Address[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py index 2128bb708fb..6d2a111d73d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal.py @@ -31,6 +31,20 @@ class Schema_(metaclass=schemas.SingletonMeta): "color": typing.Type[Color], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ClassName[str], + str + ], + typing.Union[ + Color[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Animal( @@ -94,26 +108,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - className: typing.Union[ - ClassName[str], - str + arg: typing.Union[ + DictInput, + Animal[frozendict.frozendict], ], - color: typing.Union[ - Color[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Animal[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - className=className, - color=color, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Animal[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py index aeedce0d9a9..ba8d62ba587 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/animal_farm.py @@ -29,19 +29,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ animal.Animal[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnimalFarm[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( AnimalFarm[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py index cbbaa77c621..395babbcabc 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_and_format.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Uuid( @@ -26,9 +27,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Uuid[ typing.Union[ frozendict.frozendict, @@ -43,9 +46,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Uuid[ @@ -64,6 +66,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Date( @@ -80,9 +83,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Date[ typing.Union[ frozendict.frozendict, @@ -97,9 +102,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Date[ @@ -118,6 +122,7 @@ def __new__( ) return inst +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class DateTime( @@ -134,9 +139,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DateTime[ typing.Union[ frozendict.frozendict, @@ -151,9 +158,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( DateTime[ @@ -172,6 +178,7 @@ def __new__( ) return inst +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Number( @@ -188,9 +195,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput4, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Number[ typing.Union[ frozendict.frozendict, @@ -205,9 +214,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Number[ @@ -226,6 +234,7 @@ def __new__( ) return inst +DictInput5 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Binary( @@ -241,9 +250,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput5, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Binary[ typing.Union[ frozendict.frozendict, @@ -258,9 +269,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Binary[ @@ -279,6 +289,7 @@ def __new__( ) return inst +DictInput6 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Int32( @@ -294,9 +305,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput6, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Int32[ typing.Union[ frozendict.frozendict, @@ -311,9 +324,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Int32[ @@ -332,6 +344,7 @@ def __new__( ) return inst +DictInput7 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Int64( @@ -347,9 +360,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput7, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Int64[ typing.Union[ frozendict.frozendict, @@ -364,9 +379,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Int64[ @@ -385,6 +399,7 @@ def __new__( ) return inst +DictInput8 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Double( @@ -400,9 +415,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput8, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Double[ typing.Union[ frozendict.frozendict, @@ -417,9 +434,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Double[ @@ -438,6 +454,7 @@ def __new__( ) return inst +DictInput9 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _Float( @@ -453,9 +470,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput9, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _Float[ typing.Union[ frozendict.frozendict, @@ -470,9 +489,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _Float[ @@ -505,6 +523,201 @@ def __new__( "float": typing.Type[_Float], } ) +DictInput10 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Uuid[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Date[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + DateTime[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Number[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Binary[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Int32[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Int64[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Double[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + _Float[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class AnyTypeAndFormat( @@ -662,176 +875,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - uuid: typing.Union[ - Uuid[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - date: typing.Union[ - Date[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - number: typing.Union[ - Number[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - binary: typing.Union[ - Binary[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - int32: typing.Union[ - Int32[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - int64: typing.Union[ - Int64[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - double: typing.Union[ - Double[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput10, + AnyTypeAndFormat[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyTypeAndFormat[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - uuid=uuid, - date=date, - number=number, - binary=binary, - int32=int32, - int64=int64, - double=double, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AnyTypeAndFormat[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py index 3210beb3c3e..1f6dfe2f3bb 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/any_type_not_string.py @@ -11,6 +11,7 @@ from petstore_api.shared_imports.schema_imports import * _Not: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AnyTypeNotString( @@ -31,9 +32,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyTypeNotString[ typing.Union[ frozendict.frozendict, @@ -48,9 +51,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AnyTypeNotString[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py index 551caf1e7c8..bb6c1a65154 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/api_response.py @@ -21,6 +21,25 @@ "message": typing.Type[Message], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Code[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Type[str], + str + ], + typing.Union[ + Message[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ApiResponse( @@ -73,34 +92,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - code: typing.Union[ - Code[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - type: typing.Union[ - Type[str], - schemas.Unset, - str - ] = schemas.unset, - message: typing.Union[ - Message[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ApiResponse[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ApiResponse[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - code=code, - type=type, - message=message, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ApiResponse[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py index afc3a527f33..5f01c9f2856 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple.py @@ -48,6 +48,20 @@ class Schema_(metaclass=schemas.SingletonMeta): "origin": typing.Type[Origin], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Cultivar[str], + str + ], + typing.Union[ + Origin[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Apple( @@ -110,18 +124,12 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput, + Apple[frozendict.frozendict], ], - origin: typing.Union[ - Origin[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Apple[ typing.Union[ schemas.NoneClass, @@ -130,10 +138,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - origin=origin, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Apple[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py index 90f0c4a5fef..5717aeabd09 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/apple_req.py @@ -20,6 +20,29 @@ "mealy": typing.Type[Mealy], } ) +RequiredDictInput = typing_extensions.TypedDict( + 'RequiredDictInput', + { + "cultivar": typing.Union[ + Cultivar[str], + str + ], + } +) +OptionalDictInput = typing_extensions.TypedDict( + 'OptionalDictInput', + { + "mealy": typing.Union[ + Mealy[schemas.BoolClass], + bool + ], + }, + total=False +) + + +class DictInput3(RequiredDictInput, OptionalDictInput): + pass class AppleReq( @@ -63,24 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - cultivar: typing.Union[ - Cultivar[str], - str + arg: typing.Union[ + DictInput3, + AppleReq[frozendict.frozendict], ], - mealy: typing.Union[ - Mealy[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AppleReq[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - cultivar=cultivar, - mealy=mealy, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( AppleReq[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py index bb57f60db29..a0ae1adc46c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_holding_any_type.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -30,7 +31,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -53,12 +54,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayHoldingAnyType[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayHoldingAnyType[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py index bd35129454c..e6c8ba4d0fa 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_array_of_number_only.py @@ -25,7 +25,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items2[decimal.Decimal], decimal.Decimal, @@ -33,12 +33,12 @@ def __new__( float ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items[tuple], @@ -63,19 +63,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayArrayNumber[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayArrayNumber[tuple], @@ -92,6 +92,17 @@ def __getitem__(self, name: int) -> Items[tuple]: "ArrayArrayNumber": typing.Type[ArrayArrayNumber], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ArrayArrayNumber[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ArrayOfArrayOfNumberOnly( @@ -136,22 +147,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - ArrayArrayNumber: typing.Union[ - ArrayArrayNumber[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ArrayOfArrayOfNumberOnly[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayOfArrayOfNumberOnly[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - ArrayArrayNumber=ArrayArrayNumber, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ArrayOfArrayOfNumberOnly[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py index 58f15a368ca..d30dd9c3de8 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_enums.py @@ -29,7 +29,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ string_enum.StringEnum[typing.Union[ schemas.NoneClass, @@ -39,12 +39,12 @@ def __new__( str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayOfEnums[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayOfEnums[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py index 82c6f0c1a18..5f9679681de 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_of_number_only.py @@ -25,7 +25,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[decimal.Decimal], decimal.Decimal, @@ -33,12 +33,12 @@ def __new__( float ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayNumber[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayNumber[tuple], @@ -55,6 +55,17 @@ def __getitem__(self, name: int) -> Items[decimal.Decimal]: "ArrayNumber": typing.Type[ArrayNumber], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ArrayNumber[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ArrayOfNumberOnly( @@ -99,22 +110,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - ArrayNumber: typing.Union[ - ArrayNumber[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ArrayOfNumberOnly[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayOfNumberOnly[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - ArrayNumber=ArrayNumber, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ArrayOfNumberOnly[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py index b16a0bf9a37..81113e93cc1 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_test.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayOfString[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayOfString[tuple], @@ -62,19 +62,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items3[decimal.Decimal], decimal.Decimal, int ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items2[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items2[tuple], @@ -99,19 +99,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items2[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayArrayOfInteger[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayArrayOfInteger[tuple], @@ -136,19 +136,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ read_only_first.ReadOnlyFirst[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items4[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items4[tuple], @@ -173,19 +173,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items4[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayArrayOfModel[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayArrayOfModel[tuple], @@ -204,6 +204,27 @@ def __getitem__(self, name: int) -> Items4[tuple]: "array_array_of_model": typing.Type[ArrayArrayOfModel], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ArrayOfString[tuple], + list, + tuple + ], + typing.Union[ + ArrayArrayOfInteger[tuple], + list, + tuple + ], + typing.Union[ + ArrayArrayOfModel[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ArrayTest( @@ -256,36 +277,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - array_of_string: typing.Union[ - ArrayOfString[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - array_array_of_integer: typing.Union[ - ArrayArrayOfInteger[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - array_array_of_model: typing.Union[ - ArrayArrayOfModel[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ArrayTest[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayTest[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - array_of_string=array_of_string, - array_array_of_integer=array_array_of_integer, - array_array_of_model=array_array_of_model, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ArrayTest[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py index 4e60458b62f..e462577da10 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/array_with_validations_in_items.py @@ -44,19 +44,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[decimal.Decimal], decimal.Decimal, int ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayWithValidationsInItems[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayWithValidationsInItems[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py index f3b3a37b31d..5c88f13a1c3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana.py @@ -17,6 +17,18 @@ "lengthCm": typing.Type[LengthCm], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + LengthCm[decimal.Decimal], + decimal.Decimal, + int, + float + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Banana( @@ -68,22 +80,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - lengthCm: typing.Union[ - LengthCm[decimal.Decimal], - decimal.Decimal, - int, - float + arg: typing.Union[ + DictInput, + Banana[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Banana[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - lengthCm=lengthCm, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Banana[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py index 13fcf17415f..19acd6183fa 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/banana_req.py @@ -20,6 +20,31 @@ "sweet": typing.Type[Sweet], } ) +RequiredDictInput = typing_extensions.TypedDict( + 'RequiredDictInput', + { + "lengthCm": typing.Union[ + LengthCm[decimal.Decimal], + decimal.Decimal, + int, + float + ], + } +) +OptionalDictInput = typing_extensions.TypedDict( + 'OptionalDictInput', + { + "sweet": typing.Union[ + Sweet[schemas.BoolClass], + bool + ], + }, + total=False +) + + +class DictInput3(RequiredDictInput, OptionalDictInput): + pass class BananaReq( @@ -63,26 +88,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - lengthCm: typing.Union[ - LengthCm[decimal.Decimal], - decimal.Decimal, - int, - float + arg: typing.Union[ + DictInput3, + BananaReq[frozendict.frozendict], ], - sweet: typing.Union[ - Sweet[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> BananaReq[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - lengthCm=lengthCm, - sweet=sweet, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( BananaReq[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py index 5c10c0d3885..9a897f4a78e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/basque_pig.py @@ -37,6 +37,16 @@ def BASQUE_PIG(cls) -> ClassName[str]: "className": typing.Type[ClassName], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ClassName[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class BasquePig( @@ -88,20 +98,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - className: typing.Union[ - ClassName[str], - str + arg: typing.Union[ + DictInput, + BasquePig[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> BasquePig[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - className=className, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( BasquePig[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py index 8367d593df6..e293f41af1e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/capitalization.py @@ -27,6 +27,36 @@ "ATT_NAME": typing.Type[ATTNAME], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SmallCamel[str], + str + ], + typing.Union[ + CapitalCamel[str], + str + ], + typing.Union[ + SmallSnake[str], + str + ], + typing.Union[ + CapitalSnake[str], + str + ], + typing.Union[ + SCAETHFlowPoints[str], + str + ], + typing.Union[ + ATTNAME[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Capitalization( @@ -91,51 +121,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - smallCamel: typing.Union[ - SmallCamel[str], - schemas.Unset, - str - ] = schemas.unset, - CapitalCamel: typing.Union[ - CapitalCamel[str], - schemas.Unset, - str - ] = schemas.unset, - small_Snake: typing.Union[ - SmallSnake[str], - schemas.Unset, - str - ] = schemas.unset, - Capital_Snake: typing.Union[ - CapitalSnake[str], - schemas.Unset, - str - ] = schemas.unset, - SCA_ETH_Flow_Points: typing.Union[ - SCAETHFlowPoints[str], - schemas.Unset, - str - ] = schemas.unset, - ATT_NAME: typing.Union[ - ATTNAME[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Capitalization[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Capitalization[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - smallCamel=smallCamel, - CapitalCamel=CapitalCamel, - small_Snake=small_Snake, - Capital_Snake=Capital_Snake, - SCA_ETH_Flow_Points=SCA_ETH_Flow_Points, - ATT_NAME=ATT_NAME, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Capitalization[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py index cc4957aa2a2..d6e07bd11a5 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/cat.py @@ -17,6 +17,16 @@ "declawed": typing.Type[Declawed], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Declawed[schemas.BoolClass], + bool + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -56,21 +66,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - declawed: typing.Union[ - Declawed[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - declawed=declawed, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -78,6 +83,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Cat( @@ -98,9 +104,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Cat[ typing.Union[ frozendict.frozendict, @@ -115,9 +123,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Cat[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py index 7d0ea441e94..e9be5d2002e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/category.py @@ -31,6 +31,21 @@ class Schema_(metaclass=schemas.SingletonMeta): "name": typing.Type[Name], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[str], + str + ], + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Category( @@ -86,27 +101,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - name: typing.Union[ - Name[str], - str + arg: typing.Union[ + DictInput, + Category[frozendict.frozendict], ], - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Category[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - name=name, - id=id, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Category[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py index ea50ca14e28..06381d6b353 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/child_cat.py @@ -17,6 +17,16 @@ "name": typing.Type[Name], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -56,21 +66,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - name: typing.Union[ - Name[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - name=name, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -78,6 +83,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ChildCat( @@ -98,9 +104,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ChildCat[ typing.Union[ frozendict.frozendict, @@ -115,9 +123,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ChildCat[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py index a236f190df5..909bf933950 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/class_model.py @@ -17,6 +17,16 @@ "_class": typing.Type[_Class], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + _Class[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ClassModel( @@ -64,14 +74,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - _class: typing.Union[ - _Class[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ClassModel[ typing.Union[ frozendict.frozendict, @@ -86,10 +93,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - _class=_class, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ClassModel[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py index f9be85553e5..78fd38277e3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/client.py @@ -10,13 +10,23 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * -Client: typing_extensions.TypeAlias = schemas.StrSchema[U] +Client2: typing_extensions.TypeAlias = schemas.StrSchema[U] Properties = typing_extensions.TypedDict( 'Properties', { - "client": typing.Type[Client], + "client": typing.Type[Client2], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Client2[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Client( @@ -35,7 +45,7 @@ class Schema_(metaclass=schemas.SingletonMeta): properties: Properties = dataclasses.field(default_factory=lambda: schemas.typed_dict_to_instance(Properties)) # type: ignore @typing.overload - def __getitem__(self, name: typing_extensions.Literal["client"]) -> Client[str]: ... + def __getitem__(self, name: typing_extensions.Literal["client"]) -> Client2[str]: ... @typing.overload def __getitem__(self, name: str) -> schemas.AnyTypeSchema[typing.Union[ @@ -61,21 +71,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - client: typing.Union[ - Client[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Client[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Client[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - client=client, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Client[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py index 1d541b5c1d4..52779450b2f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/complex_quadrilateral.py @@ -37,6 +37,16 @@ def COMPLEX_QUADRILATERAL(cls) -> QuadrilateralType[str]: "quadrilateralType": typing.Type[QuadrilateralType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + QuadrilateralType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -76,21 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - quadrilateralType: typing.Union[ - QuadrilateralType[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - quadrilateralType=quadrilateralType, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -98,6 +103,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ComplexQuadrilateral( @@ -118,9 +124,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComplexQuadrilateral[ typing.Union[ frozendict.frozendict, @@ -135,9 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ComplexQuadrilateral[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py index 5fbbf42358b..7f957018dfb 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_any_of_different_types_no_validations.py @@ -10,15 +10,18 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.DictSchema[U] _1: typing_extensions.TypeAlias = schemas.DateSchema[U] _2: typing_extensions.TypeAlias = schemas.DateTimeSchema[U] _3: typing_extensions.TypeAlias = schemas.BinarySchema[U] _4: typing_extensions.TypeAlias = schemas.StrSchema[U] _5: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _6: typing_extensions.TypeAlias = schemas.DictSchema[U] _7: typing_extensions.TypeAlias = schemas.BoolSchema[U] _8: typing_extensions.TypeAlias = schemas.NoneSchema[U] +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -34,7 +37,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -57,12 +60,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _9[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( _9[tuple], @@ -106,6 +109,7 @@ def __getitem__(self, name: int) -> Items[typing.Union[ typing.Type[_14[schemas.U]], typing.Type[_15[schemas.U]], ] +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ComposedAnyOfDifferentTypesNoValidations( @@ -126,9 +130,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput4, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedAnyOfDifferentTypesNoValidations[ typing.Union[ frozendict.frozendict, @@ -143,9 +149,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ComposedAnyOfDifferentTypesNoValidations[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py index 75ccad31077..cb26db2fdb2 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_array.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -30,7 +31,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -53,12 +54,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedArray[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ComposedArray[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py index ca526bdf863..b62b2550dad 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_bool.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], @@ -36,13 +37,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: bool, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: bool, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedBool[schemas.BoolClass]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ComposedBool[schemas.BoolClass], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py index ed12b7c4ff9..1750ad03a6d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_none.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], @@ -36,13 +37,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: None, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedNone[schemas.NoneClass]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ComposedNone[schemas.NoneClass], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py index c44b3235d52..cb3fd661104 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_number.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], @@ -36,13 +37,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[decimal.Decimal, int, float], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedNumber[decimal.Decimal]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ComposedNumber[decimal.Decimal], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py index d84e2de021a..0f6578202e3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_object.py @@ -10,10 +10,12 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ComposedObject( @@ -36,15 +38,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + ComposedObject[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedObject[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ComposedObject[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py index 209af72b29e..f1fd509c2c6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_one_of_different_types.py @@ -12,6 +12,7 @@ _2: typing_extensions.TypeAlias = schemas.NoneSchema[U] _3: typing_extensions.TypeAlias = schemas.DateSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class _4( @@ -27,15 +28,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _4[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _4[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _4[frozendict.frozendict], @@ -43,6 +45,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -60,7 +63,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -83,12 +86,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _5[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( _5[tuple], @@ -124,6 +127,7 @@ class Schema_(metaclass=schemas.SingletonMeta): pattern: schemas.PatternInfo = schemas.PatternInfo( pattern=r'^2020.*' # noqa: E501 ) +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ComposedOneOfDifferentTypes( @@ -146,9 +150,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedOneOfDifferentTypes[ typing.Union[ frozendict.frozendict, @@ -163,9 +169,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ComposedOneOfDifferentTypes[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py index 5126a5ba104..3752195f807 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/composed_string.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] _0: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], @@ -36,13 +37,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: str, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + arg: str, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ComposedString[str]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ComposedString[str], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py index af4be54d3eb..4c822644d12 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/danish_pig.py @@ -37,6 +37,16 @@ def DANISH_PIG(cls) -> ClassName[str]: "className": typing.Type[ClassName], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ClassName[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class DanishPig( @@ -88,20 +98,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - className: typing.Union[ - ClassName[str], - str + arg: typing.Union[ + DictInput, + DanishPig[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DanishPig[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - className=className, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( DanishPig[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py index 58df66168bf..162ef1073b6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/dog.py @@ -17,6 +17,16 @@ "breed": typing.Type[Breed], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Breed[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -56,21 +66,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - breed: typing.Union[ - Breed[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - breed=breed, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -78,6 +83,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Dog( @@ -98,9 +104,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Dog[ typing.Union[ frozendict.frozendict, @@ -115,9 +123,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Dog[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py index 933e6e50e9a..dfef6559c7c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/drawing.py @@ -24,7 +24,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ shape.Shape[ schemas.INPUT_BASE_TYPES @@ -47,12 +47,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Shapes[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Shapes[tuple], @@ -156,12 +156,44 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - mainShape: typing.Union[ + arg: typing.Union[ + DictInput, + Drawing[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None + ) -> Drawing[frozendict.frozendict]: + inst = super().__new__( + cls, + arg, + configuration=configuration, + ) + inst = typing.cast( + Drawing[frozendict.frozendict], + inst + ) + return inst + + +from petstore_api.components.schema import fruit +from petstore_api.components.schema import nullable_shape +from petstore_api.components.schema import shape +from petstore_api.components.schema import shape_or_null +Properties = typing_extensions.TypedDict( + 'Properties', + { + "mainShape": typing.Type[shape.Shape], + "shapeOrNull": typing.Type[shape_or_null.ShapeOrNull], + "nullableShape": typing.Type[nullable_shape.NullableShape], + "shapes": typing.Type[Shapes], + } +) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ shape.Shape[ schemas.INPUT_BASE_TYPES ], - schemas.Unset, dict, frozendict.frozendict, str, @@ -178,12 +210,11 @@ def __new__( bytes, io.FileIO, io.BufferedReader - ] = schemas.unset, - shapeOrNull: typing.Union[ + ], + typing.Union[ shape_or_null.ShapeOrNull[ schemas.INPUT_BASE_TYPES ], - schemas.Unset, dict, frozendict.frozendict, str, @@ -200,12 +231,11 @@ def __new__( bytes, io.FileIO, io.BufferedReader - ] = schemas.unset, - nullableShape: typing.Union[ + ], + typing.Union[ nullable_shape.NullableShape[ schemas.INPUT_BASE_TYPES ], - schemas.Unset, dict, frozendict.frozendict, str, @@ -222,15 +252,13 @@ def __new__( bytes, io.FileIO, io.BufferedReader - ] = schemas.unset, - shapes: typing.Union[ + ], + typing.Union[ Shapes[tuple], - schemas.Unset, list, tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + ], + typing.Union[ fruit.Fruit[ schemas.INPUT_BASE_TYPES ], @@ -251,34 +279,5 @@ def __new__( io.FileIO, io.BufferedReader ], - ) -> Drawing[frozendict.frozendict]: - inst = super().__new__( - cls, - *args_, - mainShape=mainShape, - shapeOrNull=shapeOrNull, - nullableShape=nullableShape, - shapes=shapes, - configuration_=configuration_, - **kwargs, - ) - inst = typing.cast( - Drawing[frozendict.frozendict], - inst - ) - return inst - - -from petstore_api.components.schema import fruit -from petstore_api.components.schema import nullable_shape -from petstore_api.components.schema import shape -from petstore_api.components.schema import shape_or_null -Properties = typing_extensions.TypedDict( - 'Properties', - { - "mainShape": typing.Type[shape.Shape], - "shapeOrNull": typing.Type[shape_or_null.ShapeOrNull], - "nullableShape": typing.Type[nullable_shape.NullableShape], - "shapes": typing.Type[Shapes], - } -) + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py index 3eeeb44a273..874dec8c419 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_arrays.py @@ -76,18 +76,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayEnum[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayEnum[tuple], @@ -105,6 +105,21 @@ def __getitem__(self, name: int) -> Items[str]: "array_enum": typing.Type[ArrayEnum], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + JustSymbol[str], + str + ], + typing.Union[ + ArrayEnum[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class EnumArrays( @@ -153,28 +168,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - just_symbol: typing.Union[ - JustSymbol[str], - schemas.Unset, - str - ] = schemas.unset, - array_enum: typing.Union[ - ArrayEnum[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + EnumArrays[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EnumArrays[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - just_symbol=just_symbol, - array_enum=array_enum, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( EnumArrays[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py index d4a927fc1c3..7020eb16191 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/enum_test.py @@ -212,78 +212,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - enum_string_required: typing.Union[ - EnumStringRequired[str], - str + arg: typing.Union[ + DictInput, + EnumTest[frozendict.frozendict], ], - enum_string: typing.Union[ - EnumString[str], - schemas.Unset, - str - ] = schemas.unset, - enum_integer: typing.Union[ - EnumInteger[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - enum_number: typing.Union[ - EnumNumber[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - stringEnum: typing.Union[ - string_enum.StringEnum[typing.Union[ - schemas.NoneClass, - str - ]], - schemas.Unset, - None, - str - ] = schemas.unset, - IntegerEnum: typing.Union[ - integer_enum.IntegerEnum[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - StringEnumWithDefaultValue: typing.Union[ - string_enum_with_default_value.StringEnumWithDefaultValue[str], - schemas.Unset, - str - ] = schemas.unset, - IntegerEnumWithDefaultValue: typing.Union[ - integer_enum_with_default_value.IntegerEnumWithDefaultValue[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - IntegerEnumOneValue: typing.Union[ - integer_enum_one_value.IntegerEnumOneValue[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EnumTest[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - enum_string_required=enum_string_required, - enum_string=enum_string, - enum_integer=enum_integer, - enum_number=enum_number, - stringEnum=stringEnum, - IntegerEnum=IntegerEnum, - StringEnumWithDefaultValue=StringEnumWithDefaultValue, - IntegerEnumWithDefaultValue=IntegerEnumWithDefaultValue, - IntegerEnumOneValue=IntegerEnumOneValue, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( EnumTest[frozendict.frozendict], @@ -311,3 +249,55 @@ def __new__( "IntegerEnumOneValue": typing.Type[integer_enum_one_value.IntegerEnumOneValue], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + EnumStringRequired[str], + str + ], + typing.Union[ + EnumString[str], + str + ], + typing.Union[ + EnumInteger[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + EnumNumber[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + string_enum.StringEnum[typing.Union[ + schemas.NoneClass, + str + ]], + None, + str + ], + typing.Union[ + integer_enum.IntegerEnum[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + string_enum_with_default_value.StringEnumWithDefaultValue[str], + str + ], + typing.Union[ + integer_enum_with_default_value.IntegerEnumWithDefaultValue[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + integer_enum_one_value.IntegerEnumOneValue[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py index 8cbc713dbd2..d2383c15f23 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/equilateral_triangle.py @@ -37,6 +37,16 @@ def EQUILATERAL_TRIANGLE(cls) -> TriangleType[str]: "triangleType": typing.Type[TriangleType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + TriangleType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -76,21 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - triangleType: typing.Union[ - TriangleType[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - triangleType=triangleType, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -98,6 +103,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class EquilateralTriangle( @@ -118,9 +124,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EquilateralTriangle[ typing.Union[ frozendict.frozendict, @@ -135,9 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( EquilateralTriangle[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py index c1d358ff6d2..6030065c74b 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file.py @@ -17,6 +17,16 @@ "sourceURI": typing.Type[SourceURI], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SourceURI[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class File( @@ -63,21 +73,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - sourceURI: typing.Union[ - SourceURI[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + File[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> File[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - sourceURI=sourceURI, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( File[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py index 228daa71c06..ad51f55ac45 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/file_schema_test_class.py @@ -24,19 +24,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ file.File[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Files[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Files[tuple], @@ -95,29 +95,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - file: typing.Union[ - file.File[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - files: typing.Union[ - Files[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + FileSchemaTestClass[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> FileSchemaTestClass[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - file=file, - files=files, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( FileSchemaTestClass[frozendict.frozendict], @@ -134,3 +121,19 @@ def __new__( "files": typing.Type[Files], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + file.File[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + Files[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py index b755df3831b..1b1ecfed8b9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/foo.py @@ -54,21 +54,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - bar: typing.Union[ - bar.Bar[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Foo[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Foo[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - bar=bar, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Foo[frozendict.frozendict], @@ -84,3 +79,13 @@ def __new__( "bar": typing.Type[bar.Bar], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + bar.Bar[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py index f4d36455f76..933706e4be9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/format_test.py @@ -106,7 +106,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[decimal.Decimal], decimal.Decimal, @@ -114,12 +114,12 @@ def __new__( float ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayWithUniqueItems[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayWithUniqueItems[tuple], @@ -225,6 +225,117 @@ class Schema_(metaclass=schemas.SingletonMeta): "noneProp": typing.Type[NoneProp], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Byte[str], + str + ], + typing.Union[ + Date[str], + str, + datetime.date + ], + typing.Union[ + Number[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + Password[str], + str + ], + typing.Union[ + Integer[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Int32[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Int32withValidations[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Int64[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + _Float[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + Float32[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + Double[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + Float64[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + ArrayWithUniqueItems[tuple], + list, + tuple + ], + typing.Union[ + String[str], + str + ], + typing.Union[ + Binary[typing.Union[bytes, schemas.FileIO]], + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + DateTime[str], + str, + datetime.datetime + ], + typing.Union[ + Uuid[str], + str, + uuid.UUID + ], + typing.Union[ + UuidNoExample[str], + str, + uuid.UUID + ], + typing.Union[ + PatternWithDigits[str], + str + ], + typing.Union[ + PatternWithDigitsAndDelimiter[str], + str + ], + typing.Union[ + NoneProp[schemas.NoneClass], + None + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class FormatTest( @@ -371,150 +482,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - byte: typing.Union[ - Byte[str], - str - ], - date: typing.Union[ - Date[str], - str, - datetime.date - ], - number: typing.Union[ - Number[decimal.Decimal], - decimal.Decimal, - int, - float - ], - password: typing.Union[ - Password[str], - str + arg: typing.Union[ + DictInput, + FormatTest[frozendict.frozendict], ], - integer: typing.Union[ - Integer[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - int32: typing.Union[ - Int32[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - int32withValidations: typing.Union[ - Int32withValidations[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - int64: typing.Union[ - Int64[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - float32: typing.Union[ - Float32[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - double: typing.Union[ - Double[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - float64: typing.Union[ - Float64[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - arrayWithUniqueItems: typing.Union[ - ArrayWithUniqueItems[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - string: typing.Union[ - String[str], - schemas.Unset, - str - ] = schemas.unset, - binary: typing.Union[ - Binary[typing.Union[bytes, schemas.FileIO]], - schemas.Unset, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - dateTime: typing.Union[ - DateTime[str], - schemas.Unset, - str, - datetime.datetime - ] = schemas.unset, - uuid: typing.Union[ - Uuid[str], - schemas.Unset, - str, - uuid.UUID - ] = schemas.unset, - uuidNoExample: typing.Union[ - UuidNoExample[str], - schemas.Unset, - str, - uuid.UUID - ] = schemas.unset, - pattern_with_digits: typing.Union[ - PatternWithDigits[str], - schemas.Unset, - str - ] = schemas.unset, - pattern_with_digits_and_delimiter: typing.Union[ - PatternWithDigitsAndDelimiter[str], - schemas.Unset, - str - ] = schemas.unset, - noneProp: typing.Union[ - NoneProp[schemas.NoneClass], - schemas.Unset, - None - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> FormatTest[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - byte=byte, - date=date, - number=number, - password=password, - integer=integer, - int32=int32, - int32withValidations=int32withValidations, - int64=int64, - float32=float32, - double=double, - float64=float64, - arrayWithUniqueItems=arrayWithUniqueItems, - string=string, - binary=binary, - dateTime=dateTime, - uuid=uuid, - uuidNoExample=uuidNoExample, - pattern_with_digits=pattern_with_digits, - pattern_with_digits_and_delimiter=pattern_with_digits_and_delimiter, - noneProp=noneProp, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( FormatTest[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py index 1210e6c65ff..87bb727cf30 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/from_schema.py @@ -19,6 +19,21 @@ "id": typing.Type[Id], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Data[str], + str + ], + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class FromSchema( @@ -67,28 +82,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - data: typing.Union[ - Data[str], - schemas.Unset, - str - ] = schemas.unset, - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + FromSchema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> FromSchema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - data=data, - id=id, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( FromSchema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py index 804e64737b3..944df35c6fb 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit.py @@ -17,6 +17,16 @@ "color": typing.Type[Color], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Color[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Fruit( @@ -63,14 +73,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - color: typing.Union[ - Color[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Fruit[ typing.Union[ frozendict.frozendict, @@ -85,10 +92,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - color=color, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Fruit[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py index 49f1d316c86..df8b57733f7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/fruit_req.py @@ -11,6 +11,7 @@ from petstore_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.NoneSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class FruitReq( @@ -31,9 +32,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> FruitReq[ typing.Union[ frozendict.frozendict, @@ -48,9 +51,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( FruitReq[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py index 033997bcc0a..e21589d209a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/gm_fruit.py @@ -17,6 +17,16 @@ "color": typing.Type[Color], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Color[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class GmFruit( @@ -63,14 +73,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - color: typing.Union[ - Color[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> GmFruit[ typing.Union[ frozendict.frozendict, @@ -85,10 +92,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - color=color, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( GmFruit[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py index a30a98afe56..2b9eb0b14a2 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/grandparent_animal.py @@ -17,6 +17,16 @@ "pet_type": typing.Type[PetType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + PetType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class GrandparentAnimal( @@ -76,20 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - pet_type: typing.Union[ - PetType[str], - str + arg: typing.Union[ + DictInput, + GrandparentAnimal[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> GrandparentAnimal[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - pet_type=pet_type, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( GrandparentAnimal[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py index a2ade7f99bb..a4970aa3151 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/has_only_read_only.py @@ -19,6 +19,20 @@ "foo": typing.Type[Foo], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[str], + str + ], + typing.Union[ + Foo[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class HasOnlyReadOnly( @@ -67,27 +81,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - bar: typing.Union[ - Bar[str], - schemas.Unset, - str - ] = schemas.unset, - foo: typing.Union[ - Foo[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + HasOnlyReadOnly[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> HasOnlyReadOnly[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - bar=bar, - foo=foo, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( HasOnlyReadOnly[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py index 0b711093800..2d2961effa0 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/health_check_result.py @@ -30,11 +30,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NullableMessage[ typing.Union[ schemas.NoneClass, @@ -43,8 +43,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( NullableMessage[ @@ -63,6 +63,20 @@ def __new__( "NullableMessage": typing.Type[NullableMessage], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + NullableMessage[typing.Union[ + schemas.NoneClass, + str + ]], + None, + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class HealthCheckResult( @@ -112,25 +126,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - NullableMessage: typing.Union[ - NullableMessage[typing.Union[ - schemas.NoneClass, - str - ]], - schemas.Unset, - None, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + HealthCheckResult[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> HealthCheckResult[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - NullableMessage=NullableMessage, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( HealthCheckResult[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py index 9165ab760c1..0a157d150e1 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/isosceles_triangle.py @@ -37,6 +37,16 @@ def ISOSCELES_TRIANGLE(cls) -> TriangleType[str]: "triangleType": typing.Type[TriangleType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + TriangleType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -76,21 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - triangleType: typing.Union[ - TriangleType[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - triangleType=triangleType, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -98,6 +103,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class IsoscelesTriangle( @@ -118,9 +124,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> IsoscelesTriangle[ typing.Union[ frozendict.frozendict, @@ -135,9 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( IsoscelesTriangle[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py index acc467fda71..30c81a097d6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/items.py @@ -10,7 +10,8 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * -Items: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] +Items2: typing_extensions.TypeAlias = schemas.DictSchema[U] class Items( @@ -28,23 +29,23 @@ class Items( @dataclasses.dataclass(frozen=True) class Schema_(metaclass=schemas.SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - items: typing.Type[Items] = dataclasses.field(default_factory=lambda: Items) # type: ignore + items: typing.Type[Items2] = dataclasses.field(default_factory=lambda: Items2) # type: ignore def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ - Items[frozendict.frozendict], + Items2[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Items[tuple], @@ -52,6 +53,6 @@ def __new__( ) return inst - def __getitem__(self, name: int) -> Items[frozendict.frozendict]: + def __getitem__(self, name: int) -> Items2[frozendict.frozendict]: return super().__getitem__(name) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py index a730a044e0f..812eaa63fc2 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Items( @@ -25,9 +26,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items[ typing.Union[ frozendict.frozendict, @@ -42,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Items[ @@ -82,7 +84,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[ schemas.INPUT_BASE_TYPES @@ -105,12 +107,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> JSONPatchRequest[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( JSONPatchRequest[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py index c8dcc208f34..52e19920bbf 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_add_replace_test.py @@ -12,6 +12,7 @@ AdditionalProperties: typing_extensions.TypeAlias = schemas.NotAnyTypeSchema[U] Path: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Value: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -52,6 +53,40 @@ def TEST(cls) -> Op[str]: "op": typing.Type[Op], } ) +DictInput4 = typing_extensions.TypedDict( + 'DictInput4', + { + "op": typing.Union[ + Op[str], + str + ], + "path": typing.Union[ + Path[str], + str + ], + "value": typing.Union[ + Value[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + } +) class JSONPatchRequestAddReplaceTest( @@ -127,45 +162,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - op: typing.Union[ - Op[str], - str - ], - path: typing.Union[ - Path[str], - str - ], - value: typing.Union[ - Value[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput4, + JSONPatchRequestAddReplaceTest[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> JSONPatchRequestAddReplaceTest[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - op=op, - path=path, - value=value, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( JSONPatchRequestAddReplaceTest[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py index fe4db5efa04..abc283c72c1 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_move_copy.py @@ -47,6 +47,23 @@ def COPY(cls) -> Op[str]: "op": typing.Type[Op], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "from": typing.Union[ + _From[str], + str + ], + "op": typing.Union[ + Op[str], + str + ], + "path": typing.Union[ + Path[str], + str + ], + } +) class JSONPatchRequestMoveCopy( @@ -100,23 +117,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - op: typing.Union[ - Op[str], - str - ], - path: typing.Union[ - Path[str], - str + arg: typing.Union[ + DictInput3, + JSONPatchRequestMoveCopy[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> JSONPatchRequestMoveCopy[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - op=op, - path=path, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( JSONPatchRequestMoveCopy[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py index 4111ebeb238..74fd8f88a65 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/json_patch_request_remove.py @@ -40,6 +40,19 @@ def REMOVE(cls) -> Op[str]: "op": typing.Type[Op], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "op": typing.Union[ + Op[str], + str + ], + "path": typing.Union[ + Path[str], + str + ], + } +) class JSONPatchRequestRemove( @@ -88,23 +101,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - op: typing.Union[ - Op[str], - str - ], - path: typing.Union[ - Path[str], - str + arg: typing.Union[ + DictInput3, + JSONPatchRequestRemove[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> JSONPatchRequestRemove[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - op=op, - path=path, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( JSONPatchRequestRemove[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py index 5a9cae8d3c1..daa0b7fc08a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mammal.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Mammal( @@ -39,9 +40,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Mammal[ typing.Union[ frozendict.frozendict, @@ -56,9 +59,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Mammal[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py index 2c3bc4a01aa..fbfcdc7e7ef 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/map_test.py @@ -11,6 +11,13 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties2: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties2[str], + str + ], +] class AdditionalProperties( @@ -29,18 +36,16 @@ def __getitem__(self, name: str) -> AdditionalProperties2[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties2[str], - str + arg: typing.Union[ + DictInput, + AdditionalProperties[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties[frozendict.frozendict], @@ -48,6 +53,14 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[frozendict.frozendict], + dict, + frozendict.frozendict + ], +] class MapMapOfString( @@ -66,19 +79,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[frozendict.frozendict]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[frozendict.frozendict], - dict, - frozendict.frozendict + arg: typing.Union[ + DictInput2, + MapMapOfString[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapMapOfString[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapMapOfString[frozendict.frozendict], @@ -112,6 +122,13 @@ def UPPER(cls) -> AdditionalProperties3[str]: @schemas.classproperty def LOWER(cls) -> AdditionalProperties3[str]: return cls("lower") # type: ignore +DictInput3 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties3[str], + str + ], +] class MapOfEnumString( @@ -130,18 +147,16 @@ def __getitem__(self, name: str) -> AdditionalProperties3[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties3[str], - str + arg: typing.Union[ + DictInput3, + MapOfEnumString[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapOfEnumString[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapOfEnumString[frozendict.frozendict], @@ -150,6 +165,13 @@ def __new__( return inst AdditionalProperties4: typing_extensions.TypeAlias = schemas.BoolSchema[U] +DictInput4 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties4[schemas.BoolClass], + bool + ], +] class DirectMap( @@ -168,18 +190,16 @@ def __getitem__(self, name: str) -> AdditionalProperties4[schemas.BoolClass]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties4[schemas.BoolClass], - bool + arg: typing.Union[ + DictInput4, + DirectMap[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DirectMap[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( DirectMap[frozendict.frozendict], @@ -243,43 +263,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - map_map_of_string: typing.Union[ - MapMapOfString[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - map_of_enum_string: typing.Union[ - MapOfEnumString[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - direct_map: typing.Union[ - DirectMap[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - indirect_map: typing.Union[ - string_boolean_map.StringBooleanMap[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput5, + MapTest[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MapTest[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - map_map_of_string=map_map_of_string, - map_of_enum_string=map_of_enum_string, - direct_map=direct_map, - indirect_map=indirect_map, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MapTest[frozendict.frozendict], @@ -298,3 +291,29 @@ def __new__( "indirect_map": typing.Type[string_boolean_map.StringBooleanMap], } ) +DictInput5 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + MapMapOfString[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + MapOfEnumString[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + DirectMap[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + string_boolean_map.StringBooleanMap[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py index 6db68c4cd22..a86f414bed7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/mixed_properties_and_additional_properties_class.py @@ -30,19 +30,16 @@ def __getitem__(self, name: str) -> animal.Animal[frozendict.frozendict]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - animal.Animal[frozendict.frozendict], - dict, - frozendict.frozendict + arg: typing.Union[ + DictInput, + Map[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Map[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Map[frozendict.frozendict], @@ -58,6 +55,27 @@ def __new__( "map": typing.Type[Map], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Uuid[str], + str, + uuid.UUID + ], + typing.Union[ + DateTime[str], + str, + datetime.datetime + ], + typing.Union[ + Map[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class MixedPropertiesAndAdditionalPropertiesClass( @@ -110,36 +128,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - uuid: typing.Union[ - Uuid[str], - schemas.Unset, - str, - uuid.UUID - ] = schemas.unset, - dateTime: typing.Union[ - DateTime[str], - schemas.Unset, - str, - datetime.datetime - ] = schemas.unset, - map: typing.Union[ - Map[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + MixedPropertiesAndAdditionalPropertiesClass[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> MixedPropertiesAndAdditionalPropertiesClass[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - uuid=uuid, - dateTime=dateTime, - map=map, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( MixedPropertiesAndAdditionalPropertiesClass[frozendict.frozendict], @@ -149,3 +147,11 @@ def __new__( from petstore_api.components.schema import animal +DictInput = typing.Mapping[ + str, + typing.Union[ + animal.Animal[frozendict.frozendict], + dict, + frozendict.frozendict + ], +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py index f7e8622f426..0e895094b5c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/money.py @@ -71,25 +71,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - amount: typing.Union[ - Amount[str], - str - ], - currency: typing.Union[ - currency.Currency[str], - str + arg: typing.Union[ + DictInput, + Money[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Money[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - amount=amount, - currency=currency, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Money[frozendict.frozendict], @@ -106,3 +97,17 @@ def __new__( "currency": typing.Type[currency.Currency], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Amount[str], + str + ], + typing.Union[ + currency.Currency[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py index df87cc9c1dd..71cb48e19db 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/name.py @@ -10,17 +10,37 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * -Name: typing_extensions.TypeAlias = schemas.Int32Schema[U] +Name2: typing_extensions.TypeAlias = schemas.Int32Schema[U] SnakeCase: typing_extensions.TypeAlias = schemas.Int32Schema[U] _Property: typing_extensions.TypeAlias = schemas.StrSchema[U] Properties = typing_extensions.TypedDict( 'Properties', { - "name": typing.Type[Name], + "name": typing.Type[Name2], "snake_case": typing.Type[SnakeCase], "property": typing.Type[_Property], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name2[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + SnakeCase[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + _Property[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Name( @@ -45,11 +65,11 @@ class Schema_(metaclass=schemas.SingletonMeta): @property - def name(self) -> Name[decimal.Decimal]: + def name(self) -> Name2[decimal.Decimal]: return self.__getitem__("name") @typing.overload - def __getitem__(self, name: typing_extensions.Literal["name"]) -> Name[decimal.Decimal]: ... + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Name2[decimal.Decimal]: ... @typing.overload def __getitem__(self, name: typing_extensions.Literal["snake_case"]) -> SnakeCase[decimal.Decimal]: ... @@ -83,15 +103,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - snake_case: typing.Union[ - SnakeCase[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Name[ typing.Union[ frozendict.frozendict, @@ -106,10 +122,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - snake_case=snake_case, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Name[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py index edb6b032e3d..6419decfc6c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/no_additional_properties.py @@ -20,6 +20,31 @@ "petId": typing.Type[PetId], } ) +RequiredDictInput = typing_extensions.TypedDict( + 'RequiredDictInput', + { + "id": typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + } +) +OptionalDictInput = typing_extensions.TypedDict( + 'OptionalDictInput', + { + "petId": typing.Union[ + PetId[decimal.Decimal], + decimal.Decimal, + int + ], + }, + total=False +) + + +class DictInput3(RequiredDictInput, OptionalDictInput): + pass class NoAdditionalProperties( @@ -63,26 +88,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - id: typing.Union[ - Id[decimal.Decimal], - decimal.Decimal, - int + arg: typing.Union[ + DictInput3, + NoAdditionalProperties[frozendict.frozendict], ], - petId: typing.Union[ - PetId[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NoAdditionalProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - id=id, - petId=petId, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( NoAdditionalProperties[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py index 2b8ea6e8279..6f31c5ed383 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_class.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput10 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalProperties4( @@ -30,13 +31,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput10, + AdditionalProperties4[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties4[ typing.Union[ schemas.NoneClass, @@ -45,9 +45,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties4[ @@ -81,12 +80,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, decimal.Decimal, int ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> IntegerProp[ typing.Union[ schemas.NoneClass, @@ -95,8 +94,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( IntegerProp[ @@ -129,13 +128,13 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, decimal.Decimal, int, float ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NumberProp[ typing.Union[ schemas.NoneClass, @@ -144,8 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( NumberProp[ @@ -178,11 +177,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, bool ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> BooleanProp[ typing.Union[ schemas.NoneClass, @@ -191,8 +190,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( BooleanProp[ @@ -225,11 +224,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> StringProp[ typing.Union[ schemas.NoneClass, @@ -238,8 +237,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( StringProp[ @@ -274,12 +273,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str, datetime.date ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DateProp[ typing.Union[ schemas.NoneClass, @@ -288,8 +287,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( DateProp[ @@ -324,12 +323,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str, datetime.datetime ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> DatetimeProp[ typing.Union[ schemas.NoneClass, @@ -338,8 +337,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( DatetimeProp[ @@ -352,6 +351,7 @@ def __new__( ) return inst +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Items: typing_extensions.TypeAlias = schemas.DictSchema[U] @@ -374,12 +374,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, list, tuple ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayNullableProp[ typing.Union[ schemas.NoneClass, @@ -388,8 +388,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayNullableProp[ @@ -402,6 +402,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Items2( @@ -422,13 +423,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput2, + Items2[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items2[ typing.Union[ schemas.NoneClass, @@ -437,9 +437,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Items2[ @@ -473,12 +472,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, list, tuple ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayAndItemsNullableProp[ typing.Union[ schemas.NoneClass, @@ -487,8 +486,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayAndItemsNullableProp[ @@ -501,6 +500,7 @@ def __new__( ) return inst +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Items3( @@ -521,13 +521,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput3, + Items3[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Items3[ typing.Union[ schemas.NoneClass, @@ -536,9 +535,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Items3[ @@ -565,7 +563,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items3[typing.Union[ schemas.NoneClass, @@ -576,12 +574,12 @@ def __new__( frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ArrayItemsNullable[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( ArrayItemsNullable[tuple], @@ -595,7 +593,16 @@ def __getitem__(self, name: int) -> Items3[typing.Union[ ]]: return super().__getitem__(name) +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AdditionalProperties: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput5 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[frozendict.frozendict], + dict, + frozendict.frozendict + ], +] class ObjectNullableProp( @@ -621,17 +628,12 @@ def __getitem__(self, name: str) -> AdditionalProperties[frozendict.frozendict]: def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict - ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[frozendict.frozendict], - dict, - frozendict.frozendict + DictInput5, + ObjectNullableProp[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectNullableProp[ typing.Union[ schemas.NoneClass, @@ -640,9 +642,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectNullableProp[ @@ -655,6 +656,7 @@ def __new__( ) return inst +DictInput6 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalProperties2( @@ -675,13 +677,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput6, + AdditionalProperties2[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties2[ typing.Union[ schemas.NoneClass, @@ -690,9 +691,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties2[ @@ -705,6 +705,18 @@ def __new__( ) return inst +DictInput7 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties2[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], +] class ObjectAndItemsNullableProp( @@ -733,21 +745,12 @@ def __getitem__(self, name: str) -> AdditionalProperties2[typing.Union[ def __new__( cls, - *args_: typing.Union[ - None, - dict, - frozendict.frozendict - ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties2[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput7, + ObjectAndItemsNullableProp[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectAndItemsNullableProp[ typing.Union[ schemas.NoneClass, @@ -756,9 +759,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectAndItemsNullableProp[ @@ -771,6 +773,7 @@ def __new__( ) return inst +DictInput8 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AdditionalProperties3( @@ -791,13 +794,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput8, + AdditionalProperties3[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AdditionalProperties3[ typing.Union[ schemas.NoneClass, @@ -806,9 +808,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AdditionalProperties3[ @@ -821,6 +822,18 @@ def __new__( ) return inst +DictInput9 = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties3[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], +] class ObjectItemsNullable( @@ -842,23 +855,16 @@ def __getitem__(self, name: str) -> AdditionalProperties3[typing.Union[ def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties3[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], - None, - dict, - frozendict.frozendict + arg: typing.Union[ + DictInput9, + ObjectItemsNullable[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectItemsNullable[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectItemsNullable[frozendict.frozendict], @@ -883,6 +889,119 @@ def __new__( "object_items_nullable": typing.Type[ObjectItemsNullable], } ) +DictInput11 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + IntegerProp[typing.Union[ + schemas.NoneClass, + decimal.Decimal + ]], + None, + decimal.Decimal, + int + ], + typing.Union[ + NumberProp[typing.Union[ + schemas.NoneClass, + decimal.Decimal + ]], + None, + decimal.Decimal, + int, + float + ], + typing.Union[ + BooleanProp[typing.Union[ + schemas.NoneClass, + schemas.BoolClass + ]], + None, + bool + ], + typing.Union[ + StringProp[typing.Union[ + schemas.NoneClass, + str + ]], + None, + str + ], + typing.Union[ + DateProp[typing.Union[ + schemas.NoneClass, + str + ]], + None, + str, + datetime.date + ], + typing.Union[ + DatetimeProp[typing.Union[ + schemas.NoneClass, + str + ]], + None, + str, + datetime.datetime + ], + typing.Union[ + ArrayNullableProp[typing.Union[ + schemas.NoneClass, + tuple + ]], + None, + list, + tuple + ], + typing.Union[ + ArrayAndItemsNullableProp[typing.Union[ + schemas.NoneClass, + tuple + ]], + None, + list, + tuple + ], + typing.Union[ + ArrayItemsNullable[tuple], + list, + tuple + ], + typing.Union[ + ObjectNullableProp[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], + typing.Union[ + ObjectAndItemsNullableProp[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], + typing.Union[ + ObjectItemsNullable[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + AdditionalProperties4[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], + ] +] class NullableClass( @@ -996,146 +1115,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - integer_prop: typing.Union[ - IntegerProp[typing.Union[ - schemas.NoneClass, - decimal.Decimal - ]], - schemas.Unset, - None, - decimal.Decimal, - int - ] = schemas.unset, - number_prop: typing.Union[ - NumberProp[typing.Union[ - schemas.NoneClass, - decimal.Decimal - ]], - schemas.Unset, - None, - decimal.Decimal, - int, - float - ] = schemas.unset, - boolean_prop: typing.Union[ - BooleanProp[typing.Union[ - schemas.NoneClass, - schemas.BoolClass - ]], - schemas.Unset, - None, - bool - ] = schemas.unset, - string_prop: typing.Union[ - StringProp[typing.Union[ - schemas.NoneClass, - str - ]], - schemas.Unset, - None, - str - ] = schemas.unset, - date_prop: typing.Union[ - DateProp[typing.Union[ - schemas.NoneClass, - str - ]], - schemas.Unset, - None, - str, - datetime.date - ] = schemas.unset, - datetime_prop: typing.Union[ - DatetimeProp[typing.Union[ - schemas.NoneClass, - str - ]], - schemas.Unset, - None, - str, - datetime.datetime - ] = schemas.unset, - array_nullable_prop: typing.Union[ - ArrayNullableProp[typing.Union[ - schemas.NoneClass, - tuple - ]], - schemas.Unset, - None, - list, - tuple - ] = schemas.unset, - array_and_items_nullable_prop: typing.Union[ - ArrayAndItemsNullableProp[typing.Union[ - schemas.NoneClass, - tuple - ]], - schemas.Unset, - None, - list, - tuple - ] = schemas.unset, - array_items_nullable: typing.Union[ - ArrayItemsNullable[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - object_nullable_prop: typing.Union[ - ObjectNullableProp[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], - schemas.Unset, - None, - dict, - frozendict.frozendict - ] = schemas.unset, - object_and_items_nullable_prop: typing.Union[ - ObjectAndItemsNullableProp[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], - schemas.Unset, - None, - dict, - frozendict.frozendict - ] = schemas.unset, - object_items_nullable: typing.Union[ - ObjectItemsNullable[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties4[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], - None, - dict, - frozendict.frozendict + arg: typing.Union[ + DictInput11, + NullableClass[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NullableClass[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - integer_prop=integer_prop, - number_prop=number_prop, - boolean_prop=boolean_prop, - string_prop=string_prop, - date_prop=date_prop, - datetime_prop=datetime_prop, - array_nullable_prop=array_nullable_prop, - array_and_items_nullable_prop=array_and_items_nullable_prop, - array_items_nullable=array_items_nullable, - object_nullable_prop=object_nullable_prop, - object_and_items_nullable_prop=object_and_items_nullable_prop, - object_items_nullable=object_items_nullable, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NullableClass[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py index 865f9fce8af..0ccc4aef75d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_shape.py @@ -11,6 +11,7 @@ from petstore_api.shared_imports.schema_imports import * _2: typing_extensions.TypeAlias = schemas.NoneSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class NullableShape( @@ -33,9 +34,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NullableShape[ typing.Union[ frozendict.frozendict, @@ -50,9 +53,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NullableShape[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py index 370bd0d2e5f..9eb2cd949d2 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/nullable_string.py @@ -35,11 +35,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NullableString[ typing.Union[ schemas.NoneClass, @@ -48,8 +48,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( NullableString[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py index 8bcece3d2c1..b3ec01a0680 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/number_only.py @@ -17,6 +17,18 @@ "JustNumber": typing.Type[JustNumber], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + JustNumber[decimal.Decimal], + decimal.Decimal, + int, + float + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class NumberOnly( @@ -61,23 +73,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - JustNumber: typing.Union[ - JustNumber[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + NumberOnly[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> NumberOnly[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - JustNumber=JustNumber, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( NumberOnly[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props.py index da03021b6ba..a2047925381 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props.py @@ -17,6 +17,16 @@ "a": typing.Type[A], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + A[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjWithRequiredProps( @@ -72,20 +82,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - a: typing.Union[ - A[str], - str + arg: typing.Union[ + DictInput, + ObjWithRequiredProps[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjWithRequiredProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - a=a, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjWithRequiredProps[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props_base.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props_base.py index 590dd9a243a..daa7216b1b7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props_base.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/obj_with_required_props_base.py @@ -17,6 +17,16 @@ "b": typing.Type[B], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + B[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjWithRequiredPropsBase( @@ -68,20 +78,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - b: typing.Union[ - B[str], - str + arg: typing.Union[ + DictInput, + ObjWithRequiredPropsBase[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjWithRequiredPropsBase[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - b=b, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjWithRequiredPropsBase[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py index 1a3c6279e36..13d92bb71e4 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_interface.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] ObjectInterface: typing_extensions.TypeAlias = schemas.DictSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py index ead4af0d999..8fc3c471178 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_arg_and_args_properties.py @@ -19,6 +19,20 @@ "args": typing.Type[Args], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Arg[str], + str + ], + typing.Union[ + Args[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectModelWithArgAndArgsProperties( @@ -79,25 +93,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], arg: typing.Union[ - Arg[str], - str - ], - args: typing.Union[ - Args[str], - str + DictInput, + ObjectModelWithArgAndArgsProperties[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectModelWithArgAndArgsProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - arg=arg, - args=args, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectModelWithArgAndArgsProperties[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py index 2261f087a7c..eeb5e08f89f 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_model_with_ref_props.py @@ -64,35 +64,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - myNumber: typing.Union[ - number_with_validations.NumberWithValidations[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int, - float - ] = schemas.unset, - myString: typing.Union[ - string.String[str], - schemas.Unset, - str - ] = schemas.unset, - myBoolean: typing.Union[ - boolean.Boolean[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectModelWithRefProps[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectModelWithRefProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - myNumber=myNumber, - myString=myString, - myBoolean=myBoolean, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectModelWithRefProps[frozendict.frozendict], @@ -112,3 +93,23 @@ def __new__( "myBoolean": typing.Type[boolean.Boolean], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + number_with_validations.NumberWithValidations[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + string.String[str], + str + ], + typing.Union[ + boolean.Boolean[schemas.BoolClass], + bool + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py index 130b8c010df..d14fa946af2 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -17,6 +17,44 @@ "name": typing.Type[Name], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Name[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -57,6 +95,9 @@ def __getitem__(self, name: typing_extensions.Literal["test"]) -> schemas.AnyTyp schemas.FileIO ]]: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["name"]) -> Name[str]: ... + @typing.overload def __getitem__(self, name: str) -> schemas.AnyTypeSchema[typing.Union[ frozendict.frozendict, @@ -73,6 +114,7 @@ def __getitem__( self, name: typing.Union[ typing_extensions.Literal["test"], + typing_extensions.Literal["name"], str ] ): @@ -81,44 +123,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - test: typing.Union[ - schemas.AnyTypeSchema[typing.Union[ - frozendict.frozendict, - str, - decimal.Decimal, - schemas.BoolClass, - schemas.NoneClass, - tuple, - bytes, - schemas.FileIO - ]], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - test=test, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -126,6 +140,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ObjectWithAllOfWithReqTestPropFromUnsetAddProp( @@ -146,9 +161,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithAllOfWithReqTestPropFromUnsetAddProp[ typing.Union[ frozendict.frozendict, @@ -163,9 +180,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithAllOfWithReqTestPropFromUnsetAddProp[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py index 7798070f06c..d024088c522 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_colliding_properties.py @@ -10,15 +10,33 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] SomeProp: typing_extensions.TypeAlias = schemas.DictSchema[U] -Someprop: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] +Someprop2: typing_extensions.TypeAlias = schemas.DictSchema[U] Properties = typing_extensions.TypedDict( 'Properties', { "someProp": typing.Type[SomeProp], - "someprop": typing.Type[Someprop], + "someprop": typing.Type[Someprop2], } ) +DictInput3 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SomeProp[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + Someprop2[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectWithCollidingProperties( @@ -42,7 +60,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __getitem__(self, name: typing_extensions.Literal["someProp"]) -> SomeProp[frozendict.frozendict]: ... @typing.overload - def __getitem__(self, name: typing_extensions.Literal["someprop"]) -> Someprop[frozendict.frozendict]: ... + def __getitem__(self, name: typing_extensions.Literal["someprop"]) -> Someprop2[frozendict.frozendict]: ... @typing.overload def __getitem__(self, name: str) -> schemas.AnyTypeSchema[typing.Union[ @@ -69,29 +87,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - someProp: typing.Union[ - SomeProp[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - someprop: typing.Union[ - Someprop[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput3, + ObjectWithCollidingProperties[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithCollidingProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - someProp=someProp, - someprop=someprop, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithCollidingProperties[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py index eb3591c2111..ec93d5c2492 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_decimal_properties.py @@ -63,34 +63,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - length: typing.Union[ - decimal_payload.DecimalPayload[str], - schemas.Unset, - str - ] = schemas.unset, - width: typing.Union[ - Width[str], - schemas.Unset, - str - ] = schemas.unset, - cost: typing.Union[ - money.Money[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectWithDecimalProperties[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithDecimalProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - length=length, - width=width, - cost=cost, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithDecimalProperties[frozendict.frozendict], @@ -109,3 +91,22 @@ def __new__( "cost": typing.Type[money.Money], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + decimal_payload.DecimalPayload[str], + str + ], + typing.Union[ + Width[str], + str + ], + typing.Union[ + money.Money[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py index 42af75085ad..48d0a8b8309 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_difficultly_named_props.py @@ -21,6 +21,26 @@ "123Number": typing.Type[_123Number], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + _123List[str], + str + ], + typing.Union[ + SpecialPropertyName[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + _123Number[decimal.Decimal], + decimal.Decimal, + int + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectWithDifficultlyNamedProps( @@ -78,15 +98,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectWithDifficultlyNamedProps[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithDifficultlyNamedProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithDifficultlyNamedProps[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py index b453d2c40a8..94b7fbcd87c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_inline_composition_property.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SomeProp( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SomeProp[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SomeProp[ @@ -85,6 +87,33 @@ def __new__( "someProp": typing.Type[SomeProp], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SomeProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectWithInlineCompositionProperty( @@ -138,38 +167,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - someProp: typing.Union[ - SomeProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + ObjectWithInlineCompositionProperty[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithInlineCompositionProperty[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - someProp=someProp, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithInlineCompositionProperty[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py index 85868d2ac42..150694396b5 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_invalid_named_refed_properties.py @@ -62,15 +62,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectWithInvalidNamedRefedProperties[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithInvalidNamedRefedProperties[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithInvalidNamedRefedProperties[frozendict.frozendict], @@ -88,3 +89,19 @@ def __new__( "!reference": typing.Type[array_with_validations_in_items.ArrayWithValidationsInItems], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + array_with_validations_in_items.ArrayWithValidationsInItems[tuple], + list, + tuple + ], + typing.Union[ + from_schema.FromSchema[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py index 44ec291f01e..65fd9e8da4e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_optional_test_prop.py @@ -17,6 +17,16 @@ "test": typing.Type[Test], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Test[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ObjectWithOptionalTestProp( @@ -61,21 +71,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - test: typing.Union[ - Test[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectWithOptionalTestProp[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithOptionalTestProp[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - test=test, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithOptionalTestProp[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py index 5bdfe49fed1..e2c27bf8685 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/object_with_validations.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ObjectWithValidations( @@ -29,15 +30,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ObjectWithValidations[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithValidations[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithValidations[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py index 49432fa0f9b..d63908c2bf4 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/order.py @@ -69,6 +69,40 @@ class Schema_(metaclass=schemas.SingletonMeta): "complete": typing.Type[Complete], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + PetId[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Quantity[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + ShipDate[str], + str, + datetime.datetime + ], + typing.Union[ + Status[str], + str + ], + typing.Union[ + Complete[schemas.BoolClass], + bool + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Order( @@ -133,55 +167,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - petId: typing.Union[ - PetId[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - quantity: typing.Union[ - Quantity[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - shipDate: typing.Union[ - ShipDate[str], - schemas.Unset, - str, - datetime.datetime - ] = schemas.unset, - status: typing.Union[ - Status[str], - schemas.Unset, - str - ] = schemas.unset, - complete: typing.Union[ - Complete[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Order[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Order[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - id=id, - petId=petId, - quantity=quantity, - shipDate=shipDate, - status=status, - complete=complete, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Order[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py index 34022ad2b04..0550c5dde68 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/parent_pet.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ParentPet( @@ -39,15 +40,16 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ParentPet[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ParentPet[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ParentPet[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py index 678ac329d03..0d4a6718af3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pet.py @@ -27,18 +27,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> PhotoUrls[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( PhotoUrls[tuple], @@ -63,19 +63,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ tag.Tag[frozendict.frozendict], dict, frozendict.frozendict ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Tags[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Tags[tuple], @@ -195,53 +195,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - name: typing.Union[ - Name[str], - str - ], - photoUrls: typing.Union[ - PhotoUrls[tuple], - list, - tuple + arg: typing.Union[ + DictInput, + Pet[frozendict.frozendict], ], - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - category: typing.Union[ - category.Category[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - tags: typing.Union[ - Tags[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - status: typing.Union[ - Status[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Pet[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - name=name, - photoUrls=photoUrls, - id=id, - category=category, - tags=tags, - status=status, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Pet[frozendict.frozendict], @@ -263,3 +226,37 @@ def __new__( "status": typing.Type[Status], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[str], + str + ], + typing.Union[ + PhotoUrls[tuple], + list, + tuple + ], + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + category.Category[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + Tags[tuple], + list, + tuple + ], + typing.Union[ + Status[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py index 1c77e72ea3f..ca5dd12e266 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/pig.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Pig( @@ -38,9 +39,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Pig[ typing.Union[ frozendict.frozendict, @@ -55,9 +58,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Pig[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py index a24157e820d..55475a03062 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/player.py @@ -61,28 +61,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - name: typing.Union[ - Name[str], - schemas.Unset, - str - ] = schemas.unset, - enemyPlayer: typing.Union[ + arg: typing.Union[ + DictInput, Player[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Player[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - name=name, - enemyPlayer=enemyPlayer, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Player[frozendict.frozendict], @@ -97,3 +85,18 @@ def __new__( "enemyPlayer": typing.Type[Player], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[str], + str + ], + typing.Union[ + Player[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py index 33e3f1d721b..a3c3c1f018c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Quadrilateral( @@ -38,9 +39,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Quadrilateral[ typing.Union[ frozendict.frozendict, @@ -55,9 +58,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Quadrilateral[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py index e8dda113f19..f6d0a0fc210 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/quadrilateral_interface.py @@ -39,6 +39,20 @@ def QUADRILATERAL(cls) -> ShapeType[str]: "quadrilateralType": typing.Type[QuadrilateralType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + QuadrilateralType[str], + str + ], + typing.Union[ + ShapeType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class QuadrilateralInterface( @@ -100,9 +114,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> QuadrilateralInterface[ typing.Union[ frozendict.frozendict, @@ -117,9 +133,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( QuadrilateralInterface[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py index 1ffe81caeb7..34a6ac89893 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/read_only_first.py @@ -19,6 +19,20 @@ "baz": typing.Type[Baz], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Bar[str], + str + ], + typing.Union[ + Baz[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ReadOnlyFirst( @@ -67,27 +81,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - bar: typing.Union[ - Bar[str], - schemas.Unset, - str - ] = schemas.unset, - baz: typing.Union[ - Baz[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + ReadOnlyFirst[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ReadOnlyFirst[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - bar=bar, - baz=baz, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ReadOnlyFirst[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py index 87c82485378..dcae10106ed 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_explicit_add_props.py @@ -11,6 +11,23 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + AdditionalProperties[str], + str + ], + typing.Union[ + AdditionalProperties[str], + str + ], + typing.Union[ + AdditionalProperties[str], + str + ], + ] +] class ReqPropsFromExplicitAddProps( @@ -58,23 +75,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - validName: typing.Union[ - AdditionalProperties[str], - str - ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[str], - str + arg: typing.Union[ + DictInput, + ReqPropsFromExplicitAddProps[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ReqPropsFromExplicitAddProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - validName=validName, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ReqPropsFromExplicitAddProps[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py index e9478b50876..f0ace10fd01 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_true_add_props.py @@ -10,7 +10,76 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AdditionalProperties: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + AdditionalProperties[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AdditionalProperties[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AdditionalProperties[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + ] +] class ReqPropsFromTrueAddProps( @@ -94,57 +163,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - validName: typing.Union[ - AdditionalProperties[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput2, + ReqPropsFromTrueAddProps[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ReqPropsFromTrueAddProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - validName=validName, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ReqPropsFromTrueAddProps[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py index fc4a9f2f3f7..7871037ecc9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/req_props_from_unset_add_props.py @@ -10,6 +10,68 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + schemas.AnyTypeSchema[typing.Union[ + frozendict.frozendict, + str, + decimal.Decimal, + schemas.BoolClass, + schemas.NoneClass, + tuple, + bytes, + schemas.FileIO + ]], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class ReqPropsFromUnsetAddProps( @@ -92,44 +154,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - validName: typing.Union[ - schemas.AnyTypeSchema[typing.Union[ - frozendict.frozendict, - str, - decimal.Decimal, - schemas.BoolClass, - schemas.NoneClass, - tuple, - bytes, - schemas.FileIO - ]], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + ReqPropsFromUnsetAddProps[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ReqPropsFromUnsetAddProps[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - validName=validName, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ReqPropsFromUnsetAddProps[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py index 62a05d42ce0..5d6875ad447 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/scalene_triangle.py @@ -37,6 +37,16 @@ def SCALENE_TRIANGLE(cls) -> TriangleType[str]: "triangleType": typing.Type[TriangleType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + TriangleType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -76,21 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - triangleType: typing.Union[ - TriangleType[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - triangleType=triangleType, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -98,6 +103,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ScaleneTriangle( @@ -118,9 +124,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ScaleneTriangle[ typing.Union[ frozendict.frozendict, @@ -135,9 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ScaleneTriangle[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py index be5b6e91561..ca334be603c 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_array_model.py @@ -29,19 +29,19 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ SelfReferencingArrayModel[tuple], list, tuple ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SelfReferencingArrayModel[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( SelfReferencingArrayModel[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py index b13c211a9c9..6baa205c3ae 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/self_referencing_object_model.py @@ -46,26 +46,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - selfRef: typing.Union[ + arg: typing.Union[ + DictInput, SelfReferencingObjectModel[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - SelfReferencingObjectModel[frozendict.frozendict], - dict, - frozendict.frozendict ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SelfReferencingObjectModel[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - selfRef=selfRef, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SelfReferencingObjectModel[frozendict.frozendict], @@ -79,3 +69,18 @@ def __new__( "selfRef": typing.Type[SelfReferencingObjectModel], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SelfReferencingObjectModel[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + SelfReferencingObjectModel[frozendict.frozendict], + dict, + frozendict.frozendict + ], + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py index ff8adaf7bb7..a9a33053af3 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Shape( @@ -38,9 +39,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Shape[ typing.Union[ frozendict.frozendict, @@ -55,9 +58,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Shape[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py index 164e0ae905c..8babf55cfb1 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/shape_or_null.py @@ -11,6 +11,7 @@ from petstore_api.shared_imports.schema_imports import * _0: typing_extensions.TypeAlias = schemas.NoneSchema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ShapeOrNull( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ShapeOrNull[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ShapeOrNull[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py index e205913132d..9fd3c3bd9ef 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/simple_quadrilateral.py @@ -37,6 +37,16 @@ def SIMPLE_QUADRILATERAL(cls) -> QuadrilateralType[str]: "quadrilateralType": typing.Type[QuadrilateralType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + QuadrilateralType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class _1( @@ -76,21 +86,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - quadrilateralType: typing.Union[ - QuadrilateralType[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + _1[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> _1[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - quadrilateralType=quadrilateralType, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( _1[frozendict.frozendict], @@ -98,6 +103,7 @@ def __new__( ) return inst +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SimpleQuadrilateral( @@ -118,9 +124,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SimpleQuadrilateral[ typing.Union[ frozendict.frozendict, @@ -135,9 +143,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SimpleQuadrilateral[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py index 1f228a96ed0..519eefa206d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/some_object.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SomeObject( @@ -30,9 +31,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SomeObject[ typing.Union[ frozendict.frozendict, @@ -47,9 +50,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SomeObject[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py index cd571f231bd..e689a3706cb 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/special_model_name.py @@ -17,6 +17,16 @@ "a": typing.Type[A], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + A[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class SpecialModelName( @@ -63,21 +73,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - a: typing.Union[ - A[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + SpecialModelName[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SpecialModelName[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - a=a, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SpecialModelName[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py index e2f0b75c4c5..b9054c57f58 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_boolean_map.py @@ -11,6 +11,13 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.BoolSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[schemas.BoolClass], + bool + ], +] class StringBooleanMap( @@ -34,18 +41,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[schemas.BoolClass]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[schemas.BoolClass], - bool + arg: typing.Union[ + DictInput, + StringBooleanMap[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> StringBooleanMap[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( StringBooleanMap[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py index b8150de644e..d5d219b3e52 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/string_enum.py @@ -74,11 +74,11 @@ def NONE(cls) -> StringEnum[schemas.NoneClass]: def __new__( cls, - arg_: typing.Union[ + arg: typing.Union[ None, str ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> StringEnum[ typing.Union[ schemas.NoneClass, @@ -87,8 +87,8 @@ def __new__( ]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( StringEnum[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py index 8054dffda3e..e5d53077b46 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/tag.py @@ -19,6 +19,21 @@ "name": typing.Type[Name], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Name[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Tag( @@ -67,28 +82,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - name: typing.Union[ - Name[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Tag[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Tag[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - id=id, - name=name, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Tag[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py index 5c6322016a0..6cc3283e11d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Triangle( @@ -39,9 +40,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Triangle[ typing.Union[ frozendict.frozendict, @@ -56,9 +59,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Triangle[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py index a36dd2c77ab..bf62cea3ec7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/triangle_interface.py @@ -39,6 +39,20 @@ def TRIANGLE(cls) -> ShapeType[str]: "triangleType": typing.Type[TriangleType], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ShapeType[str], + str + ], + typing.Union[ + TriangleType[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class TriangleInterface( @@ -100,9 +114,11 @@ def __getitem__( def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> TriangleInterface[ typing.Union[ frozendict.frozendict, @@ -117,9 +133,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( TriangleInterface[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py index c0d7b11725a..ba1248fb87e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/user.py @@ -18,7 +18,9 @@ Password: typing_extensions.TypeAlias = schemas.StrSchema[U] Phone: typing_extensions.TypeAlias = schemas.StrSchema[U] UserStatus: typing_extensions.TypeAlias = schemas.Int32Schema[U] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] ObjectWithNoDeclaredProps: typing_extensions.TypeAlias = schemas.DictSchema[U] +DictInput2 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class ObjectWithNoDeclaredPropsNullable( @@ -39,13 +41,12 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ None, - dict, - frozendict.frozendict + DictInput2, + ObjectWithNoDeclaredPropsNullable[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> ObjectWithNoDeclaredPropsNullable[ typing.Union[ schemas.NoneClass, @@ -54,9 +55,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( ObjectWithNoDeclaredPropsNullable[ @@ -69,8 +69,10 @@ def __new__( ) return inst +DictInput3 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AnyTypeProp: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] _Not: typing_extensions.TypeAlias = schemas.NoneSchema[U] +DictInput4 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class AnyTypeExceptNullProp( @@ -86,9 +88,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput4, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> AnyTypeExceptNullProp[ typing.Union[ frozendict.frozendict, @@ -103,9 +107,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( AnyTypeExceptNullProp[ @@ -124,6 +127,7 @@ def __new__( ) return inst +DictInput5 = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AnyTypePropNullable: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] Properties = typing_extensions.TypedDict( 'Properties', @@ -143,6 +147,123 @@ def __new__( "anyTypePropNullable": typing.Type[AnyTypePropNullable], } ) +DictInput6 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Id[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Username[str], + str + ], + typing.Union[ + FirstName[str], + str + ], + typing.Union[ + LastName[str], + str + ], + typing.Union[ + Email[str], + str + ], + typing.Union[ + Password[str], + str + ], + typing.Union[ + Phone[str], + str + ], + typing.Union[ + UserStatus[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + ObjectWithNoDeclaredProps[frozendict.frozendict], + dict, + frozendict.frozendict + ], + typing.Union[ + ObjectWithNoDeclaredPropsNullable[typing.Union[ + schemas.NoneClass, + frozendict.frozendict + ]], + None, + dict, + frozendict.frozendict + ], + typing.Union[ + AnyTypeProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AnyTypeExceptNullProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AnyTypePropNullable[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class User( @@ -265,152 +386,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - id: typing.Union[ - Id[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - username: typing.Union[ - Username[str], - schemas.Unset, - str - ] = schemas.unset, - firstName: typing.Union[ - FirstName[str], - schemas.Unset, - str - ] = schemas.unset, - lastName: typing.Union[ - LastName[str], - schemas.Unset, - str - ] = schemas.unset, - email: typing.Union[ - Email[str], - schemas.Unset, - str - ] = schemas.unset, - password: typing.Union[ - Password[str], - schemas.Unset, - str - ] = schemas.unset, - phone: typing.Union[ - Phone[str], - schemas.Unset, - str - ] = schemas.unset, - userStatus: typing.Union[ - UserStatus[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - objectWithNoDeclaredProps: typing.Union[ - ObjectWithNoDeclaredProps[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - objectWithNoDeclaredPropsNullable: typing.Union[ - ObjectWithNoDeclaredPropsNullable[typing.Union[ - schemas.NoneClass, - frozendict.frozendict - ]], - schemas.Unset, - None, - dict, - frozendict.frozendict - ] = schemas.unset, - anyTypeProp: typing.Union[ - AnyTypeProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - anyTypeExceptNullProp: typing.Union[ - AnyTypeExceptNullProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - anyTypePropNullable: typing.Union[ - AnyTypePropNullable[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput6, + User[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> User[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - id=id, - username=username, - firstName=firstName, - lastName=lastName, - email=email, - password=password, - phone=phone, - userStatus=userStatus, - objectWithNoDeclaredProps=objectWithNoDeclaredProps, - objectWithNoDeclaredPropsNullable=objectWithNoDeclaredPropsNullable, - anyTypeProp=anyTypeProp, - anyTypeExceptNullProp=anyTypeExceptNullProp, - anyTypePropNullable=anyTypePropNullable, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( User[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py index 842454e632d..8dae2746749 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/whale.py @@ -41,6 +41,24 @@ def WHALE(cls) -> ClassName[str]: "className": typing.Type[ClassName], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ClassName[str], + str + ], + typing.Union[ + HasBaleen[schemas.BoolClass], + bool + ], + typing.Union[ + HasTeeth[schemas.BoolClass], + bool + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Whale( @@ -100,32 +118,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - className: typing.Union[ - ClassName[str], - str + arg: typing.Union[ + DictInput, + Whale[frozendict.frozendict], ], - hasBaleen: typing.Union[ - HasBaleen[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - hasTeeth: typing.Union[ - HasTeeth[schemas.BoolClass], - schemas.Unset, - bool - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Whale[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - className=className, - hasBaleen=hasBaleen, - hasTeeth=hasTeeth, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Whale[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py index f1292e9be9c..f51a2d4ff47 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/components/schema/zebra.py @@ -10,6 +10,7 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] AdditionalProperties: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] @@ -70,6 +71,40 @@ def ZEBRA(cls) -> ClassName[str]: "className": typing.Type[ClassName], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + ClassName[str], + str + ], + typing.Union[ + Type[str], + str + ], + typing.Union[ + AdditionalProperties[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + ] +] class Zebra( @@ -126,46 +161,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - className: typing.Union[ - ClassName[str], - str - ], - type: typing.Union[ - Type[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[ - schemas.INPUT_BASE_TYPES - ], - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput2, + Zebra[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Zebra[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - className=className, - type=type, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Zebra[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py index 0eba2856e64..a6444b113e7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_0/schema.py @@ -51,18 +51,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py index 0eba2856e64..a6444b113e7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/parameters/parameter_2/schema.py @@ -51,18 +51,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py index bb476bb4f00..2c685798b0a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/request_body/content/application_x_www_form_urlencoded/schema.py @@ -51,18 +51,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> EnumFormStringArray[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( EnumFormStringArray[tuple], @@ -112,6 +112,21 @@ def LEFT_PARENTHESIS_XYZ_RIGHT_PARENTHESIS(cls) -> EnumFormString[str]: "enum_form_string": typing.Type[EnumFormString], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + EnumFormStringArray[tuple], + list, + tuple + ], + typing.Union[ + EnumFormString[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -155,28 +170,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - enum_form_string_array: typing.Union[ - EnumFormStringArray[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - enum_form_string: typing.Union[ - EnumFormString[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - enum_form_string_array=enum_form_string_array, - enum_form_string=enum_form_string, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py index b8bcb2051e9..a148bd12881 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/get/responses/response_404/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.DictSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py index 8b9bda5cf17..3b881af06d0 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake/post/request_body/content/application_x_www_form_urlencoded/schema.py @@ -166,6 +166,81 @@ class Schema_(metaclass=schemas.SingletonMeta): "callback": typing.Type[Callback], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Byte[str], + str + ], + typing.Union[ + Double[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + Number[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + PatternWithoutDelimiter[str], + str + ], + typing.Union[ + Integer[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Int32[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + Int64[decimal.Decimal], + decimal.Decimal, + int + ], + typing.Union[ + _Float[decimal.Decimal], + decimal.Decimal, + int, + float + ], + typing.Union[ + String[str], + str + ], + typing.Union[ + Binary[typing.Union[bytes, schemas.FileIO]], + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + Date[str], + str, + datetime.date + ], + typing.Union[ + DateTime[str], + str, + datetime.datetime + ], + typing.Union[ + Password[str], + str + ], + typing.Union[ + Callback[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -279,100 +354,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - byte: typing.Union[ - Byte[str], - str - ], - double: typing.Union[ - Double[decimal.Decimal], - decimal.Decimal, - int, - float - ], - number: typing.Union[ - Number[decimal.Decimal], - decimal.Decimal, - int, - float - ], - pattern_without_delimiter: typing.Union[ - PatternWithoutDelimiter[str], - str + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], - integer: typing.Union[ - Integer[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - int32: typing.Union[ - Int32[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - int64: typing.Union[ - Int64[decimal.Decimal], - schemas.Unset, - decimal.Decimal, - int - ] = schemas.unset, - string: typing.Union[ - String[str], - schemas.Unset, - str - ] = schemas.unset, - binary: typing.Union[ - Binary[typing.Union[bytes, schemas.FileIO]], - schemas.Unset, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - date: typing.Union[ - Date[str], - schemas.Unset, - str, - datetime.date - ] = schemas.unset, - dateTime: typing.Union[ - DateTime[str], - schemas.Unset, - str, - datetime.datetime - ] = schemas.unset, - password: typing.Union[ - Password[str], - schemas.Unset, - str - ] = schemas.unset, - callback: typing.Union[ - Callback[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - byte=byte, - double=double, - number=number, - pattern_without_delimiter=pattern_without_delimiter, - integer=integer, - int32=int32, - int64=int64, - string=string, - binary=binary, - date=date, - dateTime=dateTime, - password=password, - callback=callback, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py index 98e182c11f8..ed3b0efe6cb 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_additional_properties/post/request_body/content/application_json/schema.py @@ -11,6 +11,13 @@ from petstore_api.shared_imports.schema_imports import * AdditionalProperties: typing_extensions.TypeAlias = schemas.StrSchema[U] +DictInput = typing.Mapping[ + str, + typing.Union[ + AdditionalProperties[str], + str + ], +] class Schema( @@ -29,18 +36,16 @@ def __getitem__(self, name: str) -> AdditionalProperties[str]: def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - AdditionalProperties[str], - str + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py index 04e7339aa92..3ba836edc2a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_0/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Schema( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py index ecbf400e34f..c511b637709 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/parameters/parameter_1/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SomeProp( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SomeProp[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SomeProp[ @@ -85,6 +87,33 @@ def __new__( "someProp": typing.Type[SomeProp], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SomeProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -133,38 +162,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - someProp: typing.Union[ - SomeProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - someProp=someProp, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py index 04e7339aa92..3ba836edc2a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/application_json/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Schema( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py index ecbf400e34f..c511b637709 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/request_body/content/multipart_form_data/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SomeProp( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SomeProp[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SomeProp[ @@ -85,6 +87,33 @@ def __new__( "someProp": typing.Type[SomeProp], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SomeProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -133,38 +162,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - someProp: typing.Union[ - SomeProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - someProp=someProp, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py index 04e7339aa92..3ba836edc2a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/application_json/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class Schema( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[ diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py index ecbf400e34f..c511b637709 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_inline_composition/post/responses/response_200/content/multipart_form_data/schema.py @@ -26,6 +26,7 @@ class Schema_(metaclass=schemas.SingletonMeta): AllOf = typing.Tuple[ typing.Type[_0[schemas.U]], ] +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] class SomeProp( @@ -41,9 +42,11 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - *args_: schemas.INPUT_TYPES_ALL_INCL_SCHEMA, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> SomeProp[ typing.Union[ frozendict.frozendict, @@ -58,9 +61,8 @@ def __new__( ]: inst = super().__new__( cls, - *args_, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( SomeProp[ @@ -85,6 +87,33 @@ def __new__( "someProp": typing.Type[SomeProp], } ) +DictInput2 = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + SomeProp[ + schemas.INPUT_BASE_TYPES + ], + dict, + frozendict.frozendict, + str, + datetime.date, + datetime.datetime, + uuid.UUID, + int, + float, + decimal.Decimal, + bool, + None, + list, + tuple, + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -133,38 +162,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - someProp: typing.Union[ - SomeProp[ - schemas.INPUT_BASE_TYPES - ], - schemas.Unset, - dict, - frozendict.frozendict, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - int, - float, - decimal.Decimal, - bool, - None, - list, - tuple, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput2, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - someProp=someProp, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py index 545e1f9972a..ce8e6e45c6d 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_form_data/get/request_body/content/application_x_www_form_urlencoded/schema.py @@ -19,6 +19,20 @@ "param2": typing.Type[Param2], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Param[str], + str + ], + typing.Union[ + Param2[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -74,25 +88,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - param: typing.Union[ - Param[str], - str - ], - param2: typing.Union[ - Param2[str], - str + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - param=param, - param2=param2, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/request_body/content/application_json_charsetutf8/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_json_with_charset/post/responses/response_200/content/application_json_charsetutf8/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_200/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_response_bodies/get/responses/response_202/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_multiple_securities/get/responses/response_200/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py index 79c6229df62..1ac5a4cfea6 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_obj_in_query/get/parameters/parameter_0/schema.py @@ -17,6 +17,16 @@ "keyword": typing.Type[Keyword], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Keyword[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -56,21 +66,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - keyword: typing.Union[ - Keyword[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - keyword=keyword, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/request_body/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_parameter_collisions1_abab_self_ab/post/responses/response_200/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py index c589a9cef9a..57b7408eb89 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_pet_id_upload_image_with_required_file/post/request_body/content/multipart_form_data/schema.py @@ -19,6 +19,22 @@ "requiredFile": typing.Type[RequiredFile], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + RequiredFile[typing.Union[bytes, schemas.FileIO]], + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AdditionalMetadata[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -69,28 +85,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - requiredFile: typing.Union[ - RequiredFile[typing.Union[bytes, schemas.FileIO]], - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], - additionalMetadata: typing.Union[ - AdditionalMetadata[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - requiredFile=requiredFile, - additionalMetadata=additionalMetadata, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/parameters/parameter_0/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_query_param_with_json_content_type/get/responses/response_200/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_0/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_1/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_2/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_3/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_test_query_paramters/put/parameters/parameter_4/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py index 8e2d921ec18..cd06892d4a8 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_file/post/request_body/content/multipart_form_data/schema.py @@ -19,6 +19,22 @@ "file": typing.Type[File], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + File[typing.Union[bytes, schemas.FileIO]], + bytes, + io.FileIO, + io.BufferedReader + ], + typing.Union[ + AdditionalMetadata[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -69,28 +85,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - file: typing.Union[ - File[typing.Union[bytes, schemas.FileIO]], - bytes, - io.FileIO, - io.BufferedReader + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], ], - additionalMetadata: typing.Union[ - AdditionalMetadata[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - file=file, - additionalMetadata=additionalMetadata, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py index 6a5ad3aa12b..5041eaf1c9b 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_upload_files/post/request_body/content/multipart_form_data/schema.py @@ -25,7 +25,7 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[typing.Union[bytes, schemas.FileIO]], bytes, @@ -33,12 +33,12 @@ def __new__( io.BufferedReader ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Files[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Files[tuple], @@ -55,6 +55,17 @@ def __getitem__(self, name: int) -> Items[typing.Union[bytes, schemas.FileIO]]: "files": typing.Type[Files], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Files[tuple], + list, + tuple + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -94,22 +105,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - files: typing.Union[ - Files[tuple], - schemas.Unset, - list, - tuple - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - files=files, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_1xx/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_200/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_2xx/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_3xx/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_4xx/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py index 072e994d56d..45b8bf5081e 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/fake_wild_card_responses/get/responses/response_5xx/content/application_json/schema.py @@ -10,4 +10,5 @@ from __future__ import annotations from petstore_api.shared_imports.schema_imports import * +DictInput = typing.Mapping[str, schemas.INPUT_TYPES_ALL_INCL_SCHEMA] Schema: typing_extensions.TypeAlias = schemas.AnyTypeSchema[U] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py index 88e4d2e8edc..a419a0a2578 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/responses/response_default/content/application_json/schema.py @@ -49,22 +49,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - string: typing.Union[ - foo.Foo[frozendict.frozendict], - schemas.Unset, - dict, - frozendict.frozendict - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - string=string, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], @@ -80,3 +74,14 @@ def __new__( "string": typing.Type[foo.Foo], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + foo.Foo[frozendict.frozendict], + dict, + frozendict.frozendict + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py index d72b6fd42af..c6a21dbf3c0 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/foo/get/servers/server_1.py @@ -40,6 +40,15 @@ def V2(cls) -> Version[str]: "version": typing.Type[Version], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "version": typing.Union[ + Version[str], + str + ], + } +) class Variables( @@ -74,18 +83,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - version: typing.Union[ - Version[str], - str + arg: typing.Union[ + DictInput3, + Variables[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Variables[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - version=version, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Variables[frozendict.frozendict], @@ -97,7 +104,7 @@ def __new__( @dataclasses.dataclass class Server1(server.ServerWithVariables): - variables: Variables[frozendict.frozendict] = Variables.from_openapi_data_({ + variables: Variables[frozendict.frozendict] = Variables({ "version": Version.Schema_.default, }) variables_cls: typing.Type[Variables] = Variables diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py index 6c9f7ff2be4..907cae35ac7 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/get/parameters/parameter_0/schema.py @@ -56,18 +56,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py index d72b6fd42af..c6a21dbf3c0 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_status/servers/server_1.py @@ -40,6 +40,15 @@ def V2(cls) -> Version[str]: "version": typing.Type[Version], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "version": typing.Union[ + Version[str], + str + ], + } +) class Variables( @@ -74,18 +83,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - version: typing.Union[ - Version[str], - str + arg: typing.Union[ + DictInput3, + Variables[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Variables[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - version=version, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Variables[frozendict.frozendict], @@ -97,7 +104,7 @@ def __new__( @dataclasses.dataclass class Server1(server.ServerWithVariables): - variables: Variables[frozendict.frozendict] = Variables.from_openapi_data_({ + variables: Variables[frozendict.frozendict] = Variables({ "version": Version.Schema_.default, }) variables_cls: typing.Type[Variables] = Variables diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py index de25475a43d..7485f322135 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_find_by_tags/get/parameters/parameter_0/schema.py @@ -25,18 +25,18 @@ class Schema_(metaclass=schemas.SingletonMeta): def __new__( cls, - arg_: typing.Sequence[ + arg: typing.Sequence[ typing.Union[ Items[str], str ] ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[tuple]: inst = super().__new__( cls, - arg_, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Schema[tuple], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py index f4340ec25c9..bf98a57d3fa 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id/post/request_body/content/application_x_www_form_urlencoded/schema.py @@ -19,6 +19,20 @@ "status": typing.Type[Status], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + Name[str], + str + ], + typing.Union[ + Status[str], + str + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -62,27 +76,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - name: typing.Union[ - Name[str], - schemas.Unset, - str - ] = schemas.unset, - status: typing.Union[ - Status[str], - schemas.Unset, - str - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - name=name, - status=status, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py index e9b5356eebe..8e30315013a 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/paths/pet_pet_id_upload_image/post/request_body/content/multipart_form_data/schema.py @@ -19,6 +19,22 @@ "file": typing.Type[File], } ) +DictInput = typing.Mapping[ + str, + typing.Union[ + typing.Union[ + AdditionalMetadata[str], + str + ], + typing.Union[ + File[typing.Union[bytes, schemas.FileIO]], + bytes, + io.FileIO, + io.BufferedReader + ], + schemas.INPUT_TYPES_ALL_INCL_SCHEMA + ] +] class Schema( @@ -62,29 +78,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - additionalMetadata: typing.Union[ - AdditionalMetadata[str], - schemas.Unset, - str - ] = schemas.unset, - file: typing.Union[ - File[typing.Union[bytes, schemas.FileIO]], - schemas.Unset, - bytes, - io.FileIO, - io.BufferedReader - ] = schemas.unset, - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, - **kwargs: schemas.INPUT_TYPES_ALL_INCL_SCHEMA + arg: typing.Union[ + DictInput, + Schema[frozendict.frozendict], + ], + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Schema[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - additionalMetadata=additionalMetadata, - file=file, - configuration_=configuration_, - **kwargs, + arg, + configuration=configuration, ) inst = typing.cast( Schema[frozendict.frozendict], diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py b/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py index b16bbe4431c..a3e6ee2e0a4 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/schemas.py @@ -46,18 +46,18 @@ class FileIO(io.FileIO): Note: this class is not immutable """ - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader]): - if isinstance(arg_, (io.FileIO, io.BufferedReader)): - if arg_.closed: + def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader]): + if isinstance(arg, (io.FileIO, io.BufferedReader)): + if arg.closed: raise exceptions.ApiValueError('Invalid file state; file is closed and must be open') - arg_.close() + arg.close() super_cls: typing.Type = super(FileIO, cls) - inst = super_cls.__new__(cls, arg_.name) - super(FileIO, inst).__init__(arg_.name) + inst = super_cls.__new__(cls, arg.name) + super(FileIO, inst).__init__(arg.name) return inst - raise exceptions.ApiValueError('FileIO must be passed arg_ which contains the open file') + raise exceptions.ApiValueError('FileIO must be passed arg which contains the open file') - def __init__(self, arg_: typing.Union[io.FileIO, io.BufferedReader]): + def __init__(self, arg: typing.Union[io.FileIO, io.BufferedReader]): """ if this does not exist, then classes with FileIO as a mixin (AnyType etc) will see the io.FileIO __init__ signature rather than the __new__ one @@ -129,11 +129,11 @@ def __call__(cls, *args, **kwargs): class Singleton: """ Enums and singletons are the same - The same instance is returned for a given key of (cls, arg_) + The same instance is returned for a given key of (cls, arg) """ _instances = {} - def __new__(cls, arg_: typing.Any, **kwargs): + def __new__(cls, arg: typing.Any, **kwargs): """ cls base classes: BoolClass, NoneClass, str, decimal.Decimal The 3rd key is used in the tuple below for a corner case where an enum contains integer 1 @@ -141,16 +141,16 @@ def __new__(cls, arg_: typing.Any, **kwargs): Decimal('1.0') == Decimal('1') But if we omitted the 3rd value in the key, then Decimal('1.0') would be stored as Decimal('1') and json serializing that instance would be '1' rather than the expected '1.0' - Adding the 3rd value, the str of arg_ ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 + Adding the 3rd value, the str of arg ensures that 1.0 -> Decimal('1.0') which is serialized as 1.0 """ - key = (cls, arg_, str(arg_)) + key = (cls, arg, str(arg)) if key not in cls._instances: - if isinstance(arg_, (none_type_, bool, BoolClass, NoneClass)): + if isinstance(arg, (none_type_, bool, BoolClass, NoneClass)): inst = super().__new__(cls) cls._instances[key] = inst else: super_inst: typing.Type = super() - cls._instances[key] = super_inst.__new__(cls, arg_) + cls._instances[key] = super_inst.__new__(cls, arg) return cls._instances[key] def __repr__(self): @@ -1350,60 +1350,13 @@ def _get_new_instance_without_conversion( used_arg = arg return super_cls.__new__(cls, used_arg) - @classmethod - def from_openapi_data_( - cls, - arg: typing.Union[ - str, - int, - float, - bool, - None, - dict, - list, - io.FileIO, - io.BufferedReader, - bytes - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None - ): - """ - Schema from_openapi_data_ - """ - from_server = True - validated_path_to_schemas = {} - path_to_type = {} - cast_arg = cast_to_allowed_types(arg, from_server, validated_path_to_schemas, ('args[0]',), path_to_type) - validation_metadata = ValidationMetadata( - path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), - validated_path_to_schemas=frozendict.frozendict(validated_path_to_schemas) - ) - path_to_schemas = cls.__get_new_cls(cast_arg, validation_metadata, path_to_type) - new_cls = path_to_schemas[validation_metadata.path_to_item] - new_inst = new_cls._get_new_instance_without_conversion( - cast_arg, - validation_metadata.path_to_item, - path_to_schemas - ) - return new_inst - - @staticmethod - def __get_input_dict(*args, **kwargs) -> frozendict.frozendict: - input_dict = {} - if args and isinstance(args[0], (dict, frozendict.frozendict)): - input_dict.update(args[0]) - if kwargs: - input_dict.update(kwargs) - return frozendict.frozendict(input_dict) - @staticmethod def __remove_unsets(kwargs): return {key: val for key, val in kwargs.items() if val is not unset} def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ dict, frozendict.frozendict, list, @@ -1422,49 +1375,20 @@ def __new__( io.BufferedReader, 'Schema', ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - Unset, - dict, - frozendict.frozendict, - list, - tuple, - decimal.Decimal, - float, - int, - str, - datetime.date, - datetime.datetime, - uuid.UUID, - bool, - None, - bytes, - io.FileIO, - io.BufferedReader, - 'Schema', - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ Schema __new__ Args: - args_ (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value - kwargs (str, int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): dict values - configuration_: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords + arg (int/float/decimal.Decimal/str/list/tuple/dict/frozendict.frozendict/bool/None): the value + configuration: contains the schema_configuration.SchemaConfiguration that enables json schema validation keywords like minItems, minLength etc Note: double underscores are used here because pycharm thinks that these variables are instance properties if they are named normally :( """ - __kwargs = cls.__remove_unsets(kwargs) - if not args_ and not __kwargs: - raise TypeError( - 'No input given. args or kwargs must be given.' - ) - if not __kwargs and args_ and not isinstance(args_[0], dict): - __arg = args_[0] - else: - __arg = cls.__get_input_dict(*args_, **__kwargs) + __arg = arg __from_server = False __validated_path_to_schemas = {} __path_to_type = {} @@ -1472,7 +1396,7 @@ def __new__( __arg, __from_server, __validated_path_to_schemas, ('args[0]',), __path_to_type) __validation_metadata = ValidationMetadata( path_to_item=('args[0]',), - configuration=configuration_ or schema_configuration.SchemaConfiguration(), + configuration=configuration or schema_configuration.SchemaConfiguration(), validated_path_to_schemas=frozendict.frozendict(__validated_path_to_schemas) ) __path_to_schemas = cls.__get_new_cls(cast_arg, __validation_metadata, __path_to_type) @@ -2131,12 +2055,12 @@ class ListSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({tuple}) - @classmethod - def from_openapi_data_(cls, arg: typing.Sequence[typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Sequence[typing.Any], **kwargs: typing.Optional[schema_configuration.SchemaConfiguration]) -> ListSchema[tuple]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Sequence[typing.Any], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> ListSchema[tuple]: + return super().__new__(cls, arg, configuration=configuration) class NoneSchema( @@ -2148,12 +2072,12 @@ class NoneSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({NoneClass}) - @classmethod - def from_openapi_data_(cls, arg: None, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: None, **kwargs: schema_configuration.SchemaConfiguration) -> NoneSchema[NoneClass]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: None, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NoneSchema[NoneClass]: + return super().__new__(cls, arg, configuration=configuration) class NumberSchema( @@ -2169,12 +2093,12 @@ class NumberSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) - @classmethod - def from_openapi_data_(cls, arg: typing.Union[int, float], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> NumberSchema[decimal.Decimal]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> NumberSchema[decimal.Decimal]: + return super().__new__(cls, arg, configuration=configuration) class IntBase: @@ -2195,12 +2119,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int' - @classmethod - def from_openapi_data_(cls, arg: int, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> IntSchema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> IntSchema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration) return typing.cast(IntSchema[decimal.Decimal], inst) @@ -2212,8 +2136,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int32' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int32Schema[decimal.Decimal], inst) @@ -2225,8 +2153,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'int64' - def __new__(cls, arg_: typing.Union[decimal.Decimal, int], **kwargs: schema_configuration.SchemaConfiguration) -> Int64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Int64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Int64Schema[decimal.Decimal], inst) @@ -2238,12 +2170,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'float' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float32Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float32Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float32Schema[decimal.Decimal], inst) @@ -2255,12 +2187,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({decimal.Decimal}) format: str = 'double' - @classmethod - def from_openapi_data_(cls, arg: float, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[decimal.Decimal, int, float], **kwargs: schema_configuration.SchemaConfiguration) -> Float64Schema[decimal.Decimal]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[decimal.Decimal, int, float], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> Float64Schema[decimal.Decimal]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(Float64Schema[decimal.Decimal], inst) @@ -2279,12 +2211,12 @@ class StrSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) - @classmethod - def from_openapi_data_(cls, arg: str, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None) -> StrSchema[str]: - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> StrSchema[str]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date, datetime.datetime, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> StrSchema[str]: + return super().__new__(cls, arg, configuration=configuration) class UUIDSchema(UUIDBase, StrSchema[T]): @@ -2293,8 +2225,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'uuid' - def __new__(cls, arg_: typing.Union[str, uuid.UUID], **kwargs: schema_configuration.SchemaConfiguration) -> UUIDSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, uuid.UUID], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> UUIDSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(UUIDSchema[str], inst) @@ -2304,8 +2240,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date' - def __new__(cls, arg_: typing.Union[str, datetime.date], **kwargs: schema_configuration.SchemaConfiguration) -> DateSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.date], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateSchema[str], inst) @@ -2315,8 +2255,12 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'date-time' - def __new__(cls, arg_: typing.Union[str, datetime.datetime], **kwargs: schema_configuration.SchemaConfiguration) -> DateTimeSchema[str]: - inst = super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: typing.Union[str, datetime.datetime], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DateTimeSchema[str]: + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DateTimeSchema[str], inst) @@ -2326,7 +2270,11 @@ class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({str}) format: str = 'number' - def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) -> DecimalSchema[str]: + def __new__( + cls, + arg: str, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> DecimalSchema[str]: """ Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads which can be simple (str) or complex (dicts or lists with nested values) @@ -2335,7 +2283,7 @@ def __new__(cls, arg_: str, **kwargs: schema_configuration.SchemaConfiguration) if one was using it for a StrSchema (where it should be cast to str) or one is using it for NumberSchema where it should stay as Decimal. """ - inst = super().__new__(cls, arg_, **kwargs) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(DecimalSchema[str], inst) @@ -2350,9 +2298,13 @@ class BytesSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({bytes}) - def __new__(cls, arg_: bytes, **kwargs: schema_configuration.SchemaConfiguration) -> BytesSchema[bytes]: + def __new__( + cls, + arg: bytes, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BytesSchema[bytes]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class FileSchema( @@ -2379,9 +2331,13 @@ class FileSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({FileIO}) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader], **kwargs: schema_configuration.SchemaConfiguration) -> FileSchema[FileIO]: + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> FileSchema[FileIO]: super_cls: typing.Type = super(Schema, cls) - return super_cls.__new__(cls, arg_) + return super_cls.__new__(cls, arg) class BinarySchema( @@ -2398,8 +2354,12 @@ class Schema_(metaclass=SingletonMeta): FileSchema, ) - def __new__(cls, arg_: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: schema_configuration.SchemaConfiguration) -> BinarySchema[typing.Union[FileIO, bytes]]: - return super().__new__(cls, arg_) + def __new__( + cls, + arg: typing.Union[io.FileIO, io.BufferedReader, bytes], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BinarySchema[typing.Union[FileIO, bytes]]: + return super().__new__(cls, arg) class BoolSchema( @@ -2411,12 +2371,12 @@ class BoolSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({BoolClass}) - @classmethod - def from_openapi_data_(cls, arg: bool, configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - - def __new__(cls, arg_: bool, **kwargs: ValidationMetadata) -> BoolSchema[bool]: - return super().__new__(cls, arg_, **kwargs) + def __new__( + cls, + arg: bool, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None + ) -> BoolSchema[bool]: + return super().__new__(cls, arg, configuration=configuration) class AnyTypeSchema( @@ -2436,7 +2396,7 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2454,26 +2414,7 @@ def __new__( io.FileIO, io.BufferedReader ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader, - Unset - ] + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None ) -> AnyTypeSchema[typing.Union[ NoneClass, frozendict.frozendict, @@ -2482,30 +2423,11 @@ def __new__( decimal.Decimal, BoolClass ]]: - return super().__new__(cls, *args_, configuration_=configuration_, **kwargs) + return super().__new__(cls, arg, configuration=configuration) def __init__( self, - *args_: typing.Union[ - str, - uuid.UUID, - datetime.date, - datetime.datetime, - int, - float, - decimal.Decimal, - dict, - frozendict.frozendict, - list, - tuple, - None, - Schema, - bytes, - io.FileIO, - io.BufferedReader - ], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[ + arg: typing.Union[ str, uuid.UUID, datetime.date, @@ -2523,6 +2445,7 @@ def __init__( io.FileIO, io.BufferedReader ], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ): """ this exists to override the __init__ method form FileIO in NoneFrozenDictTupleStrDecimalBoolFileBytesMixin @@ -2548,10 +2471,10 @@ class Schema_(metaclass=SingletonMeta): def __new__( cls, - *args_, - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, + arg, + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> NotAnyTypeSchema[T]: - inst = super().__new__(cls, *args_, configuration_=configuration_) + inst = super().__new__(cls, arg, configuration=configuration) return typing.cast(NotAnyTypeSchema[T], inst) @@ -2564,17 +2487,12 @@ class DictSchema( class Schema_(metaclass=SingletonMeta): types: typing.FrozenSet[typing.Type] = frozenset({frozendict.frozendict}) - @classmethod - def from_openapi_data_(cls, arg: typing.Dict[str, typing.Any], configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None): - return super().from_openapi_data_(arg, configuration_=configuration_) - def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - configuration_: typing.Optional[schema_configuration.SchemaConfiguration] = None, - **kwargs: typing.Union[dict, frozendict.frozendict, list, tuple, decimal.Decimal, float, int, str, datetime.date, datetime.datetime, uuid.UUID, bool, None, bytes, Schema, Unset, ValidationMetadata], + arg: typing.Union[dict[str, INPUT_TYPES_ALL_INCL_SCHEMA], frozendict.frozendict[str, INPUT_TYPES_ALL_INCL_SCHEMA]], + configuration: typing.Optional[schema_configuration.SchemaConfiguration] = None, ) -> DictSchema[frozendict.frozendict]: - return super().__new__(cls, *args_, **kwargs, configuration_=configuration_) + return super().__new__(cls, arg, configuration=configuration) schema_type_classes = frozenset({NoneSchema, DictSchema, ListSchema, NumberSchema, StrSchema, BoolSchema, AnyTypeSchema}) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py index a2e2a01424c..cf87e669ae9 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_0.py @@ -73,6 +73,19 @@ def POSITIVE_8080(cls) -> Port[str]: "port": typing.Type[Port], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "port": typing.Union[ + Port[str], + str + ], + "server": typing.Union[ + Server[str], + str + ], + } +) class Variables( @@ -116,23 +129,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - port: typing.Union[ - Port[str], - str - ], - server: typing.Union[ - Server[str], - str + arg: typing.Union[ + DictInput3, + Variables[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Variables[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - port=port, - server=server, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Variables[frozendict.frozendict], @@ -147,7 +153,7 @@ class Server0(server.ServerWithVariables): ''' petstore server ''' - variables: Variables[frozendict.frozendict] = Variables.from_openapi_data_({ + variables: Variables[frozendict.frozendict] = Variables({ "server": Server.Schema_.default, "port": Port.Schema_.default, }) diff --git a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py index cbf5b71e965..b4920fb4c53 100644 --- a/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py +++ b/samples/openapi3/client/petstore/python/src/petstore_api/servers/server_1.py @@ -40,6 +40,15 @@ def V2(cls) -> Version[str]: "version": typing.Type[Version], } ) +DictInput3 = typing_extensions.TypedDict( + 'DictInput3', + { + "version": typing.Union[ + Version[str], + str + ], + } +) class Variables( @@ -74,18 +83,16 @@ def __getitem__( def __new__( cls, - *args_: typing.Union[dict, frozendict.frozendict], - version: typing.Union[ - Version[str], - str + arg: typing.Union[ + DictInput3, + Variables[frozendict.frozendict], ], - configuration_: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None, + configuration: typing.Optional[schemas.schema_configuration.SchemaConfiguration] = None ) -> Variables[frozendict.frozendict]: inst = super().__new__( cls, - *args_, - version=version, - configuration_=configuration_, + arg, + configuration=configuration, ) inst = typing.cast( Variables[frozendict.frozendict], @@ -100,7 +107,7 @@ class Server1(server.ServerWithVariables): ''' The local server ''' - variables: Variables[frozendict.frozendict] = Variables.from_openapi_data_({ + variables: Variables[frozendict.frozendict] = Variables({ "version": Version.Schema_.default, }) variables_cls: typing.Type[Variables] = Variables diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py b/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py index 8d63086258e..6162423afa0 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_abstract_step_message.py @@ -12,17 +12,20 @@ import unittest import petstore_api -from petstore_api.components.schema.abstract_step_message import AbstractStepMessage +from petstore_api.components.schema import abstract_step_message class TestAbstractStepMessage(unittest.TestCase): """AbstractStepMessage unit test stubs""" def test_model_instantiation(self): - inst = AbstractStepMessage( - discriminator='AbstractStepMessage', - sequenceNumber=1, - description='some description' + arg: abstract_step_message.DictInput = { + 'discriminator': 'AbstractStepMessage', + 'sequenceNumber': 1, + 'description': 'some description' + } + inst = abstract_step_message.AbstractStepMessage( + arg ) assert inst == { 'discriminator': 'AbstractStepMessage', @@ -47,7 +50,7 @@ def test_model_instantiation(self): ] for invalid_kwarg in invalid_kwargs: with self.assertRaises(TypeError): - AbstractStepMessage(**invalid_kwarg) + abstract_step_message.AbstractStepMessage(invalid_kwarg) if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py index e9b994b7ea5..c68a5712144 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_class.py @@ -26,7 +26,7 @@ def test_additional_properties_class(self): with self.assertRaises(AttributeError): inst.map_property - inst = AdditionalPropertiesClass(map_property={}) + inst = AdditionalPropertiesClass({'map_property': {}}) map_property = inst["map_property"] assert map_property == {} diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py index 13d4462545b..c707d08c482 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_additional_properties_validator.py @@ -20,12 +20,12 @@ class TestAdditionalPropertiesValidator(unittest.TestCase): def test_additional_properties_validator(self): with self.assertRaises(exceptions.ApiValueError): - AdditionalPropertiesValidator(tooShort='ab') + AdditionalPropertiesValidator({'tooShort': 'ab'}) with self.assertRaises(exceptions.ApiValueError): - AdditionalPropertiesValidator(tooLong='abcdef') + AdditionalPropertiesValidator({'tooLong': 'abcdef'}) - inst = AdditionalPropertiesValidator(addProp='abc') + inst = AdditionalPropertiesValidator({'addProp': 'abc'}) add_prop = inst['addProp'] assert add_prop == 'abc' assert isinstance(add_prop, str) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_animal.py b/samples/openapi3/client/petstore/python/tests_manual/test_animal.py index 3972a5f2d6c..4a5b811501d 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_animal.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_animal.py @@ -38,9 +38,9 @@ def testAnimal(self): r"Only the values \['Cat', 'Dog'\] are allowed at \('args\[0\]', 'className'\)" ) with self.assertRaisesRegex(petstore_api.ApiValueError, regex_err): - Animal(className='Fox', color='red') + Animal({'className': 'Fox', 'color': 'red'}) - animal = Animal(className='Cat', color='black') + animal = Animal({'className': 'Cat', 'color': 'black'}) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, cat.Cat) assert isinstance(animal, cat._1) @@ -52,7 +52,7 @@ def testAnimal(self): assert isinstance(animal.className, StrSchema) # pass in optional param - animal = Animal(className='Cat', color='black', declawed=True) + animal = Animal({'className': 'Cat', 'color': 'black', 'declawed': True}) assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, cat.Cat) @@ -66,7 +66,7 @@ def testAnimal(self): assert isinstance(animal["declawed"], BoolSchema) # make a Dog - animal = Animal(className='Dog', color='black') + animal = Animal({'className': 'Dog', 'color': 'black'}) assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, dog.Dog) @@ -78,7 +78,7 @@ def testAnimal(self): assert isinstance(animal.className, StrSchema) # pass in optional param - animal = Animal(className='Dog', color='black', breed='Labrador') + animal = Animal({'className': 'Dog', 'color': 'black', 'breed':'Labrador'}) assert isinstance(animal, Animal) assert isinstance(animal, frozendict.frozendict) assert isinstance(animal, dog.Dog) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py index 21a60779bd9..b2982f6b7d1 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_and_format.py @@ -37,11 +37,11 @@ def test_uuid(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(uuid=valid_value) + AnyTypeAndFormat({'uuid': valid_value}) # an invalid value does not work with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(uuid='1') + AnyTypeAndFormat({'uuid': '1'}) def test_date(self): valid_values = [ @@ -58,11 +58,11 @@ def test_date(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(date=valid_value) + AnyTypeAndFormat({'date': valid_value}) # an invalid value does not work with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(date='1') + AnyTypeAndFormat({'date': '1'}) def test_date_time(self): valid_values = [ @@ -99,11 +99,11 @@ def test_number(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(number=valid_value) + AnyTypeAndFormat({'number': valid_value}) # an invalid value does not work with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(number='a') + AnyTypeAndFormat({'number': 'a'}) def test_int32(self): min_bound = decimal.Decimal(-2147483648) @@ -123,7 +123,7 @@ def test_int32(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(int32=valid_value) + AnyTypeAndFormat({'int32': valid_value}) # invalid values do not work invalid_values = ( @@ -135,7 +135,7 @@ def test_int32(self): ) for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(int32=invalid_value) + AnyTypeAndFormat({'int32': invalid_value}) def test_int64(self): min_bound = decimal.Decimal(-9223372036854775808) @@ -155,7 +155,7 @@ def test_int64(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(int64=valid_value) + AnyTypeAndFormat({'int64': valid_value}) # invalid values do not work invalid_values = ( @@ -167,7 +167,7 @@ def test_int64(self): ) for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(int64=invalid_value) + AnyTypeAndFormat({'int64': invalid_value}) def test_float(self): min_bound = decimal.Decimal(-3.4028234663852886e+38) @@ -186,7 +186,7 @@ def test_float(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(double=valid_value) + AnyTypeAndFormat({'double': valid_value}) # invalid values do not work invalid_values = ( @@ -197,7 +197,7 @@ def test_float(self): ) for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(float=invalid_value) + AnyTypeAndFormat({'float': invalid_value}) def test_double(self): min_bound = decimal.Decimal(-1.7976931348623157E+308) @@ -216,7 +216,7 @@ def test_double(self): b'abc' ] for valid_value in valid_values: - AnyTypeAndFormat(double=valid_value) + AnyTypeAndFormat({'double': valid_value}) with decimal.localcontext() as ctx: ctx.prec = 310 @@ -230,7 +230,7 @@ def test_double(self): # invalid values do not work for invalid_value in invalid_values: with self.assertRaises(exceptions.ApiValueError): - AnyTypeAndFormat(double=invalid_value) + AnyTypeAndFormat({'double': invalid_value}) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py index 16fd7a3e043..560cfd60f92 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_any_type_schema.py @@ -47,7 +47,7 @@ class Schema_: DictSchema, ) - m = Model(a=1, b='hi') + m = Model({'a': 1, 'b': 'hi'}) assert isinstance(m, Model) assert isinstance(m, AnyTypeSchema) assert isinstance(m, DictSchema) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py b/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py index 6f645cb12eb..ca428815e36 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_array_with_validations_in_items.py @@ -14,6 +14,7 @@ import unittest import petstore_api +from petstore_api import exceptions from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems @@ -36,13 +37,13 @@ def testArrayWithValidationsInItems(self): assert inst == (valid_value,) with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, + exceptions.ApiValueError, r"Invalid value `8`, must be a value less than or equal to `7` at \('args\[0\]', 0\)" ): ArrayWithValidationsInItems([8]) with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, + exceptions.ApiValueError, r"Invalid value `\(Decimal\('1'\), Decimal\('2'\), Decimal\('3'\)\)`, number of items must be less than or equal to `2` at \('args\[0\]',\)" ): ArrayWithValidationsInItems([1, 2, 3]) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py b/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py index 7cb9f970f57..f47d09a5ff4 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_combine_schemas.py @@ -29,10 +29,6 @@ class TestCombineNonObjectSchemas(unittest.TestCase): def test_valid_enum_plus_prim(self): - class EnumPlusPrim(IntegerMax10, IntegerEnumOneValue): - pass - - # order of base classes does not matter class EnumPlusPrim(IntegerEnumOneValue, IntegerMax10): pass @@ -55,10 +51,6 @@ class EnumPlusPrim(IntegerEnumOneValue, IntegerMax10): assert isinstance(val, decimal.Decimal) def test_valid_enum_plus_enum(self): - class IntegerOneEnum(IntegerEnumOneValue, IntegerEnum): - pass - - # order of base classes does not matter class IntegerOneEnum(IntegerEnum, IntegerEnumOneValue): pass diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py index f1e04f3aa21..43994b404d9 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_composed_one_of_different_types.py @@ -38,14 +38,14 @@ def test_ComposedOneOfDifferentTypes(self): assert isinstance(inst, NumberWithValidations) # we can make an instance that stores object (dict) data - inst = ComposedOneOfDifferentTypes(className="Cat", color="black") + inst = ComposedOneOfDifferentTypes({'className': "Cat", 'color': "black"}) assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, Animal) assert isinstance(inst, Cat) assert isinstance(inst, frozendict.frozendict) # object that holds 4 properties and is not an Animal - inst = ComposedOneOfDifferentTypes(a="a", b="b", c="c", d="d") + inst = ComposedOneOfDifferentTypes({'a': "a", 'b': "b", 'c': "c", 'd': "d"}) assert isinstance(inst, ComposedOneOfDifferentTypes) assert not isinstance(inst, Animal) assert isinstance(inst, frozendict.frozendict) @@ -59,7 +59,7 @@ def test_ComposedOneOfDifferentTypes(self): assert inst.is_none_() is True # date - inst = ComposedOneOfDifferentTypes.from_openapi_data_('2019-01-10') + inst = ComposedOneOfDifferentTypes('2019-01-10') assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateSchema) assert isinstance(inst, str) @@ -77,7 +77,7 @@ def test_ComposedOneOfDifferentTypes(self): assert inst.as_date_.day == 10 # date-time - inst = ComposedOneOfDifferentTypes.from_openapi_data_('2020-01-02T03:04:05Z') + inst = ComposedOneOfDifferentTypes('2020-01-02T03:04:05Z') assert isinstance(inst, ComposedOneOfDifferentTypes) assert isinstance(inst, DateTimeSchema) assert isinstance(inst, str) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py b/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py index ae8c6b34bc6..73fe6fceb44 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_configuration.py @@ -31,9 +31,12 @@ def test_spec_root_servers(self): security_scheme_info = api_configuration.SecuritySchemeInfo( api_key=api_configuration.security_scheme_api_key.ApiKey(api_key='abcdefg') ) + arg: api_configuration.server_1.DictInput3 = { + 'version': 'v2' + } server_info: api_configuration.ServerInfo = { 'servers/1': api_configuration.server_1.Server1( - variables=api_configuration.server_1.Variables(version='v2') + variables=api_configuration.server_1.Variables(arg) ) } server_index_info: api_configuration.ServerIndexInfo = { @@ -81,9 +84,12 @@ def test_path_servers(self): security_scheme_info = api_configuration.SecuritySchemeInfo( api_key=api_configuration.security_scheme_api_key.ApiKey(api_key='abcdefg') ) + arg: api_configuration.pet_find_by_status_server_1.DictInput3 = { + 'version': 'v2' + } server_info: api_configuration.ServerInfo = { "paths//pet/findByStatus/servers/1": api_configuration.pet_find_by_status_server_1.Server1( - variables=api_configuration.pet_find_by_status_server_1.Variables(version='v2') + variables=api_configuration.pet_find_by_status_server_1.Variables(arg) ) } configuration = api_configuration.ApiConfiguration(security_scheme_info=security_scheme_info, server_info=server_info) @@ -120,9 +126,12 @@ def test_path_servers(self): ) def test_operation_servers(self): + arg: api_configuration.foo_get_server_1.DictInput3 = { + 'version': 'v2' + } server_info: api_configuration.ServerInfo = { "paths//foo/get/servers/1": api_configuration.foo_get_server_1.Server1( - variables=api_configuration.foo_get_server_1.Variables(version='v2') + variables=api_configuration.foo_get_server_1.Variables(arg) ) } config = api_configuration.ApiConfiguration(server_info=server_info) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py index 8af6233f888..f8bee456b0b 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_date_time_with_validations.py @@ -36,22 +36,14 @@ def testDateTimeWithValidations(self): inst = DateTimeWithValidations(valid_value) assert inst == expected_datetime - # when passing data in with from_openapi_data_ one must use str - with self.assertRaisesRegex( - petstore_api.ApiTypeError, - r"Invalid type. Required value type is str and passed " - r"type was at \('args\[0\]',\)" - ): - DateTimeWithValidations.from_openapi_data_(datetime(2020, 1, 1)) - - # when passing data from_openapi_data_ we can use str + # various formats work input_value_to_datetime = { "2020-01-01T00:00:00": datetime(2020, 1, 1, tzinfo=None), "2020-01-01T00:00:00Z": datetime(2020, 1, 1, tzinfo=timezone.utc), "2020-01-01T00:00:00+00:00": datetime(2020, 1, 1, tzinfo=timezone.utc) } for input_value, expected_datetime in input_value_to_datetime.items(): - inst = DateTimeWithValidations.from_openapi_data_(input_value) + inst = DateTimeWithValidations(input_value) assert inst.as_datetime_ == expected_datetime # value error is raised if an invalid string is passed in @@ -59,7 +51,7 @@ def testDateTimeWithValidations(self): petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 datetime format. Invalid value 'abcd' for type datetime at \('args\[0\]',\)" ): - DateTimeWithValidations.from_openapi_data_("abcd") + DateTimeWithValidations("abcd") # value error is raised if a date is passed in with self.assertRaisesRegex( @@ -74,7 +66,7 @@ def testDateTimeWithValidations(self): petstore_api.ApiValueError, error_regex ): - DateTimeWithValidations.from_openapi_data_("2019-01-01T00:00:00Z") + DateTimeWithValidations("2019-01-01T00:00:00Z") # pattern checking with date input error_regex = r"Invalid value `2019-01-01T00:00:00`, must match regular expression `.+?` at \('args\[0\]',\)" with self.assertRaisesRegex( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py index c629ea151ef..aba06e8085f 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_date_with_validations.py @@ -36,20 +36,11 @@ def testDateWithValidations(self): inst = DateWithValidations(valid_value) assert inst == expected_date - # when passing data in with from_openapi_data_ one must use str - with self.assertRaisesRegex( - petstore_api.ApiTypeError, - r"Invalid type. Required value type is str and passed " - r"type was at \('args\[0\]',\)" - - ): - DateWithValidations.from_openapi_data_(date(2020, 1, 1)) - - # when passing data in from the server we can use str + # various formats work valid_values = ["2020-01-01", "2020-01", "2020"] expected_date = date(2020, 1, 1) for valid_value in valid_values: - inst = DateWithValidations.from_openapi_data_(valid_value) + inst = DateWithValidations(valid_value) assert inst.as_date_ == expected_date # value error is raised if an invalid string is passed in @@ -57,7 +48,7 @@ def testDateWithValidations(self): petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 date format. Invalid value '2020-01-01T00:00:00Z' for type date at \('args\[0\]',\)" ): - DateWithValidations.from_openapi_data_("2020-01-01T00:00:00Z") + DateWithValidations("2020-01-01T00:00:00Z") # value error is raised if a datetime is passed in with self.assertRaisesRegex( @@ -71,7 +62,7 @@ def testDateWithValidations(self): petstore_api.ApiValueError, r"Value does not conform to the required ISO-8601 date format. Invalid value 'abcd' for type date at \('args\[0\]',\)" ): - DateWithValidations.from_openapi_data_("abcd") + DateWithValidations("abcd") # pattern checking for str input error_regex = r"Invalid value `2019-01-01`, must match regular expression `.+?` at \('args\[0\]',\)" @@ -79,7 +70,7 @@ def testDateWithValidations(self): petstore_api.ApiValueError, error_regex ): - DateWithValidations.from_openapi_data_("2019-01-01") + DateWithValidations("2019-01-01") # pattern checking for date input with self.assertRaisesRegex( petstore_api.ApiValueError, diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py index 99180a21a03..7a63ecfdceb 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_deserialization.py @@ -17,6 +17,7 @@ import urllib3 import petstore_api +from petstore_api import exceptions from petstore_api import api_client, schemas, api_response from petstore_api.configurations import schema_configuration @@ -125,14 +126,14 @@ def test_regex_constraint(self): # Test with valid regex pattern. inst = apple.Apple( - cultivar="Akane" + {'cultivar': "Akane"} ) assert isinstance(inst, apple.Apple) - inst = apple.Apple( - cultivar="Golden Delicious", - origin="cHiLe" - ) + inst = apple.Apple({ + 'cultivar': "Golden Delicious", + 'origin': "cHiLe" + }) assert isinstance(inst, apple.Apple) # Test with invalid regex pattern. @@ -141,19 +142,19 @@ def test_regex_constraint(self): petstore_api.ApiValueError, err_regex ): - inst = apple.Apple( - cultivar="!@#%@$#Akane" - ) + inst = apple.Apple({ + 'cultivar': "!@#%@$#Akane" + }) err_regex = r"Invalid value `.+?`, must match regular expression `.+?` at \('args\[0\]', 'origin'\)" with self.assertRaisesRegex( petstore_api.ApiValueError, err_regex ): - inst = apple.Apple( - cultivar="Golden Delicious", - origin="!@#%@$#Chile" - ) + inst = apple.Apple({ + 'cultivar': "Golden Delicious", + 'origin': "!@#%@$#Chile" + }) def test_deserialize_mammal(self): """ @@ -291,18 +292,18 @@ def test_deserialize_with_additional_properties(self): 'size': 'medium', } response = self.__response(data) - class ApiResponse(api_response.ApiResponse): + class ApiResponseA(api_response.ApiResponse): response: urllib3.HTTPResponse body: dog.Dog headers: schemas.Unset - class ResponseFor200(api_client.OpenApiResponse): - response_cls=ApiResponse + class ResponseFor200A(api_client.OpenApiResponse): + response_cls=ApiResponseA content={ self.json_content_type: api_client.MediaType(schema=dog.Dog), } - deserialized = ResponseFor200.deserialize(response, self.configuration) + deserialized = ResponseFor200A.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, dog.Dog)) self.assertEqual(body['className'], 'Dog') @@ -324,18 +325,18 @@ class ResponseFor200(api_client.OpenApiResponse): 'p2': ['a', 'b', 123], } response = self.__response(data) - class ApiResponse(api_response.ApiResponse): + class ApiResponseB(api_response.ApiResponse): response: urllib3.HTTPResponse body: mammal.Mammal headers: schemas.Unset - class ResponseFor200(api_client.OpenApiResponse): - response_cls=ApiResponse + class ResponseFor200B(api_client.OpenApiResponse): + response_cls=ApiResponseB content={ self.json_content_type: api_client.MediaType(schema=mammal.Mammal), } - deserialized = ResponseFor200.deserialize(response, self.configuration) + deserialized = ResponseFor200B.deserialize(response, self.configuration) body = deserialized.body self.assertTrue(isinstance(body, zebra.Zebra)) self.assertEqual(body['className'], 'zebra') @@ -356,7 +357,7 @@ class ResponseFor200(api_client.OpenApiResponse): } with self.assertRaises( - petstore_api.exceptions.ApiValueError + exceptions.ApiValueError ): data = { 'lengthCm': 21.2, @@ -466,7 +467,7 @@ class ResponseFor200(api_client.OpenApiResponse): self.assertTrue(isinstance(deserialized.body, format_test.FormatTest)) with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, + exceptions.ApiValueError, r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" ): data = { @@ -504,7 +505,7 @@ class ResponseFor200(api_client.OpenApiResponse): ) with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, + exceptions.ApiValueError, r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" ): data = { diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py deleted file mode 100644 index 2173d7cf7e8..00000000000 --- a/samples/openapi3/client/petstore/python/tests_manual/test_discard_unknown_properties.py +++ /dev/null @@ -1,157 +0,0 @@ -# # coding: utf-8 -# -# # flake8: noqa -# -# """ -# Run the tests. -# $ docker pull swaggerapi/petstore -# $ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore -# $ pip install nose (optional) -# $ cd petstore_api-python -# $ nosetests -v -# """ -# from collections import namedtuple -# import json -# import re -# import unittest -# -# import petstore_api -# from petstore_api.components.schema import cat, dog, isosceles_triangle, banana_req -# from petstore_api import Configuration, signing -# -# from petstore_api.schemas import ( -# file_type, -# model_to_dict, -# ) -# -# MockResponse = namedtuple('MockResponse', 'data') -# -# class DiscardUnknownPropertiesTests(unittest.TestCase): -# -# def test_deserialize_banana_req_do_not_discard_unknown_properties(self): -# """ -# deserialize bananaReq with unknown properties. -# Strict validation is enabled. -# Simple (non-composed) schema scenario. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'lengthCm': 21.3, -# 'sweet': False, -# # Below is an unknown property not explicitly declared in the OpenAPI document. -# # It should not be in the payload because additional properties (undeclared) are -# # not allowed in the bananaReq schema (additionalProperties: false). -# 'unknown_property': 'a-value' -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation raises an exception because the 'unknown_property' -# # is undeclared. -# with self.assertRaises(petstore_api.exceptions.ApiAttributeError) as cm: -# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) -# self.assertTrue(re.match("BananaReq has no attribute 'unknown_property' at.*", str(cm.exception)), -# 'Exception message: {0}'.format(str(cm.exception))) -# -# -# def test_deserialize_isosceles_triangle_do_not_discard_unknown_properties(self): -# """ -# deserialize IsoscelesTriangle with unknown properties. -# Strict validation is enabled. -# Composed schema scenario. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'shape_type': 'Triangle', -# 'triangle_type': 'EquilateralTriangle', -# # Below is an unknown property not explicitly declared in the OpenAPI document. -# # It should not be in the payload because additional properties (undeclared) are -# # not allowed in the schema (additionalProperties: false). -# 'unknown_property': 'a-value' -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation raises an exception because the 'unknown_property' -# # is undeclared. -# with self.assertRaises(petstore_api.ApiValueError) as cm: -# deserialized = api_client.deserialize(response, ((isosceles_triangle.IsoscelesTriangle),), True) -# self.assertTrue(re.match('.*Not all inputs were used.*unknown_property.*', str(cm.exception)), -# 'Exception message: {0}'.format(str(cm.exception))) -# -# -# def test_deserialize_banana_req_discard_unknown_properties(self): -# """ -# Deserialize bananaReq with unknown properties. -# Discard unknown properties. -# """ -# config = Configuration(discard_unknown_keys=True) -# api_client = petstore_api.ApiClient(config) -# data = { -# 'lengthCm': 21.3, -# 'sweet': False, -# # Below are additional (undeclared) properties not specified in the bananaReq schema. -# 'unknown_property': 'a-value', -# 'more-unknown': [ -# 'a' -# ] -# } -# # The 'unknown_property' is undeclared, which would normally raise an exception, but -# # when discard_unknown_keys is set to True, the unknown properties are discarded. -# response = MockResponse(data=json.dumps(data)) -# deserialized = api_client.deserialize(response, ((banana_req.BananaReq),), True) -# self.assertTrue(isinstance(deserialized, banana_req.BananaReq)) -# # Check the 'unknown_property' and 'more-unknown' properties are not present in the -# # output. -# self.assertIn("length_cm", deserialized.to_dict().keys()) -# self.assertNotIn("unknown_property", deserialized.to_dict().keys()) -# self.assertNotIn("more-unknown", deserialized.to_dict().keys()) -# -# def test_deserialize_cat_do_not_discard_unknown_properties(self): -# """ -# Deserialize Cat with unknown properties. -# Strict validation is enabled. -# """ -# config = Configuration(discard_unknown_keys=False) -# api_client = petstore_api.ApiClient(config) -# data = { -# "class_name": "Cat", -# "color": "black", -# "declawed": True, -# "dynamic-property": 12345, -# } -# response = MockResponse(data=json.dumps(data)) -# -# # Deserializing with strict validation does not raise an exception because the even though -# # the 'dynamic-property' is undeclared, the 'Cat' schema defines the additionalProperties -# # attribute. -# deserialized = api_client.deserialize(response, ((cat.Cat),), True) -# self.assertTrue(isinstance(deserialized, cat.Cat)) -# self.assertIn('color', deserialized.to_dict()) -# self.assertEqual(deserialized['color'], 'black') -# -# def test_deserialize_cat_discard_unknown_properties(self): -# """ -# Deserialize Cat with unknown properties. -# Request to discard unknown properties, but Cat is composed schema -# with one inner schema that has 'additionalProperties' set to true. -# """ -# config = Configuration(discard_unknown_keys=True) -# api_client = petstore_api.ApiClient(config) -# data = { -# "class_name": "Cat", -# "color": "black", -# "declawed": True, -# # Below are additional (undeclared) properties. -# "my_additional_property": 123, -# } -# # The 'my_additional_property' is undeclared, but 'Cat' has a 'Address' type through -# # the allOf: [ $ref: '#/components/schemas/Address' ]. -# response = MockResponse(data=json.dumps(data)) -# deserialized = api_client.deserialize(response, ((cat.Cat),), True) -# self.assertTrue(isinstance(deserialized, cat.Cat)) -# # Check the 'unknown_property' and 'more-unknown' properties are not present in the -# # output. -# self.assertIn("declawed", deserialized.to_dict().keys()) -# self.assertIn("my_additional_property", deserialized.to_dict().keys()) -# diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py index 53f6208c3c9..9cd7639bab6 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_drawing.py @@ -34,10 +34,10 @@ def test_create_instances(self): Validate instance can be created """ - inst = shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) + inst = shape.Shape({ + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + }) from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle assert isinstance(inst, IsoscelesTriangle) @@ -46,35 +46,35 @@ def test_deserialize_oneof_reference(self): Validate the scenario when the type of a OAS property is 'oneOf', and the 'oneOf' schema is specified as a reference ($ref), not an inline 'oneOf' schema. """ - isosceles_triangle = shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) + isosceles_triangle = shape.Shape({ + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + }) from petstore_api.components.schema.isosceles_triangle import IsoscelesTriangle assert isinstance(isosceles_triangle, IsoscelesTriangle) from petstore_api.components.schema.equilateral_triangle import EquilateralTriangle - inst = Drawing( - mainShape=isosceles_triangle, - shapes=[ - shape.Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ), - shape.Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ), - shape.Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ), - shape.Shape( - shapeType="Quadrilateral", - quadrilateralType="ComplexQuadrilateral" - ) + inst = Drawing({ + 'mainShape': isosceles_triangle, + 'shapes': [ + shape.Shape({ + 'shapeType': "Triangle", + 'triangleType': "EquilateralTriangle" + }), + shape.Shape({ + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + }), + shape.Shape({ + 'shapeType': "Triangle", + 'triangleType': "EquilateralTriangle" + }), + shape.Shape({ + 'shapeType': "Quadrilateral", + 'quadrilateralType': "ComplexQuadrilateral" + }) ], - ) + }) assert isinstance(inst, Drawing) assert isinstance(inst["mainShape"], IsoscelesTriangle) self.assertEqual(len(inst["shapes"]), 4) @@ -92,11 +92,11 @@ def test_deserialize_oneof_reference(self): petstore_api.ApiValueError, err_msg ): - Drawing( + Drawing({ # 'mainShape' has type 'Shape', which is a oneOf [triangle, quadrilateral] # So the None value should not be allowed and an exception should be raised. - mainShape=None, - ) + 'mainShape': None, + }) """ We can pass in a Triangle instance in shapes @@ -104,15 +104,15 @@ def test_deserialize_oneof_reference(self): does validate as a Shape, so this works """ from petstore_api.components.schema.triangle import Triangle - inst = Drawing( - mainShape=isosceles_triangle, - shapes=[ - Triangle( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ) + inst = Drawing({ + 'mainShape': isosceles_triangle, + 'shapes': [ + Triangle({ + 'shapeType': "Triangle", + 'triangleType': "EquilateralTriangle" + }) ] - ) + }) self.assertEqual(len(inst["shapes"]), 1) from petstore_api.components.schema.triangle_interface import TriangleInterface shapes = inst["shapes"] @@ -131,10 +131,10 @@ def test_deserialize_oneof_reference_with_null_type(self): # Validate we can assign the None value to shape_or_null, because the 'null' type # is one of the allowed types in the 'ShapeOrNull' schema. - inst = Drawing( + inst = Drawing({ # 'shapeOrNull' has type 'ShapeOrNull', which is a oneOf [null, triangle, quadrilateral] - shapeOrNull=None, - ) + 'shapeOrNull': None, + }) assert isinstance(inst, Drawing) self.assertFalse('mainShape' in inst) self.assertTrue('shapeOrNull' in inst) @@ -150,11 +150,11 @@ def test_deserialize_oneof_reference_with_nullable_type(self): # Validate we can assign the None value to nullableShape, because the NullableShape # has the 'nullable: true' attribute. - inst = Drawing( + inst = Drawing({ # 'nullableShape' has type 'NullableShape', which is a oneOf [triangle, quadrilateral] # and the 'nullable: true' attribute. - nullableShape=None, - ) + 'nullableShape': None, + }) assert isinstance(inst, Drawing) self.assertFalse('mainShape' in inst) self.assertTrue('nullableShape' in inst) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py index 6f9795ef41f..08d2ed6cd99 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py @@ -49,7 +49,7 @@ def test_array_model(self): self.json_bytes(json_data) ) - cat = animal.Animal(className="Cat", color="black") + cat = animal.Animal({'className': "Cat", 'color': "black"}) body = animal_farm.AnimalFarm([cat]) api_response = self.api.array_model(body=body) self.assert_request_called_with( @@ -115,9 +115,9 @@ def test_composed_one_of_different_types(self): # serialization + deserialization works number = composed_one_of_different_types.ComposedOneOfDifferentTypes(10.0) - cat = composed_one_of_different_types.ComposedOneOfDifferentTypes( - className="Cat", color="black" - ) + cat = composed_one_of_different_types.ComposedOneOfDifferentTypes({ + 'className': "Cat", 'color': "black" + }) none_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes(None) date_instance = composed_one_of_different_types.ComposedOneOfDifferentTypes('1970-01-01') cast_to_simple_value = [ @@ -202,7 +202,7 @@ def test_mammal(self): # serialization + deserialization works from petstore_api.components.schema.mammal import Mammal with patch.object(RESTClientObject, 'request') as mock_request: - body = Mammal(className="BasquePig") + body = Mammal({'className': "BasquePig"}) value_simple = dict(className='BasquePig') mock_request.return_value = self.response( self.json_bytes(value_simple) @@ -240,13 +240,13 @@ def test_body_with_query_params(self): from petstore_api.components.schema import user with patch.object(RESTClientObject, 'request') as mock_request: - value_simple = dict( - id=1, - username='first last', - firstName='first', - lastName='last' - ) - body = user.User(**value_simple) + value_simple = { + 'id': 1, + 'username': 'first last', + 'firstName': 'first', + 'lastName': 'last' + } + body = user.User(value_simple) mock_request.return_value = self.response( b'' ) @@ -801,11 +801,11 @@ def test_json_patch(self): mock_request.return_value = self.response("") body = json_patch_request.JSONPatchRequest( [ - json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest( - op='add', - path='/a/b/c', - value='foo', - ) + json_patch_request_add_replace_test.JSONPatchRequestAddReplaceTest({ + 'op': 'add', + 'path': '/a/b/c', + 'value': 'foo', + }) ] ) api_response = self.api.json_patch(body=body) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py b/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py index c6fd74dbc92..0c11904fda4 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_format_test.py @@ -17,6 +17,7 @@ import frozendict import petstore_api +from petstore_api import exceptions from petstore_api.components.schema.format_test import FormatTest from petstore_api.schemas import BinarySchema, BytesSchema, Singleton @@ -42,71 +43,95 @@ def test_FormatTest(self): # int32 # under min with self.assertRaises(petstore_api.ApiValueError): - model = FormatTest(int32=-2147483649, **required_args) + arg = dict(**required_args) + arg['int32'] = -2147483649 + model = FormatTest(arg) # over max with self.assertRaises(petstore_api.ApiValueError): - model = FormatTest(int32=2147483648, **required_args) + arg = dict(**required_args) + arg['int32'] = 2147483648 + model = FormatTest(arg) # valid values in range work valid_values = [-2147483648, 2147483647] for valid_value in valid_values: - model = FormatTest(int32=valid_value, **required_args) + arg = dict(**required_args) + arg['int32'] = valid_value + model = FormatTest(arg) assert model["int32"] == valid_value # int64 # under min with self.assertRaises(petstore_api.ApiValueError): - FormatTest(int64=-9223372036854775809, **required_args) + arg = dict(**required_args) + arg['int64'] = -9223372036854775809 + FormatTest(arg) # over max with self.assertRaises(petstore_api.ApiValueError): - FormatTest(int64=9223372036854775808, **required_args) + arg = dict(**required_args) + arg['int64'] = 9223372036854775808 + FormatTest(arg) # valid values in range work valid_values = [-9223372036854775808, 9223372036854775807] for valid_value in valid_values: - model = FormatTest(int64=valid_value, **required_args) + arg = dict(**required_args) + arg['int64'] = valid_value + model = FormatTest(arg) assert model["int64"] == valid_value # float32 # under min with self.assertRaises(petstore_api.ApiValueError): - FormatTest(float32=-3.402823466385289e+38, **required_args) + arg = dict(**required_args) + arg['float32'] = -3.402823466385289e+38 + FormatTest(arg) # over max with self.assertRaises(petstore_api.ApiValueError): - FormatTest(float32=3.402823466385289e+38, **required_args) + arg = dict(**required_args) + arg['float32'] = 3.402823466385289e+38 + FormatTest(arg) # valid values in range work valid_values = [-3.4028234663852886e+38, 3.4028234663852886e+38] for valid_value in valid_values: - model = FormatTest(float32=valid_value, **required_args) + arg = dict(**required_args) + arg['float32'] = valid_value + model = FormatTest(arg) assert model["float32"] == valid_value # float64 # under min, Decimal is used because flat can only store 64bit numbers and the max and min # take up more space than 64bit with self.assertRaises(petstore_api.ApiValueError): - FormatTest(float64=Decimal('-1.7976931348623157082e+308'), **required_args) + arg = dict(**required_args) + arg['float64'] = Decimal('-1.7976931348623157082e+308') + FormatTest(arg) # over max with self.assertRaises(petstore_api.ApiValueError): - FormatTest(float64=Decimal('1.7976931348623157082e+308'), **required_args) + arg = dict(**required_args) + arg['float64'] = Decimal('1.7976931348623157082e+308') + FormatTest(arg) valid_values = [-1.7976931348623157E+308, 1.7976931348623157E+308] for valid_value in valid_values: - model = FormatTest(float64=valid_value, **required_args) + arg = dict(**required_args) + arg['float64'] = valid_value + model = FormatTest(arg) assert model["float64"] == valid_value # unique_items with duplicates throws exception with self.assertRaises(petstore_api.ApiValueError): - FormatTest(arrayWithUniqueItems=[0, 1, 1], **required_args) + FormatTest({'arrayWithUniqueItems': [0, 1, 1], **required_args}) # no duplicates works values = [0, 1, 2] - model = FormatTest(arrayWithUniqueItems=values, **required_args) + model = FormatTest({'arrayWithUniqueItems': values, **required_args}) assert model["arrayWithUniqueItems"] == tuple(values) # __bool__ value of noneProp is False - model = FormatTest(noneProp=None, **required_args) + model = FormatTest({'noneProp': None, **required_args}) assert isinstance(model["noneProp"], Singleton) self.assertFalse(model["noneProp"]) self.assertTrue(model["noneProp"].is_none_()) # binary check - model = FormatTest(binary=b'123', **required_args) + model = FormatTest({'binary': b'123', **required_args}) assert isinstance(model["binary"], BinarySchema) assert isinstance(model["binary"], BytesSchema) assert isinstance(model["binary"], bytes) @@ -120,17 +145,17 @@ def test_FormatTest(self): def test_multiple_of(self): with self.assertRaisesRegex( - petstore_api.exceptions.ApiValueError, + exceptions.ApiValueError, r"Invalid value `31`, value must be a multiple of `2` at \('args\[0\]', 'integer'\)" ): - FormatTest( - byte='3', - date=datetime.date(2000, 1, 1), - password="abcdefghijkl", - integer=31, # Value is supposed to be multiple of '2'. An error must be raised - number=65.0, - float=62.4 - ) + FormatTest({ + 'byte': '3', + 'date': datetime.date(2000, 1, 1), + 'password': "abcdefghijkl", + 'integer': 31, # Value is supposed to be multiple of '2'. An error must be raised + 'number': 65.0, + 'float': 62.4 + }) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py index 020399fea45..75e30f46e35 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit.py @@ -28,7 +28,7 @@ def testFruit(self): # banana test length_cm = 20.3 color = 'yellow' - fruit = Fruit(lengthCm=length_cm, color=color) + fruit = Fruit({'lengthCm': length_cm, 'color': color}) # check its properties self.assertEqual(fruit['lengthCm'], length_cm) self.assertEqual(fruit.get('lengthCm'), length_cm) @@ -64,13 +64,13 @@ def testFruit(self): additional_date='2021-01-02', ) - fruit = Fruit.from_openapi_data_(kwargs) + fruit = Fruit(kwargs) self.assertEqual( fruit, kwargs ) - fruit = Fruit(**kwargs) + fruit = Fruit(kwargs) self.assertEqual( fruit, kwargs @@ -78,16 +78,16 @@ def testFruit(self): # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - Fruit( - lengthCm=length_cm, - cultivar='granny smith' - ) + Fruit({ + 'lengthCm': length_cm, + 'cultivar': 'granny smith' + }) # make an instance of Fruit, a composed schema oneOf model # apple test color = 'red' cultivar = 'golden delicious' - fruit = Fruit(color=color, cultivar=cultivar) + fruit = Fruit({'color': color, 'cultivar': cultivar}) # check its properties self.assertEqual(fruit['color'], color) self.assertEqual(fruit['cultivar'], cultivar) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py index 01c3676c600..b931b957bbd 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_fruit_req.py @@ -34,8 +34,9 @@ def testFruitReq(self): # make an instance of Fruit, a composed schema oneOf model # banana test length_cm = 20.3 - fruit = FruitReq(lengthCm=length_cm) + fruit = FruitReq({'lengthCm': length_cm}) # check its properties + assert isinstance(fruit, banana_req.BananaReq) self.assertEqual(fruit.lengthCm, length_cm) self.assertEqual(fruit['lengthCm'], length_cm) self.assertEqual(getattr(fruit, 'lengthCm'), length_cm) @@ -70,23 +71,24 @@ def testFruitReq(self): # including extra parameters raises an exception with self.assertRaises(petstore_api.ApiValueError): - FruitReq( - length_cm=length_cm, - unknown_property='some value' - ) + FruitReq({ + 'length_cm': length_cm, + 'unknown_property': 'some value' + }) # including input parameters for two oneOf instances raise an exception with self.assertRaises(petstore_api.ApiValueError): - FruitReq( - length_cm=length_cm, - cultivar='granny smith' - ) + FruitReq({ + 'length_cm': length_cm, + 'cultivar': 'granny smith' + }) # make an instance of Fruit, a composed schema oneOf model # apple test cultivar = 'golden delicious' - fruit = FruitReq(cultivar=cultivar) + fruit = FruitReq({'cultivar': cultivar}) # check its properties + assert isinstance(fruit, apple_req.AppleReq) self.assertEqual(fruit.cultivar, cultivar) self.assertEqual(fruit['cultivar'], cultivar) self.assertEqual(getattr(fruit, 'cultivar'), cultivar) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py index aaab68fdf3d..6177a2564b5 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_gm_fruit.py @@ -36,7 +36,7 @@ def testGmFruit(self): length_cm = 20.3 color = 'yellow' cultivar = 'banaple' - fruit = GmFruit(lengthCm=length_cm, color=color, cultivar=cultivar) + fruit = GmFruit({'lengthCm': length_cm, 'color': color, 'cultivar': cultivar}) assert isinstance(fruit, banana.Banana) assert isinstance(fruit, apple.Apple) assert isinstance(fruit, frozendict.frozendict) @@ -69,20 +69,20 @@ def testGmFruit(self): self.assertTrue(getattr(fruit, 'origin', 'some value'), 'some value') # including extra parameters works - GmFruit( - color=color, - length_cm=length_cm, - cultivar=cultivar, - unknown_property='some value' - ) + GmFruit({ + 'color': color, + 'length_cm': length_cm, + 'cultivar': cultivar, + 'unknown_property': 'some value' + }) # including input parameters for both anyOf instances works color = 'orange' - fruit = GmFruit( - color=color, - cultivar=cultivar, - length_cm=length_cm - ) + fruit = GmFruit({ + 'color': color, + 'cultivar': cultivar, + 'length_cm': length_cm + }) self.assertEqual(fruit['color'], color) self.assertEqual(fruit['cultivar'], cultivar) self.assertEqual(fruit['length_cm'], length_cm) @@ -92,7 +92,7 @@ def testGmFruit(self): color = 'red' cultivar = 'golden delicious' origin = 'California' - fruit = GmFruit(color=color, cultivar=cultivar, origin=origin) + fruit = GmFruit({'color': color, 'cultivar': cultivar, 'origin': origin}) # check its properties self.assertEqual(fruit['color'], color) self.assertEqual(fruit['cultivar'], cultivar) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py b/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py index 79ba53badd7..bf5ffbbbf51 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_json_encoder.py @@ -9,10 +9,8 @@ Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ -from datetime import date import unittest -import petstore_api from petstore_api import schemas from petstore_api import api_client @@ -28,7 +26,7 @@ def test_receive_encode_str_types(self): schemas.DateTimeSchema: '2020-01-01T00:00:00' } for schema, value in schema_to_value.items(): - inst = schema.from_openapi_data_(value) + inst = schema(value) assert value == self.serializer.default(inst) def test_receive_encode_numeric_types(self): @@ -41,7 +39,7 @@ def test_receive_encode_numeric_types(self): 7.14: schemas.NumberSchema, } for value, schema in value_to_schema.items(): - inst = schema.from_openapi_data_(value) + inst = schema(value) pre_serialize_value = self.serializer.default(inst) assert value == pre_serialize_value and type(value) == type(pre_serialize_value) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py index 334b890c63a..c7a035dd170 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_mammal.py @@ -30,7 +30,7 @@ def testMammal(self): """Test Mammal""" # tests that we can make a BasquePig by traveling through discriminator in Pig - m = Mammal(className="BasquePig") + m = Mammal({'className': "BasquePig"}) from petstore_api.components.schema import pig from petstore_api.components.schema import basque_pig assert isinstance(m, Mammal) @@ -38,16 +38,16 @@ def testMammal(self): assert isinstance(m, pig.Pig) # can make a Whale - m = Mammal(className="whale") + m = Mammal({'className': "whale"}) from petstore_api.components.schema import whale assert isinstance(m, whale.Whale) # can use the enum value - m = Mammal(className=whale.ClassName.WHALE) + m = Mammal({'className': whale.ClassName.WHALE}) assert isinstance(m, whale.Whale) from petstore_api.components.schema import zebra - m = Mammal(className='zebra') + m = Mammal({'className': 'zebra'}) assert isinstance(m, zebra.Zebra) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_money.py b/samples/openapi3/client/petstore/python/tests_manual/test_money.py index 20f08811b61..0c4ae9ee371 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_money.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_money.py @@ -19,10 +19,10 @@ class TestMoney(unittest.TestCase): def test_Money(self): """Test Money""" - price = Money( - currency='usd', - amount='10.99' - ) + price = Money({ + 'currency': 'usd', + 'amount': '10.99' + }) self.assertEqual(price.amount.as_decimal_, decimal.Decimal('10.99')) self.assertEqual( price, diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py index 834dd05c258..23f340430f8 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_no_additional_properties.py @@ -12,8 +12,8 @@ import decimal import unittest -from petstore_api.components.schema.no_additional_properties import NoAdditionalProperties -from petstore_api import schemas +from petstore_api.components.schema import no_additional_properties +from petstore_api import schemas, exceptions class TestNoAdditionalProperties(unittest.TestCase): """NoAdditionalProperties unit test stubs""" @@ -28,7 +28,10 @@ def testNoAdditionalProperties(self): """Test NoAdditionalProperties""" # works with only required - inst = NoAdditionalProperties(id=1) + arg: no_additional_properties.DictInput3 = { + 'id': 1 + } + inst = no_additional_properties.NoAdditionalProperties(arg) id_by_items = inst["id"] assert id_by_items == 1 assert isinstance(id_by_items, (schemas.Int64Schema, decimal.Decimal)) @@ -42,31 +45,35 @@ def testNoAdditionalProperties(self): assert inst.get("petId", schemas.unset) is schemas.unset # works with required + optional - inst = NoAdditionalProperties(id=1, petId=2) + arg: no_additional_properties.DictInput3 = { + 'petId': 2, + 'id': 1 + } + inst = no_additional_properties.NoAdditionalProperties(arg) # needs required # TODO cast this to ApiTypeError? with self.assertRaisesRegex( TypeError, - r"missing 1 required keyword-only argument: 'id'" + r"missing 1 required argument: \['id'\]" ): - NoAdditionalProperties(petId=2) + no_additional_properties.NoAdditionalProperties({'petId': 2}) # may not be passed additional properties # TODO cast this to ApiTypeError? with self.assertRaisesRegex( - TypeError, - r"got an unexpected keyword argument 'invalidArg'" + exceptions.ApiValueError, + r"Value is invalid because it is disallowed by AnyTypeSchema" ): - NoAdditionalProperties(id=2, invalidArg=2) + no_additional_properties.NoAdditionalProperties({'id': 2, 'invalidArg': 1}) # plural example # TODO cast this to ApiTypeError? with self.assertRaisesRegex( - TypeError, - r"got an unexpected keyword argument 'firstInvalidArg'" + exceptions.ApiValueError, + r"Value is invalid because it is disallowed by AnyTypeSchema" ): - NoAdditionalProperties(id=2, firstInvalidArg=1, secondInvalidArg=1) + no_additional_properties.NoAdditionalProperties({'id': 2, 'firstInvalidArg': 1, 'secondInvalidArg': 3}) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py index ee643e52401..b815af0bcbc 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_number_with_validations.py @@ -8,9 +8,6 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ - - -import sys import unittest import petstore_api diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_obj_with_required_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_obj_with_required_props.py index 53b735f16ff..4091f2040da 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_obj_with_required_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_obj_with_required_props.py @@ -21,7 +21,7 @@ class TestObjWithRequiredProps(unittest.TestCase): """ObjWithRequiredProps unit test stubs""" configuration_ = schema_configuration.SchemaConfiguration() - obj = obj_with_required_props.ObjWithRequiredProps(a='a', b='b') + obj = obj_with_required_props.ObjWithRequiredProps({'a': 'a', 'b': 'b'}) assert isinstance(obj, obj_with_required_props.ObjWithRequiredProps) and isinstance(obj, obj_with_required_props_base.ObjWithRequiredPropsBase) a = obj.a orgin_cls = typing_extensions.get_origin(obj_with_required_props.A) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py index d904ab633c6..2cfba58b558 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_arg_and_args_properties.py @@ -22,8 +22,9 @@ class TestObjectModelWithArgAndArgsProperties(unittest.TestCase): def test_ObjectModelWithArgAndArgsProperties(self): """Test ObjectModelWithArgAndArgsProperties""" - model = object_model_with_arg_and_args_properties.ObjectModelWithArgAndArgsProperties( - arg='a', args='as') + model = object_model_with_arg_and_args_properties.ObjectModelWithArgAndArgsProperties({ + 'arg': 'a', 'args': 'as' + }) origin_cls = typing_extensions.get_origin(object_model_with_arg_and_args_properties.Arg) assert origin_cls is not None self.assertTrue( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py index 70aec76cce4..5c0c85716aa 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_model_with_ref_props.py @@ -30,7 +30,7 @@ def tearDown(self): def testObjectModelWithRefProps(self): """Test ObjectModelWithRefProps""" - inst = object_model_with_ref_props.ObjectModelWithRefProps(myNumber=15.0, myString="a", myBoolean=True) + inst = object_model_with_ref_props.ObjectModelWithRefProps({'myNumber': 15.0, 'myString': "a", 'myBoolean': True}) assert isinstance(inst, object_model_with_ref_props.ObjectModelWithRefProps) assert isinstance(inst, frozendict.frozendict) assert set(inst.keys()) == {"myNumber", "myString", "myBoolean"} diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py index 3974f926724..b5fdbcbc657 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_all_of_with_req_test_prop_from_unset_add_prop.py @@ -11,7 +11,7 @@ import unittest -import petstore_api +from petstore_api import exceptions from petstore_api.components.schema.object_with_all_of_with_req_test_prop_from_unset_add_prop import ObjectWithAllOfWithReqTestPropFromUnsetAddProp @@ -19,16 +19,16 @@ class TestObjectWithAllOfWithReqTestPropFromUnsetAddProp(unittest.TestCase): """ObjectWithAllOfWithReqTestPropFromUnsetAddProp unit test stubs""" def test_model_instantiation(self): - inst = ObjectWithAllOfWithReqTestPropFromUnsetAddProp( - test='a' - ) + inst = ObjectWithAllOfWithReqTestPropFromUnsetAddProp({ + 'test': 'a' + }) assert inst == {'test': 'a'} # without the required test property an execption is thrown - with self.assertRaises(petstore_api.exceptions.ApiTypeError): - ObjectWithAllOfWithReqTestPropFromUnsetAddProp( - name='a' - ) + with self.assertRaises(exceptions.ApiTypeError): + ObjectWithAllOfWithReqTestPropFromUnsetAddProp({ + 'name': 'a' + }) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py index 29cc38f238a..63727e55773 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_difficultly_named_props.py @@ -10,10 +10,8 @@ """ -import sys import unittest -import petstore_api from petstore_api.components.schema.object_with_difficultly_named_props import ObjectWithDifficultlyNamedProps @@ -28,9 +26,13 @@ def tearDown(self): def test_ObjectWithDifficultlyNamedProps(self): """Test ObjectWithDifficultlyNamedProps""" - # FIXME: construct object with mandatory attributes with example values - # model = ObjectWithDifficultlyNamedProps() # noqa: E501 - pass + arg = { + "$special[property.name]": 1, + "123-list": 'a', + "123Number": 3, + } + model = ObjectWithDifficultlyNamedProps(arg) + assert model == arg if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py index f33add17d91..8717fd17a41 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_inline_composition_property.py @@ -20,7 +20,7 @@ class TestObjectWithInlineCompositionProperty(unittest.TestCase): def test_ObjectWithInlineCompositionProperty(self): """Test ObjectWithInlineCompositionProperty""" - model = object_with_inline_composition_property.ObjectWithInlineCompositionProperty(someProp='a') + model = object_with_inline_composition_property.ObjectWithInlineCompositionProperty({'someProp': 'a'}) self.assertTrue( isinstance( model["someProp"], @@ -31,7 +31,7 @@ def test_ObjectWithInlineCompositionProperty(self): # error thrown on length < 1 with self.assertRaises(exceptions.ApiValueError): - object_with_inline_composition_property.ObjectWithInlineCompositionProperty(someProp='') + object_with_inline_composition_property.ObjectWithInlineCompositionProperty({'someProp': ''}) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py index ae7173aec09..8027276c190 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_invalid_named_refed_properties.py @@ -11,7 +11,7 @@ import unittest -import petstore_api +from petstore_api import exceptions from petstore_api.components.schema.object_with_invalid_named_refed_properties import ObjectWithInvalidNamedRefedProperties from petstore_api.components.schema.array_with_validations_in_items import ArrayWithValidationsInItems from petstore_api.components.schema.from_schema import FromSchema @@ -24,49 +24,48 @@ def test_instantiation_success(self): array_value = ArrayWithValidationsInItems( [4, 5] ) - from_value = FromSchema(data='abc', id=1) + from_value = FromSchema({'data': 'abc', 'id': 1}) kwargs = { 'from': from_value, '!reference': array_value } # __new__ creation works inst = ObjectWithInvalidNamedRefedProperties( - **kwargs + kwargs ) primitive_data = { 'from': {'data': 'abc', 'id': 1}, '!reference': (4, 5) } assert inst == primitive_data - # from_openapi_data_ works - inst = ObjectWithInvalidNamedRefedProperties.from_openapi_data_(primitive_data) + inst = ObjectWithInvalidNamedRefedProperties(primitive_data) assert inst == primitive_data def test_omitting_required_properties_fails(self): array_value = ArrayWithValidationsInItems( [4, 5] ) - from_value = FromSchema(data='abc', id=1) - with self.assertRaises(petstore_api.exceptions.ApiTypeError): + from_value = FromSchema({'data': 'abc', 'id': 1}) + with self.assertRaises(exceptions.ApiTypeError): ObjectWithInvalidNamedRefedProperties( - **{ + { 'from': from_value, } ) - with self.assertRaises(petstore_api.exceptions.ApiTypeError): + with self.assertRaises(exceptions.ApiTypeError): ObjectWithInvalidNamedRefedProperties( - **{ + { '!reference': array_value } ) - with self.assertRaises(petstore_api.exceptions.ApiTypeError): - ObjectWithInvalidNamedRefedProperties.from_openapi_data_( + with self.assertRaises(exceptions.ApiTypeError): + ObjectWithInvalidNamedRefedProperties( { 'from': {'data': 'abc', 'id': 1}, } ) - with self.assertRaises(petstore_api.exceptions.ApiTypeError): - ObjectWithInvalidNamedRefedProperties.from_openapi_data_( + with self.assertRaises(exceptions.ApiTypeError): + ObjectWithInvalidNamedRefedProperties( { '!reference': [4, 5] } diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py index 8e1b48d0c83..7a774644d00 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_object_with_validations.py @@ -41,11 +41,11 @@ def test_ObjectWithValidations(self): r"Invalid value `frozendict.frozendict\({'a': 'a'}\)`, number of properties must be greater than or equal to `2` at \('args\[0\]',\)" ): # number of properties less than 2 fails - model = ObjectWithValidations(a='a') + model = ObjectWithValidations({'a': 'a'}) # 2 or more properties succeeds - model = ObjectWithValidations(a='a', b='b') - model = ObjectWithValidations(a='a', b='b', c='c') + model = ObjectWithValidations({'a': 'a', 'b': 'b'}) + model = ObjectWithValidations({'a': 'a', 'b': 'b', 'c': 'c'}) if __name__ == '__main__': diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py index 13c78a84610..37862808677 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parameters.py @@ -9,7 +9,6 @@ Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator """ import unittest -import collections from petstore_api import api_client, exceptions, schemas diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py index f45984f4446..7decc984d69 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_parent_pet.py @@ -10,10 +10,8 @@ """ -import sys import unittest -import petstore_api from petstore_api.components.schema.grandparent_animal import GrandparentAnimal from petstore_api.components.schema.parent_pet import ParentPet @@ -33,7 +31,7 @@ def testParentPet(self): # test that we can make a ParentPet from a ParentPet # which requires that we travel back through ParentPet's allOf descendant # GrandparentAnimal, and we use the descendant's discriminator to make ParentPet - model = ParentPet(pet_type="ParentPet") + model = ParentPet({'pet_type': "ParentPet"}) assert isinstance(model, ParentPet) assert isinstance(model, GrandparentAnimal) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_pet.py b/samples/openapi3/client/petstore/python/tests_manual/test_pet.py index 45c0e2ded1a..bb816767851 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_pet.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_pet.py @@ -20,8 +20,8 @@ class TesttPet(unittest.TestCase): """ParentPet unit test stubs""" def testPet(self): - cat = category.Category(name='hi', addprop={'a': 1}) - inst = pet.Pet(photoUrls=[], name='Katsu', category=cat) + cat = category.Category({'name': 'hi', 'addprop': {'a': 1}}) + inst = pet.Pet({'photoUrls': [], 'name': 'Katsu', 'category': cat}) self.assertEqual( inst, { diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py index ba042e060aa..3551ed301c2 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_quadrilateral.py @@ -30,9 +30,9 @@ def tearDown(self): def testQuadrilateral(self): """Test Quadrilateral""" - instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="ComplexQuadrilateral") + instance = Quadrilateral({'shapeType': "Quadrilateral", 'quadrilateralType': "ComplexQuadrilateral"}) assert isinstance(instance, complex_quadrilateral.ComplexQuadrilateral) - instance = Quadrilateral(shapeType="Quadrilateral", quadrilateralType="SimpleQuadrilateral") + instance = Quadrilateral({'shapeType': "Quadrilateral", 'quadrilateralType': "SimpleQuadrilateral"}) assert isinstance(instance, simple_quadrilateral.SimpleQuadrilateral) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py index 4fe8834443f..c71aaf84a48 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_self_referencing_object_model.py @@ -18,10 +18,10 @@ class TestSelfReferencingObjectModel(unittest.TestCase): """SelfReferencingObjectModel unit test stubs""" def test_instantiation(self): - inst = SelfReferencingObjectModel( - selfRef=SelfReferencingObjectModel({}), - someAddProp=SelfReferencingObjectModel({}) - ) + inst = SelfReferencingObjectModel({ + 'selfRef': SelfReferencingObjectModel({}), + 'someAddProp': SelfReferencingObjectModel({}) + }) assert inst == { 'selfRef': {}, 'someAddProp': {} @@ -38,7 +38,7 @@ def test_instantiation(self): # error when wrong type passed in with self.assertRaises(petstore_api.ApiTypeError): for invalid_type_kwarg in invalid_type_kwargs: - SelfReferencingObjectModel(**invalid_type_kwarg) + SelfReferencingObjectModel(invalid_type_kwarg) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py index 13f692fd6f0..b9df1397db1 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_shape.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_shape.py @@ -45,10 +45,10 @@ def test_recursionlimit(self): def testShape(self): """Test Shape""" - tri = Shape( - shapeType="Triangle", - triangleType="EquilateralTriangle" - ) + tri = Shape({ + 'shapeType': "Triangle", + 'triangleType': "EquilateralTriangle" + }) assert isinstance(tri, equilateral_triangle.EquilateralTriangle) assert isinstance(tri, triangle.Triangle) assert isinstance(tri, triangle_interface.TriangleInterface) @@ -57,28 +57,28 @@ def testShape(self): assert isinstance(tri.shapeType, str) assert isinstance(tri.shapeType, Singleton) - tri = Shape( - shapeType="Triangle", - triangleType="IsoscelesTriangle" - ) + tri = Shape({ + 'shapeType': "Triangle", + 'triangleType': "IsoscelesTriangle" + }) assert isinstance(tri, isosceles_triangle.IsoscelesTriangle) - tri = Shape( - shapeType="Triangle", - triangleType="ScaleneTriangle" - ) + tri = Shape({ + 'shapeType': "Triangle", + 'triangleType': "ScaleneTriangle" + }) assert isinstance(tri, scalene_triangle.ScaleneTriangle) - quad = Shape( - shapeType="Quadrilateral", - quadrilateralType="ComplexQuadrilateral" - ) + quad = Shape({ + 'shapeType': "Quadrilateral", + 'quadrilateralType': "ComplexQuadrilateral" + }) assert isinstance(quad, complex_quadrilateral.ComplexQuadrilateral) - quad = Shape( - shapeType="Quadrilateral", - quadrilateralType="SimpleQuadrilateral" - ) + quad = Shape({ + 'shapeType': "Quadrilateral", + 'quadrilateralType': "SimpleQuadrilateral" + }) assert isinstance(quad, simple_quadrilateral.SimpleQuadrilateral) # data missing @@ -98,7 +98,7 @@ def testShape(self): petstore_api.ApiValueError, err_msg ): - Shape(shapeType="Circle") + Shape({'shapeType': "Circle"}) # invalid quadrilateral_type (second discriminator) err_msg = ( @@ -109,10 +109,10 @@ def testShape(self): petstore_api.ApiValueError, err_msg ): - Shape( - shapeType="Quadrilateral", - quadrilateralType="Triangle" - ) + Shape({ + 'shapeType': "Quadrilateral", + 'quadrilateralType': "Triangle" + }) if __name__ == '__main__': unittest.main() diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py index 5cc16d943fb..1979dcb0ff3 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_triangle.py @@ -28,7 +28,7 @@ def testTriangle(self): """Test Triangle""" tri_classes = [EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle] for tri_class in tri_classes: - tri = Triangle(shapeType="Triangle", triangleType=tri_class.__name__) + tri = Triangle({'shapeType': "Triangle", 'triangleType': tri_class.__name__}) assert isinstance(tri, tri_class) assert isinstance(tri, Triangle) assert isinstance(tri, TriangleInterface) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py b/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py index ef344b29859..556c96b9b99 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_user_api.py @@ -64,7 +64,7 @@ def test_get_user_by_name(self): firstName='first', lastName='last' ) - body = user.User(**value_simple) + body = user.User(value_simple) mock_request.return_value = self.response( self.json_bytes(value_simple) ) diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_validate.py b/samples/openapi3/client/petstore/python/tests_manual/test_validate.py index a4893386098..a760e584204 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_validate.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_validate.py @@ -150,7 +150,7 @@ def test_empty_list_validate(self): with patch.object( Schema, "_validate", return_value=return_value ) as mock_validate: - array_holding_any_type.ArrayHoldingAnyType.from_openapi_data_([]) + array_holding_any_type.ArrayHoldingAnyType([]) assert mock_validate.call_count == 1 def test_empty_dict_validate(self): @@ -164,7 +164,7 @@ def test_empty_dict_validate(self): with patch.object( Schema, "_validate", return_value=return_value ) as mock_validate: - Foo.from_openapi_data_({}) + Foo({}) assert mock_validate.call_count == 1 def test_list_validate_direct_instantiation(self): @@ -179,7 +179,7 @@ def test_list_validate_direct_instantiation(self): side_effect=array_with_validations_in_items.Items._validate, ) as mock_inner_validate: used_configuration = schema_configuration.SchemaConfiguration() - array_with_validations_in_items.ArrayWithValidationsInItems([7], configuration_=used_configuration) + array_with_validations_in_items.ArrayWithValidationsInItems([7], configuration=used_configuration) mock_outer_validate.assert_called_once_with( (Decimal("7"),), validation_metadata=ValidationMetadata(path_to_item=("args[0]",), configuration=used_configuration) @@ -203,7 +203,7 @@ def test_list_validate_direct_instantiation_cast_item(self): side_effect=array_with_validations_in_items.Items._validate, ) as mock_inner_validate: used_configuration = schema_configuration.SchemaConfiguration() - array_with_validations_in_items.ArrayWithValidationsInItems([item], configuration_=used_configuration) + array_with_validations_in_items.ArrayWithValidationsInItems([item], configuration=used_configuration) mock_outer_validate.assert_called_once_with( tuple([Decimal('7')]), validation_metadata=ValidationMetadata( @@ -226,7 +226,7 @@ def test_list_validate_from_openai_data_instantiation(self): side_effect=array_with_validations_in_items.Items._validate, ) as mock_inner_validate: used_configuration = schema_configuration.SchemaConfiguration() - array_with_validations_in_items.ArrayWithValidationsInItems.from_openapi_data_([7], configuration_=used_configuration) + array_with_validations_in_items.ArrayWithValidationsInItems([7], configuration=used_configuration) mock_outer_validate.assert_called_once_with( (Decimal("7"),), validation_metadata=ValidationMetadata(path_to_item=("args[0]",), configuration=used_configuration) @@ -244,7 +244,7 @@ def test_dict_validate_direct_instantiation(self): side_effect=Bar._validate, ) as mock_inner_validate: used_configuration = schema_configuration.SchemaConfiguration() - Foo(bar="a", configuration_=used_configuration) + Foo({'bar': "a"}, configuration=used_configuration) mock_outer_validate.assert_called_once_with( frozendict.frozendict({"bar": "a"}), validation_metadata=ValidationMetadata( @@ -270,7 +270,7 @@ def test_dict_validate_direct_instantiation_cast_item(self): "_validate", side_effect=Bar._validate, ) as mock_inner_validate: - Foo(bar=bar, configuration_=used_configuration) + Foo({'bar': bar}, configuration=used_configuration) mock_outer_validate.assert_called_once_with( frozendict.frozendict(dict(bar='a')), validation_metadata=ValidationMetadata( @@ -281,7 +281,7 @@ def test_dict_validate_direct_instantiation_cast_item(self): ) mock_inner_validate.assert_not_called() - def test_dict_validate_from_openapi_data_instantiation(self): + def test_dict_validate_instantiation_non_class_inst_data(self): with patch.object(Foo, "_validate", side_effect=Foo._validate) as mock_outer_validate: with patch.object( Bar, @@ -289,7 +289,7 @@ def test_dict_validate_from_openapi_data_instantiation(self): side_effect=Bar._validate, ) as mock_inner_validate: used_configuration = schema_configuration.SchemaConfiguration() - Foo.from_openapi_data_({"bar": "a"}, configuration_=used_configuration) + Foo({"bar": "a"}, configuration=used_configuration) mock_outer_validate.assert_called_once_with( frozendict.frozendict({"bar": "a"}), validation_metadata=ValidationMetadata( diff --git a/samples/openapi3/client/petstore/python/tests_manual/test_whale.py b/samples/openapi3/client/petstore/python/tests_manual/test_whale.py index 8edf79adfe2..1f8433ead7b 100644 --- a/samples/openapi3/client/petstore/python/tests_manual/test_whale.py +++ b/samples/openapi3/client/petstore/python/tests_manual/test_whale.py @@ -21,18 +21,18 @@ class TestWhale(unittest.TestCase): def test_Whale(self): # test that the hasBaleen __bool__ method is working, True input - whale = Whale( - className='whale', - hasBaleen=True - ) + whale = Whale({ + 'className': 'whale', + 'hasBaleen': True + }) assert isinstance(whale["hasBaleen"], BoolClass) self.assertTrue(whale["hasBaleen"]) # test that the hasBaleen __bool__ method is working, False input - whale = Whale( - className='whale', - hasBaleen=False - ) + whale = Whale({ + 'className': 'whale', + 'hasBaleen': False + }) assert isinstance(whale["hasBaleen"], BoolClass) self.assertFalse(whale["hasBaleen"])