forked from loafle/openapi-generator-original
[python-experimental] improves type hints for arrays, and object required properties (#13299)
* Regenerates sample with additional enum values * Sample regenerated, array type hints working * Unit test sample regenerated * Removes unneeded __getattribute__ * Sample regenerated using getRequiredVarsMap for property type hints * Adds schemaFromAdditionalProperties to tell if a CodegenProperty is from properties or additionalProperties * Adds get/setSchemaIsFromAdditionalProperties * Updates codegenModel * Updates codegenParameter * Updates codegenResponse * Uses setSchemaIsFromAdditionalProperties * Fixes array new typ ehint and additional property type hints * Samples regenerated * Adds missing parms to javadoc * Fixes param name * Adds missing param to javadoc
This commit is contained in:
parent
b55fa261f3
commit
d97081e7dc
@ -111,6 +111,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
private CodegenComposedSchemas composedSchemas;
|
private CodegenComposedSchemas composedSchemas;
|
||||||
private boolean hasMultipleTypes = false;
|
private boolean hasMultipleTypes = false;
|
||||||
public HashMap<String, SchemaTestCase> testCases = new HashMap<>();
|
public HashMap<String, SchemaTestCase> testCases = new HashMap<>();
|
||||||
|
private boolean schemaIsFromAdditionalProperties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of the value for the additionalProperties keyword in the OAS document.
|
* The type of the value for the additionalProperties keyword in the OAS document.
|
||||||
@ -186,6 +187,16 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
this.ref = ref;
|
this.ref = ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getSchemaIsFromAdditionalProperties() {
|
||||||
|
return schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
|
||||||
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
public Set<String> getAllMandatory() {
|
public Set<String> getAllMandatory() {
|
||||||
return allMandatory;
|
return allMandatory;
|
||||||
}
|
}
|
||||||
@ -946,6 +957,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
hasMultipleTypes == that.getHasMultipleTypes() &&
|
hasMultipleTypes == that.getHasMultipleTypes() &&
|
||||||
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
||||||
isUuid == that.getIsUuid() &&
|
isUuid == that.getIsUuid() &&
|
||||||
|
getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() &&
|
||||||
getIsAnyType() == that.getIsAnyType() &&
|
getIsAnyType() == that.getIsAnyType() &&
|
||||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||||
getUniqueItems() == that.getUniqueItems() &&
|
getUniqueItems() == that.getUniqueItems() &&
|
||||||
@ -1027,7 +1039,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
|
getMaximum(), getPattern(), getMultipleOf(), getItems(), getAdditionalProperties(), getIsModel(),
|
||||||
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
|
getAdditionalPropertiesIsAnyType(), hasDiscriminatorWithNonEmptyMapping,
|
||||||
isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid, requiredVarsMap, ref,
|
isAnyType, getComposedSchemas(), hasMultipleTypes, isDecimal, isUuid, requiredVarsMap, ref,
|
||||||
uniqueItemsBoolean);
|
uniqueItemsBoolean, schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -1127,6 +1139,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
|
|||||||
sb.append(", isUUID=").append(isUuid);
|
sb.append(", isUUID=").append(isUuid);
|
||||||
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
||||||
sb.append(", ref=").append(ref);
|
sb.append(", ref=").append(ref);
|
||||||
|
sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties);
|
||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -115,6 +115,8 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
|
|
||||||
|
private boolean schemaIsFromAdditionalProperties;
|
||||||
|
|
||||||
public CodegenParameter copy() {
|
public CodegenParameter copy() {
|
||||||
CodegenParameter output = new CodegenParameter();
|
CodegenParameter output = new CodegenParameter();
|
||||||
output.isFile = this.isFile;
|
output.isFile = this.isFile;
|
||||||
@ -167,6 +169,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
output.setHasRequired(this.hasRequired);
|
output.setHasRequired(this.hasRequired);
|
||||||
output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping);
|
output.setHasDiscriminatorWithNonEmptyMapping(this.hasDiscriminatorWithNonEmptyMapping);
|
||||||
output.setHasMultipleTypes(this.hasMultipleTypes);
|
output.setHasMultipleTypes(this.hasMultipleTypes);
|
||||||
|
output.setSchemaIsFromAdditionalProperties(this.schemaIsFromAdditionalProperties);
|
||||||
|
|
||||||
if (this.content != null) {
|
if (this.content != null) {
|
||||||
output.setContent(this.content);
|
output.setContent(this.content);
|
||||||
@ -240,7 +243,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean);
|
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, isContainer, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, isDeepObject, isAllowEmptyValue, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vars, requiredVars, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, isDeprecated, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired, isShort, isUnboundedInteger, hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, schema, content, requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -291,6 +294,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
||||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||||
hasMultipleTypes == that.getHasMultipleTypes() &&
|
hasMultipleTypes == that.getHasMultipleTypes() &&
|
||||||
|
getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() &&
|
||||||
getHasVars() == that.getHasVars() &&
|
getHasVars() == that.getHasVars() &&
|
||||||
getHasRequired() == that.getHasRequired() &&
|
getHasRequired() == that.getHasRequired() &&
|
||||||
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
getExclusiveMaximum() == that.getExclusiveMaximum() &&
|
||||||
@ -431,6 +435,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
sb.append(", content=").append(content);
|
sb.append(", content=").append(content);
|
||||||
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
||||||
sb.append(", ref=").append(ref);
|
sb.append(", ref=").append(ref);
|
||||||
|
sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties);
|
||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@ -853,5 +858,15 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRef(String ref) { this.ref=ref; }
|
public void setRef(String ref) { this.ref=ref; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getSchemaIsFromAdditionalProperties() {
|
||||||
|
return schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
|
||||||
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,6 +197,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
private boolean hasMultipleTypes = false;
|
private boolean hasMultipleTypes = false;
|
||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
|
private boolean schemaIsFromAdditionalProperties;
|
||||||
|
|
||||||
public String getBaseName() {
|
public String getBaseName() {
|
||||||
return baseName;
|
return baseName;
|
||||||
@ -344,6 +345,16 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
this.unescapedDescription = unescapedDescription;
|
this.unescapedDescription = unescapedDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getSchemaIsFromAdditionalProperties() {
|
||||||
|
return schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
|
||||||
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer getMaxLength() {
|
public Integer getMaxLength() {
|
||||||
return maxLength;
|
return maxLength;
|
||||||
@ -1004,6 +1015,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
|
sb.append(", hasMultipleTypes=").append(hasMultipleTypes);
|
||||||
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
||||||
sb.append(", ref=").append(ref);
|
sb.append(", ref=").append(ref);
|
||||||
|
sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties);
|
||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@ -1059,6 +1071,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
isNull == that.isNull &&
|
isNull == that.isNull &&
|
||||||
hasMultipleTypes == that.getHasMultipleTypes() &&
|
hasMultipleTypes == that.getHasMultipleTypes() &&
|
||||||
hasDiscriminatorWithNonEmptyMapping == that.hasDiscriminatorWithNonEmptyMapping &&
|
hasDiscriminatorWithNonEmptyMapping == that.hasDiscriminatorWithNonEmptyMapping &&
|
||||||
|
getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() &&
|
||||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||||
getHasVars() == that.getHasVars() &&
|
getHasVars() == that.getHasVars() &&
|
||||||
getHasRequired() == that.getHasRequired() &&
|
getHasRequired() == that.getHasRequired() &&
|
||||||
@ -1129,6 +1142,6 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
|||||||
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
|
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName,
|
||||||
xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
xmlNamespace, isXmlWrapped, isNull, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
||||||
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap,
|
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, requiredVarsMap,
|
||||||
ref, uniqueItemsBoolean);
|
ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
private LinkedHashMap<String, CodegenMediaType> content;
|
private LinkedHashMap<String, CodegenMediaType> content;
|
||||||
private Map<String, CodegenProperty> requiredVarsMap;
|
private Map<String, CodegenProperty> requiredVarsMap;
|
||||||
private String ref;
|
private String ref;
|
||||||
|
private boolean schemaIsFromAdditionalProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
@ -104,7 +105,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
|
getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(),
|
||||||
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired,
|
||||||
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content,
|
hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content,
|
||||||
requiredVarsMap, ref,uniqueItemsBoolean);
|
requiredVarsMap, ref, uniqueItemsBoolean, schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -150,6 +151,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
is5xx == that.is5xx &&
|
is5xx == that.is5xx &&
|
||||||
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
hasDiscriminatorWithNonEmptyMapping == that.getHasDiscriminatorWithNonEmptyMapping() &&
|
||||||
hasMultipleTypes == that.getHasMultipleTypes() &&
|
hasMultipleTypes == that.getHasMultipleTypes() &&
|
||||||
|
getSchemaIsFromAdditionalProperties() == that.getSchemaIsFromAdditionalProperties() &&
|
||||||
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() &&
|
||||||
getHasVars() == that.getHasVars() &&
|
getHasVars() == that.getHasVars() &&
|
||||||
getHasRequired() == that.getHasRequired() &&
|
getHasRequired() == that.getHasRequired() &&
|
||||||
@ -559,6 +561,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
sb.append(", content=").append(content);
|
sb.append(", content=").append(content);
|
||||||
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
sb.append(", requiredVarsMap=").append(requiredVarsMap);
|
||||||
sb.append(", ref=").append(ref);
|
sb.append(", ref=").append(ref);
|
||||||
|
sb.append(", schemaIsFromAdditionalProperties=").append(schemaIsFromAdditionalProperties);
|
||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@ -698,4 +701,14 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRef(String ref) { this.ref=ref; }
|
public void setRef(String ref) { this.ref=ref; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getSchemaIsFromAdditionalProperties() {
|
||||||
|
return schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties) {
|
||||||
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2470,15 +2470,17 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static class NamedSchema {
|
private static class NamedSchema {
|
||||||
private NamedSchema(String name, Schema s, boolean required) {
|
private NamedSchema(String name, Schema s, boolean required, boolean schemaIsFromAdditionalProperties) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.schema = s;
|
this.schema = s;
|
||||||
this.required = required;
|
this.required = required;
|
||||||
|
this.schemaIsFromAdditionalProperties = schemaIsFromAdditionalProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private Schema schema;
|
private Schema schema;
|
||||||
private boolean required;
|
private boolean required;
|
||||||
|
private boolean schemaIsFromAdditionalProperties;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
@ -2487,12 +2489,13 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
NamedSchema that = (NamedSchema) o;
|
NamedSchema that = (NamedSchema) o;
|
||||||
return Objects.equals(required, that.required) &&
|
return Objects.equals(required, that.required) &&
|
||||||
Objects.equals(name, that.name) &&
|
Objects.equals(name, that.name) &&
|
||||||
Objects.equals(schema, that.schema);
|
Objects.equals(schema, that.schema) &&
|
||||||
|
Objects.equals(schemaIsFromAdditionalProperties, that.schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return Objects.hash(name, schema, required);
|
return Objects.hash(name, schema, required, schemaIsFromAdditionalProperties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3563,6 +3566,21 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
property.pattern = toRegularExpression(p.getPattern());
|
property.pattern = toRegularExpression(p.getPattern());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO remove this in 7.0.0 as a breaking change
|
||||||
|
* This method was kept when required was added to the fromProperty signature
|
||||||
|
* to ensure that the change was non-breaking
|
||||||
|
*
|
||||||
|
* @param name name of the property
|
||||||
|
* @param p OAS property schema
|
||||||
|
* @param required true if the property is required in the next higher object schema, false otherwise
|
||||||
|
* @return Codegen Property object
|
||||||
|
*/
|
||||||
|
public CodegenProperty fromProperty(String name, Schema p, boolean required) {
|
||||||
|
return fromProperty(name, p, required, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO remove this in 7.0.0 as a breaking change
|
* TODO remove this in 7.0.0 as a breaking change
|
||||||
* This method was kept when required was added to the fromProperty signature
|
* This method was kept when required was added to the fromProperty signature
|
||||||
@ -3573,7 +3591,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
* @return Codegen Property object
|
* @return Codegen Property object
|
||||||
*/
|
*/
|
||||||
public CodegenProperty fromProperty(String name, Schema p) {
|
public CodegenProperty fromProperty(String name, Schema p) {
|
||||||
return fromProperty(name, p, false);
|
return fromProperty(name, p, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3588,15 +3606,16 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
* @param name name of the property
|
* @param name name of the property
|
||||||
* @param p OAS property schema
|
* @param p OAS property schema
|
||||||
* @param required true if the property is required in the next higher object schema, false otherwise
|
* @param required true if the property is required in the next higher object schema, false otherwise
|
||||||
|
* @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema
|
||||||
* @return Codegen Property object
|
* @return Codegen Property object
|
||||||
*/
|
*/
|
||||||
public CodegenProperty fromProperty(String name, Schema p, boolean required) {
|
public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) {
|
||||||
if (p == null) {
|
if (p == null) {
|
||||||
LOGGER.error("Undefined property/schema for `{}`. Default to type:string.", name);
|
LOGGER.error("Undefined property/schema for `{}`. Default to type:string.", name);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
LOGGER.debug("debugging fromProperty for {} : {}", name, p);
|
LOGGER.debug("debugging fromProperty for {} : {}", name, p);
|
||||||
NamedSchema ns = new NamedSchema(name, p, required);
|
NamedSchema ns = new NamedSchema(name, p, required, schemaIsFromAdditionalProperties);
|
||||||
CodegenProperty cpc = schemaCodegenPropertyCache.get(ns);
|
CodegenProperty cpc = schemaCodegenPropertyCache.get(ns);
|
||||||
if (cpc != null) {
|
if (cpc != null) {
|
||||||
LOGGER.debug("Cached fromProperty for {} : {} required={}", name, p.getName(), required);
|
LOGGER.debug("Cached fromProperty for {} : {} required={}", name, p.getName(), required);
|
||||||
@ -3606,6 +3625,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
p = unaliasSchema(p);
|
p = unaliasSchema(p);
|
||||||
|
|
||||||
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
|
CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
|
||||||
|
property.setSchemaIsFromAdditionalProperties(schemaIsFromAdditionalProperties);
|
||||||
property.required = required;
|
property.required = required;
|
||||||
ModelUtils.syncValidationProperties(p, property);
|
ModelUtils.syncValidationProperties(p, property);
|
||||||
|
|
||||||
@ -7220,6 +7240,7 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
if (cp.baseName.equals(requiredPropertyName)) {
|
if (cp.baseName.equals(requiredPropertyName)) {
|
||||||
found = true;
|
found = true;
|
||||||
requiredVarsMap.put(requiredPropertyName, cp);
|
requiredVarsMap.put(requiredPropertyName, cp);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found == false) {
|
if (found == false) {
|
||||||
@ -7238,12 +7259,14 @@ public class DefaultCodegen implements CodegenConfig {
|
|||||||
}
|
}
|
||||||
CodegenProperty cp;
|
CodegenProperty cp;
|
||||||
if (schema.getAdditionalProperties() == null) {
|
if (schema.getAdditionalProperties() == null) {
|
||||||
cp = fromProperty(usedRequiredPropertyName, new Schema(), true);
|
// additionalProperties is null
|
||||||
|
cp = fromProperty(usedRequiredPropertyName, new Schema(), true, true);
|
||||||
} else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.TRUE.equals(schema.getAdditionalProperties())) {
|
} else if (schema.getAdditionalProperties() instanceof Boolean && Boolean.TRUE.equals(schema.getAdditionalProperties())) {
|
||||||
cp = fromProperty(requiredPropertyName, new Schema(), true);
|
// additionalProperties is True
|
||||||
|
cp = fromProperty(requiredPropertyName, new Schema(), true, true);
|
||||||
} else {
|
} else {
|
||||||
CodegenProperty addPropsProp = property.getAdditionalProperties();
|
// additionalProperties is schema
|
||||||
cp = addPropsProp;
|
cp = fromProperty(requiredPropertyName, (Schema) schema.getAdditionalProperties(), true, true);
|
||||||
}
|
}
|
||||||
requiredVarsMap.put(usedRequiredPropertyName, cp);
|
requiredVarsMap.put(usedRequiredPropertyName, cp);
|
||||||
}
|
}
|
||||||
|
@ -188,6 +188,10 @@ public interface IJsonSchemaValidationProperties {
|
|||||||
|
|
||||||
void setHasMultipleTypes(boolean hasMultipleTypes);
|
void setHasMultipleTypes(boolean hasMultipleTypes);
|
||||||
|
|
||||||
|
boolean getSchemaIsFromAdditionalProperties();
|
||||||
|
|
||||||
|
void setSchemaIsFromAdditionalProperties(boolean schemaIsFromAdditionalProperties);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Syncs all the schema's type properties into the IJsonSchemaValidationProperties instance
|
* Syncs all the schema's type properties into the IJsonSchemaValidationProperties instance
|
||||||
* for now this only supports types without format information
|
* for now this only supports types without format information
|
||||||
|
@ -989,12 +989,14 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
|||||||
* This method is used by fromResponse
|
* This method is used by fromResponse
|
||||||
*
|
*
|
||||||
* @param name name of the property
|
* @param name name of the property
|
||||||
* @param p OAS property object
|
* @param p OAS property schema
|
||||||
|
* @param required true if the property is required in the next higher object schema, false otherwise
|
||||||
|
* @param schemaIsFromAdditionalProperties true if the property is defined by additional properties schema
|
||||||
* @return Codegen Property object
|
* @return Codegen Property object
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CodegenProperty fromProperty(String name, Schema p, boolean required) {
|
public CodegenProperty fromProperty(String name, Schema p, boolean required, boolean schemaIsFromAdditionalProperties) {
|
||||||
CodegenProperty cp = super.fromProperty(name, p, required);
|
CodegenProperty cp = super.fromProperty(name, p, required, schemaIsFromAdditionalProperties);
|
||||||
|
|
||||||
if (cp.isAnyType && cp.isNullable) {
|
if (cp.isAnyType && cp.isNullable) {
|
||||||
cp.isNullable = false;
|
cp.isNullable = false;
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}
|
@ -1,6 +1,14 @@
|
|||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
{{#if getHasMultipleTypes}}
|
||||||
*args: typing.Union[{{> model_templates/schema_python_types }}],
|
*args: typing.Union[{{> model_templates/schema_python_types }}],
|
||||||
|
{{else}}
|
||||||
|
{{#if isArray }}
|
||||||
|
arg: typing.Union[typing.Tuple[{{#with items}}{{#if complexType}}'{{complexType}}'{{else}}typing.Union[MetaOapg.{{baseName}}, {{> model_templates/schema_python_types }}]{{/if}}{{/with}}], typing.List[{{#with items}}{{#if complexType}}'{{complexType}}'{{else}}typing.Union[MetaOapg.{{baseName}}, {{> model_templates/schema_python_types }}]{{/if}}{{/with}}]],
|
||||||
|
{{else}}
|
||||||
|
*args: typing.Union[{{> model_templates/schema_python_types }}],
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{#unless isNull}}
|
{{#unless isNull}}
|
||||||
{{#if getHasRequired}}
|
{{#if getHasRequired}}
|
||||||
{{#each getRequiredVarsMap}}
|
{{#each getRequiredVarsMap}}
|
||||||
@ -35,10 +43,18 @@ def __new__(
|
|||||||
**kwargs: typing.Union[MetaOapg.additional_properties, {{> model_templates/schema_python_types }}],
|
**kwargs: typing.Union[MetaOapg.additional_properties, {{> model_templates/schema_python_types }}],
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
) -> '{{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}':
|
) -> '{{> model_templates/classname }}':
|
||||||
return super().__new__(
|
return super().__new__(
|
||||||
cls,
|
cls,
|
||||||
|
{{#if getHasMultipleTypes}}
|
||||||
*args,
|
*args,
|
||||||
|
{{else}}
|
||||||
|
{{#if isArray }}
|
||||||
|
arg,
|
||||||
|
{{else}}
|
||||||
|
*args,
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
{{#unless isNull}}
|
{{#unless isNull}}
|
||||||
{{#if getHasRequired}}
|
{{#if getHasRequired}}
|
||||||
{{#each getRequiredVarsMap}}
|
{{#each getRequiredVarsMap}}
|
||||||
|
@ -1,6 +1,26 @@
|
|||||||
{{#if vars}}
|
{{#or getRequiredVarsMap vars}}
|
||||||
|
|
||||||
|
{{/or}}
|
||||||
|
{{#if getRequiredVarsMap}}
|
||||||
|
{{#each getRequiredVarsMap}}
|
||||||
|
{{#with this}}
|
||||||
|
{{#unless nameInSnakeCase}}
|
||||||
|
{{#if complexType}}
|
||||||
|
{{baseName}}: '{{complexType}}'
|
||||||
|
{{else}}
|
||||||
|
{{#if schemaIsFromAdditionalProperties}}
|
||||||
|
{{baseName}}: MetaOapg.additional_properties
|
||||||
|
{{else}}
|
||||||
|
{{baseName}}: MetaOapg.properties.{{baseName}}
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{/unless}}
|
||||||
|
{{/with}}
|
||||||
|
{{/each}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if vars}}
|
||||||
{{#each vars}}
|
{{#each vars}}
|
||||||
|
{{#unless required}}
|
||||||
{{#unless nameInSnakeCase}}
|
{{#unless nameInSnakeCase}}
|
||||||
{{#if complexType}}
|
{{#if complexType}}
|
||||||
{{baseName}}: '{{complexType}}'
|
{{baseName}}: '{{complexType}}'
|
||||||
@ -8,5 +28,6 @@
|
|||||||
{{baseName}}: MetaOapg.properties.{{baseName}}
|
{{baseName}}: MetaOapg.properties.{{baseName}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
{{/unless}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/if}}
|
{{/if}}
|
@ -31,10 +31,21 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
"""
|
"""
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#or hasValidation composedSchemas isMap isAnyType}}
|
{{#or hasValidation composedSchemas isMap isAnyType getItems}}
|
||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
{{#with items}}
|
||||||
|
{{#if complexType}}
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@property
|
||||||
|
def {{baseName}}(cls) -> typing.Type['{{complexType}}']:
|
||||||
|
return {{complexType}}
|
||||||
|
{{else}}
|
||||||
|
{{> model_templates/schema }}
|
||||||
|
{{/if}}
|
||||||
|
{{/with}}
|
||||||
{{#or isMap isAnyType}}
|
{{#or isMap isAnyType}}
|
||||||
{{> model_templates/dict_partial }}
|
{{> model_templates/dict_partial }}
|
||||||
{{/or}}
|
{{/or}}
|
||||||
@ -48,6 +59,7 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
{{#if isEnum}}
|
{{#if isEnum}}
|
||||||
{{> model_templates/enums }}
|
{{> model_templates/enums }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{> model_templates/property_type_hints }}
|
{{> model_templates/property_type_hints }}
|
||||||
|
|
||||||
{{> model_templates/new }}
|
{{> model_templates/new }}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
|
|
||||||
class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}(
|
class {{> model_templates/classname }}(
|
||||||
schemas.ListSchema
|
schemas.ListSchema
|
||||||
):
|
):
|
||||||
{{#if this.classname}}
|
{{#if this.classname}}
|
||||||
@ -28,4 +28,9 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
{{else}}
|
{{else}}
|
||||||
{{> model_templates/schema }}
|
{{> model_templates/schema }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|
||||||
|
{{> model_templates/new }}
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> {{#with items}}{{#if complexType}}'{{baseName}}'{{else}}MetaOapg.items{{/if}}{{/with}}:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
@ -1512,11 +1512,12 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
dict_items[property_name_js] = new_value
|
dict_items[property_name_js] = new_value
|
||||||
return dict_items
|
return dict_items
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name: str, value: typing.Any):
|
||||||
if not isinstance(self, FileIO):
|
if not isinstance(self, FileIO):
|
||||||
raise AttributeError('property setting not supported on immutable instances')
|
raise AttributeError('property setting not supported on immutable instances')
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name: str):
|
||||||
|
# for instance.name access
|
||||||
if isinstance(self, frozendict):
|
if isinstance(self, frozendict):
|
||||||
# if an attribute does not exist
|
# if an attribute does not exist
|
||||||
try:
|
try:
|
||||||
@ -1525,13 +1526,6 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
raise AttributeError(str(ex))
|
raise AttributeError(str(ex))
|
||||||
return super().__getattr__(self, name)
|
return super().__getattr__(self, name)
|
||||||
|
|
||||||
def __getattribute__(self, name):
|
|
||||||
# if an attribute does exist (for example as a class property but not as an instance method)
|
|
||||||
try:
|
|
||||||
return self[name]
|
|
||||||
except (KeyError, TypeError):
|
|
||||||
return super().__getattribute__(name)
|
|
||||||
|
|
||||||
|
|
||||||
def cast_to_allowed_types(
|
def cast_to_allowed_types(
|
||||||
arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema],
|
arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema],
|
||||||
@ -1821,7 +1815,7 @@ class ListSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[list, tuple], **kwargs: ValidationMetadata):
|
def __new__(cls, arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1836,7 +1830,7 @@ class NoneSchema(
|
|||||||
def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: None, **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: None, **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1855,7 +1849,7 @@ class NumberSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1898,7 +1892,7 @@ class IntSchema(IntBase, NumberSchema):
|
|||||||
def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1983,31 +1977,31 @@ class StrSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema':
|
def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema':
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class UUIDSchema(UUIDBase, StrSchema):
|
class UUIDSchema(UUIDBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, uuid.UUID], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, uuid.UUID], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DateSchema(DateBase, StrSchema):
|
class DateSchema(DateBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DateTimeSchema(DateTimeBase, StrSchema):
|
class DateTimeSchema(DateTimeBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DecimalSchema(DecimalBase, StrSchema):
|
class DecimalSchema(DecimalBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str], **kwargs: Configuration):
|
||||||
"""
|
"""
|
||||||
Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads
|
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)
|
which can be simple (str) or complex (dicts or lists with nested values)
|
||||||
@ -2026,7 +2020,7 @@ class BytesSchema(
|
|||||||
"""
|
"""
|
||||||
this class will subclass bytes and is immutable
|
this class will subclass bytes and is immutable
|
||||||
"""
|
"""
|
||||||
def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[bytes], **kwargs: Configuration):
|
||||||
return super(Schema, cls).__new__(cls, arg)
|
return super(Schema, cls).__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2051,7 +2045,7 @@ class FileSchema(
|
|||||||
- to be able to preserve file name info
|
- to be able to preserve file name info
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration):
|
||||||
return super(Schema, cls).__new__(cls, arg)
|
return super(Schema, cls).__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2071,7 +2065,7 @@ class BinarySchema(
|
|||||||
FileSchema,
|
FileSchema,
|
||||||
]
|
]
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg)
|
return super().__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2086,7 +2080,7 @@ class BoolSchema(
|
|||||||
def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: bool, **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: bool, **kwargs: ValidationMetadata):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1995,6 +1995,8 @@ components:
|
|||||||
- _abc
|
- _abc
|
||||||
- '-efg'
|
- '-efg'
|
||||||
- (xyz)
|
- (xyz)
|
||||||
|
- COUNT_1M
|
||||||
|
- COUNT_50M
|
||||||
Enum_Test:
|
Enum_Test:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
|
@ -39,6 +39,7 @@ class AdditionalpropertiesAreAllowedByDefault(
|
|||||||
foo = schemas.AnyTypeSchema
|
foo = schemas.AnyTypeSchema
|
||||||
bar = schemas.AnyTypeSchema
|
bar = schemas.AnyTypeSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
@ -47,6 +47,7 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.AnyTypeSchema
|
foo = schemas.AnyTypeSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ class AdditionalpropertiesShouldNotLookInApplicators(
|
|||||||
cls.all_of_0,
|
cls.all_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -50,6 +50,7 @@ class Allof(
|
|||||||
class properties:
|
class properties:
|
||||||
bar = schemas.IntSchema
|
bar = schemas.IntSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ class Allof(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.StrSchema
|
foo = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
@ -115,6 +117,7 @@ class Allof(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -47,6 +47,7 @@ class AllofCombinedWithAnyofOneof(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 2
|
multiple_of = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -70,6 +71,7 @@ class AllofCombinedWithAnyofOneof(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 5
|
multiple_of = 5
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -93,6 +95,7 @@ class AllofCombinedWithAnyofOneof(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 3
|
multiple_of = 3
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -151,6 +154,7 @@ class AllofCombinedWithAnyofOneof(
|
|||||||
cls.any_of_0,
|
cls.any_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -47,6 +47,7 @@ class AllofSimpleTypes(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_maximum = 30
|
inclusive_maximum = 30
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -70,6 +71,7 @@ class AllofSimpleTypes(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_minimum = 20
|
inclusive_minimum = 20
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -99,6 +101,7 @@ class AllofSimpleTypes(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -55,6 +55,7 @@ class AllofWithBaseSchema(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.StrSchema
|
foo = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ class AllofWithBaseSchema(
|
|||||||
class properties:
|
class properties:
|
||||||
baz = schemas.NoneSchema
|
baz = schemas.NoneSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
baz: MetaOapg.properties.baz
|
baz: MetaOapg.properties.baz
|
||||||
|
|
||||||
@ -119,6 +121,7 @@ class AllofWithBaseSchema(
|
|||||||
cls.all_of_0,
|
cls.all_of_0,
|
||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ class AllofWithOneEmptySchema(
|
|||||||
cls.all_of_0,
|
cls.all_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -55,6 +55,7 @@ class AllofWithTheFirstEmptySchema(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -55,6 +55,7 @@ class AllofWithTheLastEmptySchema(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -55,6 +55,7 @@ class AllofWithTwoEmptySchemas(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -48,6 +48,7 @@ class Anyof(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_minimum = 2
|
inclusive_minimum = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -77,6 +78,7 @@ class Anyof(
|
|||||||
cls.any_of_1,
|
cls.any_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -50,6 +50,7 @@ class AnyofComplexTypes(
|
|||||||
class properties:
|
class properties:
|
||||||
bar = schemas.IntSchema
|
bar = schemas.IntSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ class AnyofComplexTypes(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.StrSchema
|
foo = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
@ -115,6 +117,7 @@ class AnyofComplexTypes(
|
|||||||
cls.any_of_1,
|
cls.any_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -47,6 +47,7 @@ class AnyofWithBaseSchema(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_length = 2
|
max_length = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -70,6 +71,7 @@ class AnyofWithBaseSchema(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
min_length = 4
|
min_length = 4
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -99,6 +101,7 @@ class AnyofWithBaseSchema(
|
|||||||
cls.any_of_1,
|
cls.any_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[str, ],
|
*args: typing.Union[str, ],
|
||||||
|
@ -55,6 +55,7 @@ class AnyofWithOneEmptySchema(
|
|||||||
cls.any_of_1,
|
cls.any_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -36,3 +36,17 @@ class ArrayTypeMatchesArrays(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.AnyTypeSchema
|
items = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayTypeMatchesArrays':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
@ -38,6 +38,7 @@ class ByInt(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 2
|
multiple_of = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class ByNumber(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 1.5
|
multiple_of = 1.5
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class BySmallNumber(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
multiple_of = 0.00010
|
multiple_of = 0.00010
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -71,8 +71,8 @@ class EnumsInProperties(
|
|||||||
return cls("bar")
|
return cls("bar")
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
@ -47,6 +47,7 @@ class ForbiddenProperty(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
not_schema = schemas.AnyTypeSchema
|
not_schema = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -60,6 +61,7 @@ class ForbiddenProperty(
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ class InvalidStringValueForDefault(
|
|||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
min_length = 4
|
min_length = 4
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class MaximumValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_maximum = 3.0
|
inclusive_maximum = 3.0
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MaximumValidationWithUnsignedInteger(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_maximum = 300
|
inclusive_maximum = 300
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MaxitemsValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_items = 2
|
max_items = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MaxlengthValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_length = 2
|
max_length = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class Maxproperties0MeansTheObjectIsEmpty(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_properties = 0
|
max_properties = 0
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MaxpropertiesValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_properties = 2
|
max_properties = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MinimumValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_minimum = 1.1
|
inclusive_minimum = 1.1
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MinimumValidationWithSignedInteger(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_minimum = -2
|
inclusive_minimum = -2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MinitemsValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
min_items = 1
|
min_items = 1
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MinlengthValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
min_length = 2
|
min_length = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class MinpropertiesValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
min_properties = 1
|
min_properties = 1
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class ModelNot(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
not_schema = schemas.IntSchema
|
not_schema = schemas.IntSchema
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -62,6 +62,7 @@ class NestedAllofToCheckValidationSemantics(
|
|||||||
cls.all_of_0,
|
cls.all_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -90,6 +91,7 @@ class NestedAllofToCheckValidationSemantics(
|
|||||||
cls.all_of_0,
|
cls.all_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -62,6 +62,7 @@ class NestedAnyofToCheckValidationSemantics(
|
|||||||
cls.any_of_0,
|
cls.any_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -90,6 +91,7 @@ class NestedAnyofToCheckValidationSemantics(
|
|||||||
cls.any_of_0,
|
cls.any_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -60,3 +60,59 @@ class NestedItems(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.NumberSchema
|
items = schemas.NumberSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'NestedItems':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
@ -62,6 +62,7 @@ class NestedOneofToCheckValidationSemantics(
|
|||||||
cls.one_of_0,
|
cls.one_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -90,6 +91,7 @@ class NestedOneofToCheckValidationSemantics(
|
|||||||
cls.one_of_0,
|
cls.one_of_0,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -65,6 +65,7 @@ class NotMoreComplexSchema(
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -39,6 +39,7 @@ class ObjectPropertiesValidation(
|
|||||||
foo = schemas.IntSchema
|
foo = schemas.IntSchema
|
||||||
bar = schemas.StrSchema
|
bar = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
@ -48,6 +48,7 @@ class Oneof(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
inclusive_minimum = 2
|
inclusive_minimum = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -77,6 +78,7 @@ class Oneof(
|
|||||||
cls.one_of_1,
|
cls.one_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -50,6 +50,7 @@ class OneofComplexTypes(
|
|||||||
class properties:
|
class properties:
|
||||||
bar = schemas.IntSchema
|
bar = schemas.IntSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
|
||||||
@ -81,6 +82,7 @@ class OneofComplexTypes(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.StrSchema
|
foo = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
@ -115,6 +117,7 @@ class OneofComplexTypes(
|
|||||||
cls.one_of_1,
|
cls.one_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -47,6 +47,7 @@ class OneofWithBaseSchema(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
min_length = 2
|
min_length = 2
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -70,6 +71,7 @@ class OneofWithBaseSchema(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
max_length = 4
|
max_length = 4
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -99,6 +101,7 @@ class OneofWithBaseSchema(
|
|||||||
cls.one_of_1,
|
cls.one_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[str, ],
|
*args: typing.Union[str, ],
|
||||||
|
@ -55,6 +55,7 @@ class OneofWithEmptySchema(
|
|||||||
cls.one_of_1,
|
cls.one_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -51,6 +51,10 @@ class OneofWithRequired(
|
|||||||
}
|
}
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
bar: MetaOapg.additional_properties
|
||||||
|
foo: MetaOapg.additional_properties
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -77,6 +81,10 @@ class OneofWithRequired(
|
|||||||
}
|
}
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
foo: MetaOapg.additional_properties
|
||||||
|
baz: MetaOapg.additional_properties
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
@ -106,6 +114,7 @@ class OneofWithRequired(
|
|||||||
cls.one_of_1,
|
cls.one_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, ],
|
*args: typing.Union[dict, frozendict, ],
|
||||||
|
@ -40,6 +40,7 @@ class PatternIsNotAnchored(
|
|||||||
'pattern': r'a+', # noqa: E501
|
'pattern': r'a+', # noqa: E501
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -40,6 +40,7 @@ class PatternValidation(
|
|||||||
'pattern': r'^a*$', # noqa: E501
|
'pattern': r'^a*$', # noqa: E501
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -115,6 +115,7 @@ class PropertiesWithEscapedCharacters(
|
|||||||
If the property is required and was not passed in, an exception will be thrown
|
If the property is required and was not passed in, an exception will be thrown
|
||||||
"""
|
"""
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
|
@ -50,6 +50,7 @@ class PropertyNamedRefThatIsNotAReference(
|
|||||||
If the property is required and was not passed in, an exception will be thrown
|
If the property is required and was not passed in, an exception will be thrown
|
||||||
"""
|
"""
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
|
@ -52,6 +52,7 @@ class RefInAllof(
|
|||||||
PropertyNamedRefThatIsNotAReference,
|
PropertyNamedRefThatIsNotAReference,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -52,6 +52,7 @@ class RefInAnyof(
|
|||||||
PropertyNamedRefThatIsNotAReference,
|
PropertyNamedRefThatIsNotAReference,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -41,4 +41,18 @@ class RefInItems(
|
|||||||
def items(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
def items(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
||||||
return PropertyNamedRefThatIsNotAReference
|
return PropertyNamedRefThatIsNotAReference
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple['PropertyNamedRefThatIsNotAReference'], typing.List['PropertyNamedRefThatIsNotAReference']],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'RefInItems':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> 'items':
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference
|
from unit_test_api.model.property_named_ref_that_is_not_a_reference import PropertyNamedRefThatIsNotAReference
|
||||||
|
@ -42,6 +42,7 @@ class RefInNot(
|
|||||||
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
||||||
return PropertyNamedRefThatIsNotAReference
|
return PropertyNamedRefThatIsNotAReference
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -52,6 +52,7 @@ class RefInOneof(
|
|||||||
PropertyNamedRefThatIsNotAReference,
|
PropertyNamedRefThatIsNotAReference,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -42,6 +42,7 @@ class RefInProperty(
|
|||||||
def a(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
def a(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
||||||
return PropertyNamedRefThatIsNotAReference
|
return PropertyNamedRefThatIsNotAReference
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
a: 'PropertyNamedRefThatIsNotAReference'
|
a: 'PropertyNamedRefThatIsNotAReference'
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class RequiredDefaultValidation(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.AnyTypeSchema
|
foo = schemas.AnyTypeSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ class RequiredValidation(
|
|||||||
foo = schemas.AnyTypeSchema
|
foo = schemas.AnyTypeSchema
|
||||||
bar = schemas.AnyTypeSchema
|
bar = schemas.AnyTypeSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
bar: MetaOapg.properties.bar
|
bar: MetaOapg.properties.bar
|
||||||
|
@ -38,6 +38,7 @@ class RequiredWithEmptyArray(
|
|||||||
class properties:
|
class properties:
|
||||||
foo = schemas.AnyTypeSchema
|
foo = schemas.AnyTypeSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
foo: MetaOapg.properties.foo
|
foo: MetaOapg.properties.foo
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ class RequiredWithEscapedCharacters(
|
|||||||
}
|
}
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class UniqueitemsFalseValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
unique_items = False
|
unique_items = False
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -38,6 +38,7 @@ class UniqueitemsValidation(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
unique_items = True
|
unique_items = True
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -63,6 +63,7 @@ class SchemaForRequestBodyApplicationJson(
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -36,6 +36,7 @@ class SchemaForRequestBodyApplicationJson(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
not_schema = schemas.IntSchema
|
not_schema = schemas.IntSchema
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -42,6 +42,7 @@ class SchemaForRequestBodyApplicationJson(
|
|||||||
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
||||||
return PropertyNamedRefThatIsNotAReference
|
return PropertyNamedRefThatIsNotAReference
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -43,6 +43,8 @@ class SchemaForRequestBodyApplicationJson(
|
|||||||
}
|
}
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -62,6 +62,7 @@ class SchemaFor200ResponseBodyApplicationJson(
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -35,6 +35,7 @@ class SchemaFor200ResponseBodyApplicationJson(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
not_schema = schemas.IntSchema
|
not_schema = schemas.IntSchema
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -41,6 +41,7 @@ class SchemaFor200ResponseBodyApplicationJson(
|
|||||||
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
def not_schema(cls) -> typing.Type['PropertyNamedRefThatIsNotAReference']:
|
||||||
return PropertyNamedRefThatIsNotAReference
|
return PropertyNamedRefThatIsNotAReference
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -42,6 +42,8 @@ class SchemaFor200ResponseBodyApplicationJson(
|
|||||||
}
|
}
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -1519,11 +1519,12 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
dict_items[property_name_js] = new_value
|
dict_items[property_name_js] = new_value
|
||||||
return dict_items
|
return dict_items
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name: str, value: typing.Any):
|
||||||
if not isinstance(self, FileIO):
|
if not isinstance(self, FileIO):
|
||||||
raise AttributeError('property setting not supported on immutable instances')
|
raise AttributeError('property setting not supported on immutable instances')
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name: str):
|
||||||
|
# for instance.name access
|
||||||
if isinstance(self, frozendict):
|
if isinstance(self, frozendict):
|
||||||
# if an attribute does not exist
|
# if an attribute does not exist
|
||||||
try:
|
try:
|
||||||
@ -1532,13 +1533,6 @@ class DictBase(Discriminable, ValidatorBase):
|
|||||||
raise AttributeError(str(ex))
|
raise AttributeError(str(ex))
|
||||||
return super().__getattr__(self, name)
|
return super().__getattr__(self, name)
|
||||||
|
|
||||||
def __getattribute__(self, name):
|
|
||||||
# if an attribute does exist (for example as a class property but not as an instance method)
|
|
||||||
try:
|
|
||||||
return self[name]
|
|
||||||
except (KeyError, TypeError):
|
|
||||||
return super().__getattribute__(name)
|
|
||||||
|
|
||||||
|
|
||||||
def cast_to_allowed_types(
|
def cast_to_allowed_types(
|
||||||
arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema],
|
arg: typing.Union[str, date, datetime, uuid.UUID, decimal.Decimal, int, float, None, dict, frozendict, list, tuple, bytes, Schema],
|
||||||
@ -1828,7 +1822,7 @@ class ListSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: typing.List[typing.Any], _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[list, tuple], **kwargs: ValidationMetadata):
|
def __new__(cls, arg: typing.Union[typing.List[typing.Any], typing.Tuple[typing.Any]], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1843,7 +1837,7 @@ class NoneSchema(
|
|||||||
def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: None, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: None, **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: None, **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1862,7 +1856,7 @@ class NumberSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: typing.Union[int, float, decimal.Decimal], _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[decimal.Decimal, int, float], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1905,7 +1899,7 @@ class IntSchema(IntBase, NumberSchema):
|
|||||||
def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: int, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[decimal.Decimal, int], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
@ -1990,31 +1984,31 @@ class StrSchema(
|
|||||||
def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema':
|
def _from_openapi_data(cls, arg: typing.Union[str], _configuration: typing.Optional[Configuration] = None) -> 'StrSchema':
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, date, datetime, uuid.UUID], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class UUIDSchema(UUIDBase, StrSchema):
|
class UUIDSchema(UUIDBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, uuid.UUID], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, uuid.UUID], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DateSchema(DateBase, StrSchema):
|
class DateSchema(DateBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DateTimeSchema(DateTimeBase, StrSchema):
|
class DateTimeSchema(DateTimeBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str, datetime], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class DecimalSchema(DecimalBase, StrSchema):
|
class DecimalSchema(DecimalBase, StrSchema):
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[str], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[str], **kwargs: Configuration):
|
||||||
"""
|
"""
|
||||||
Note: Decimals may not be passed in because cast_to_allowed_types is only invoked once for payloads
|
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)
|
which can be simple (str) or complex (dicts or lists with nested values)
|
||||||
@ -2033,7 +2027,7 @@ class BytesSchema(
|
|||||||
"""
|
"""
|
||||||
this class will subclass bytes and is immutable
|
this class will subclass bytes and is immutable
|
||||||
"""
|
"""
|
||||||
def __new__(cls, arg: typing.Union[bytes], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[bytes], **kwargs: Configuration):
|
||||||
return super(Schema, cls).__new__(cls, arg)
|
return super(Schema, cls).__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2058,7 +2052,7 @@ class FileSchema(
|
|||||||
- to be able to preserve file name info
|
- to be able to preserve file name info
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader], **kwargs: Configuration):
|
||||||
return super(Schema, cls).__new__(cls, arg)
|
return super(Schema, cls).__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2078,7 +2072,7 @@ class BinarySchema(
|
|||||||
FileSchema,
|
FileSchema,
|
||||||
]
|
]
|
||||||
|
|
||||||
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: typing.Union[io.FileIO, io.BufferedReader, bytes], **kwargs: Configuration):
|
||||||
return super().__new__(cls, arg)
|
return super().__new__(cls, arg)
|
||||||
|
|
||||||
|
|
||||||
@ -2093,7 +2087,7 @@ class BoolSchema(
|
|||||||
def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None):
|
def _from_openapi_data(cls, arg: bool, _configuration: typing.Optional[Configuration] = None):
|
||||||
return super()._from_openapi_data(arg, _configuration=_configuration)
|
return super()._from_openapi_data(arg, _configuration=_configuration)
|
||||||
|
|
||||||
def __new__(cls, arg: bool, **kwargs: typing.Union[ValidationMetadata]):
|
def __new__(cls, arg: bool, **kwargs: ValidationMetadata):
|
||||||
return super().__new__(cls, arg, **kwargs)
|
return super().__new__(cls, arg, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Type | Description | Notes
|
Type | Description | Notes
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
**str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
|
**str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", "COUNT_1M", "COUNT_50M", ]
|
||||||
|
|
||||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||||
|
|
||||||
|
@ -48,6 +48,20 @@ class AdditionalPropertiesWithArrayOfEnums(
|
|||||||
@property
|
@property
|
||||||
def items(cls) -> typing.Type['EnumClass']:
|
def items(cls) -> typing.Type['EnumClass']:
|
||||||
return EnumClass
|
return EnumClass
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple['EnumClass'], typing.List['EnumClass']],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'additional_properties':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> 'items':
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
@ -41,4 +41,18 @@ class AnimalFarm(
|
|||||||
def items(cls) -> typing.Type['Animal']:
|
def items(cls) -> typing.Type['Animal']:
|
||||||
return Animal
|
return Animal
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple['Animal'], typing.List['Animal']],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'AnimalFarm':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> 'items':
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
from petstore_api.model.animal import Animal
|
from petstore_api.model.animal import Animal
|
||||||
|
@ -38,6 +38,7 @@ class AnyTypeNotString(
|
|||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
not_schema = schemas.StrSchema
|
not_schema = schemas.StrSchema
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -68,6 +68,7 @@ class Apple(
|
|||||||
)
|
)
|
||||||
}]
|
}]
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
cultivar: MetaOapg.properties.cultivar
|
cultivar: MetaOapg.properties.cultivar
|
||||||
origin: MetaOapg.properties.origin
|
origin: MetaOapg.properties.origin
|
||||||
|
@ -36,3 +36,17 @@ class ArrayHoldingAnyType(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.AnyTypeSchema
|
items = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayHoldingAnyType':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
@ -53,6 +53,34 @@ class ArrayOfArrayOfNumberOnly(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.NumberSchema
|
items = schemas.NumberSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayArrayNumber':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
ArrayArrayNumber: MetaOapg.properties.ArrayArrayNumber
|
ArrayArrayNumber: MetaOapg.properties.ArrayArrayNumber
|
||||||
|
@ -41,4 +41,18 @@ class ArrayOfEnums(
|
|||||||
def items(cls) -> typing.Type['StringEnum']:
|
def items(cls) -> typing.Type['StringEnum']:
|
||||||
return StringEnum
|
return StringEnum
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple['StringEnum'], typing.List['StringEnum']],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayOfEnums':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> 'items':
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
from petstore_api.model.string_enum import StringEnum
|
from petstore_api.model.string_enum import StringEnum
|
||||||
|
@ -45,6 +45,20 @@ class ArrayOfNumberOnly(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.NumberSchema
|
items = schemas.NumberSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]], typing.List[typing.Union[MetaOapg.items, decimal.Decimal, int, float, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayNumber':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
ArrayNumber: MetaOapg.properties.ArrayNumber
|
ArrayNumber: MetaOapg.properties.ArrayNumber
|
||||||
|
@ -46,6 +46,20 @@ class ArrayTest(
|
|||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.StrSchema
|
items = schemas.StrSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, str, ]], typing.List[typing.Union[MetaOapg.items, str, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'array_of_string':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
|
||||||
class array_array_of_integer(
|
class array_array_of_integer(
|
||||||
schemas.ListSchema
|
schemas.ListSchema
|
||||||
@ -62,6 +76,34 @@ class ArrayTest(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.Int64Schema
|
items = schemas.Int64Schema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, int, ]], typing.List[typing.Union[MetaOapg.items, int, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'array_array_of_integer':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
|
||||||
class array_array_of_model(
|
class array_array_of_model(
|
||||||
@ -83,6 +125,34 @@ class ArrayTest(
|
|||||||
@property
|
@property
|
||||||
def items(cls) -> typing.Type['ReadOnlyFirst']:
|
def items(cls) -> typing.Type['ReadOnlyFirst']:
|
||||||
return ReadOnlyFirst
|
return ReadOnlyFirst
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple['ReadOnlyFirst'], typing.List['ReadOnlyFirst']],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'items':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> 'items':
|
||||||
|
return super().__getitem__(i)
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, tuple, ]], typing.List[typing.Union[MetaOapg.items, tuple, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'array_array_of_model':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
array_of_string: MetaOapg.properties.array_of_string
|
array_of_string: MetaOapg.properties.array_of_string
|
||||||
|
@ -45,3 +45,17 @@ class ArrayWithValidationsInItems(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
inclusive_maximum = 7
|
inclusive_maximum = 7
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, int, ]], typing.List[typing.Union[MetaOapg.items, int, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'ArrayWithValidationsInItems':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
|
@ -81,6 +81,7 @@ class Cat(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -43,8 +43,8 @@ class Category(
|
|||||||
name = schemas.StrSchema
|
name = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
id: MetaOapg.properties.id
|
|
||||||
name: MetaOapg.properties.name
|
name: MetaOapg.properties.name
|
||||||
|
id: MetaOapg.properties.id
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
@ -81,6 +81,7 @@ class ChildCat(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -40,6 +40,7 @@ class ClassModel(
|
|||||||
class properties:
|
class properties:
|
||||||
_class = schemas.StrSchema
|
_class = schemas.StrSchema
|
||||||
additional_properties = schemas.AnyTypeSchema
|
additional_properties = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
|
||||||
_class: MetaOapg.properties._class
|
_class: MetaOapg.properties._class
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ class ComplexQuadrilateral(
|
|||||||
cls.all_of_1,
|
cls.all_of_1,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
@ -54,6 +54,20 @@ class ComposedAnyOfDifferentTypesNoValidations(
|
|||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
items = schemas.AnyTypeSchema
|
items = schemas.AnyTypeSchema
|
||||||
|
|
||||||
|
def __new__(
|
||||||
|
cls,
|
||||||
|
arg: typing.Union[typing.Tuple[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]], typing.List[typing.Union[MetaOapg.items, dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ]]],
|
||||||
|
_configuration: typing.Optional[schemas.Configuration] = None,
|
||||||
|
) -> 'any_of_9':
|
||||||
|
return super().__new__(
|
||||||
|
cls,
|
||||||
|
arg,
|
||||||
|
_configuration=_configuration,
|
||||||
|
)
|
||||||
|
|
||||||
|
def __getitem__(self, i) -> MetaOapg.items:
|
||||||
|
return super().__getitem__(i)
|
||||||
any_of_10 = schemas.NumberSchema
|
any_of_10 = schemas.NumberSchema
|
||||||
any_of_11 = schemas.Float32Schema
|
any_of_11 = schemas.Float32Schema
|
||||||
any_of_12 = schemas.Float64Schema
|
any_of_12 = schemas.Float64Schema
|
||||||
@ -91,6 +105,7 @@ class ComposedAnyOfDifferentTypesNoValidations(
|
|||||||
cls.any_of_15,
|
cls.any_of_15,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
*args: typing.Union[dict, frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, None, list, tuple, bytes, ],
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user