mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-05 15:10:49 +00:00
[python-experimental] removes enum cls factory (#13491)
* Movs enum info, changes cls factory to base class + updates samples * Fixed docs for enums, they show the allowed bool and None values now
This commit is contained in:
parent
e146afbea1
commit
d25cdbb2ce
@ -55,6 +55,7 @@ import org.openapitools.codegen.api.TemplateProcessor;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.time.ZoneOffset;
|
import java.time.ZoneOffset;
|
||||||
@ -1226,6 +1227,8 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
|||||||
// our enum var names are keys in a python dict, so change spaces to underscores
|
// our enum var names are keys in a python dict, so change spaces to underscores
|
||||||
if (value.length() == 0) {
|
if (value.length() == 0) {
|
||||||
return "EMPTY";
|
return "EMPTY";
|
||||||
|
} else if (value.equals("null")) {
|
||||||
|
return "NONE";
|
||||||
}
|
}
|
||||||
|
|
||||||
String intPattern = "^[-\\+]?\\d+$";
|
String intPattern = "^[-\\+]?\\d+$";
|
||||||
@ -1289,26 +1292,80 @@ public class PythonExperimentalClientCodegen extends AbstractPythonCodegen {
|
|||||||
return varName;
|
return varName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
protected List<Map<String, Object>> buildEnumVars(List<Object> values, String dataType) {
|
||||||
* Return the enum value in the language specified format
|
List<Map<String, Object>> enumVars = new ArrayList<>();
|
||||||
* e.g. status becomes "status"
|
int truncateIdx = 0;
|
||||||
*
|
|
||||||
* @param value enum variable name
|
if (isRemoveEnumValuePrefix()) {
|
||||||
* @param datatype data type
|
String commonPrefix = findCommonPrefixOfVars(values);
|
||||||
* @return the sanitized value for enum
|
truncateIdx = commonPrefix.length();
|
||||||
*/
|
}
|
||||||
public String toEnumValue(String value, String datatype) {
|
|
||||||
if ("int".equals(datatype) || "float".equals(datatype) || datatype.equals("int, float")) {
|
for (Object value : values) {
|
||||||
return value;
|
Map<String, Object> enumVar = new HashMap<>();
|
||||||
} else if ("bool".equals(datatype)) {
|
String enumName;
|
||||||
if (value.equals("true")) {
|
if (truncateIdx == 0) {
|
||||||
return "schemas.BoolClass.TRUE";
|
enumName = String.valueOf(value);
|
||||||
|
} else {
|
||||||
|
enumName = value.toString().substring(truncateIdx);
|
||||||
|
if (enumName.isEmpty()) {
|
||||||
|
enumName = value.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
enumVar.put("name", toEnumVarName(enumName, dataType));
|
||||||
|
if (value instanceof Integer) {
|
||||||
|
enumVar.put("value", value);
|
||||||
|
} else if (value instanceof Double) {
|
||||||
|
enumVar.put("value", value);
|
||||||
|
} else if (value instanceof Long) {
|
||||||
|
enumVar.put("value", value);
|
||||||
|
} else if (value instanceof Float) {
|
||||||
|
enumVar.put("value", value);
|
||||||
|
} else if (value instanceof BigDecimal) {
|
||||||
|
enumVar.put("value", value);
|
||||||
|
} else if (value == null) {
|
||||||
|
enumVar.put("value", "schemas.NoneClass.NONE");
|
||||||
|
} else if (value instanceof Boolean) {
|
||||||
|
if (value.equals(Boolean.TRUE)) {
|
||||||
|
enumVar.put("value", "schemas.BoolClass.TRUE");
|
||||||
|
} else {
|
||||||
|
enumVar.put("value", "schemas.BoolClass.FALSE");
|
||||||
}
|
}
|
||||||
return "schemas.BoolClass.FALSE";
|
|
||||||
} else {
|
} else {
|
||||||
String fixedValue = (String) processTestExampleData(value);
|
String fixedValue = (String) processTestExampleData(value);
|
||||||
return ensureQuotes(fixedValue);
|
enumVar.put("value", ensureQuotes(fixedValue));
|
||||||
}
|
}
|
||||||
|
enumVar.put("isString", isDataTypeString(dataType));
|
||||||
|
enumVars.add(enumVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (enumUnknownDefaultCase) {
|
||||||
|
// If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.
|
||||||
|
// With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.
|
||||||
|
Map<String, Object> enumVar = new HashMap<>();
|
||||||
|
String enumName = enumUnknownDefaultCaseName;
|
||||||
|
|
||||||
|
String enumValue;
|
||||||
|
if (isDataTypeString(dataType)) {
|
||||||
|
enumValue = enumUnknownDefaultCaseName;
|
||||||
|
} else {
|
||||||
|
// This is a dummy value that attempts to avoid collisions with previously specified cases.
|
||||||
|
// Int.max / 192
|
||||||
|
// The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums.
|
||||||
|
// [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md)
|
||||||
|
// Since this functionality was born in the Swift 5 generator and latter on broth to all generators
|
||||||
|
// https://github.com/OpenAPITools/openapi-generator/pull/11013
|
||||||
|
enumValue = String.valueOf(11184809);
|
||||||
|
}
|
||||||
|
|
||||||
|
enumVar.put("name", toEnumVarName(enumName, dataType));
|
||||||
|
enumVar.put("value", toEnumValue(enumValue, dataType));
|
||||||
|
enumVar.put("isString", isDataTypeString(dataType));
|
||||||
|
enumVars.add(enumVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
return enumVars;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
schemas.SchemaEnumMakerClsFactory(
|
|
||||||
enum_value_to_name={
|
|
||||||
{{#if isNull}}
|
|
||||||
schemas.NoneClass.NONE: "NONE",
|
|
||||||
{{/if}}
|
|
||||||
{{#with allowableValues}}
|
|
||||||
{{#each enumVars}}
|
|
||||||
{{{value}}}: "{{name}}",
|
|
||||||
{{/each}}
|
|
||||||
{{/with}}
|
|
||||||
}
|
|
||||||
),
|
|
@ -1,14 +1,20 @@
|
|||||||
{{#if isNull}}
|
|
||||||
|
|
||||||
@schemas.classproperty
|
|
||||||
def NONE(cls):
|
|
||||||
return cls(None)
|
|
||||||
{{/if}}
|
|
||||||
{{#with allowableValues}}
|
{{#with allowableValues}}
|
||||||
{{#each enumVars}}
|
{{#each enumVars}}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def {{name}}(cls):
|
def {{name}}(cls):
|
||||||
|
{{#eq value "schemas.NoneClass.NONE"}}
|
||||||
|
return cls(None)
|
||||||
|
{{else}}
|
||||||
|
{{#eq value "schemas.BoolClass.TRUE"}}
|
||||||
|
return cls(True)
|
||||||
|
{{else}}
|
||||||
|
{{#eq value "schemas.BoolClass.FALSE"}}
|
||||||
|
return cls(False)
|
||||||
|
{{else}}
|
||||||
return cls({{{value}}})
|
return cls({{{value}}})
|
||||||
|
{{/eq}}
|
||||||
|
{{/eq}}
|
||||||
|
{{/eq}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/with}}
|
{{/with}}
|
@ -1 +1 @@
|
|||||||
{{#unless isArray}}{{#unless complexType}}{{#with allowableValues}}must be one of [{{#each enumVars}}{{{value}}}, {{/each}}] {{/with}}{{#if defaultValue}}{{#unless hasRequired}}if omitted the server will use the default value of {{{defaultValue}}}{{/unless}}{{/if}}{{#eq getFormat "uuid"}}value must be a uuid{{/eq}}{{#eq getFormat "date"}}value must conform to RFC-3339 full-date YYYY-MM-DD{{/eq}}{{#eq getFormat "date-time"}}value must conform to RFC-3339 date-time{{/eq}}{{#eq getFormat "number"}}value must be numeric and storable in decimal.Decimal{{/eq}}{{#eq getFormat "int32"}}value must be a 32 bit integer{{/eq}}{{#eq getFormat "int64"}}value must be a 64 bit integer{{/eq}}{{#eq getFormat "double"}}value must be a 64 bit float{{/eq}}{{#eq getFormat "float"}}value must be a 32 bit float{{/eq}}{{/unless}}{{/unless}}
|
{{#unless isArray}}{{#unless complexType}}{{#with allowableValues}}must be one of [{{#each enumVars}}{{#eq value "schemas.NoneClass.NONE"}}None{{else}}{{#eq value "schemas.BoolClass.TRUE"}}True{{else}}{{#eq value "schemas.BoolClass.FALSE"}}False{{else}}{{{value}}}{{/eq}}{{/eq}}{{/eq}}, {{/each}}] {{/with}}{{#if defaultValue}}{{#unless hasRequired}}if omitted the server will use the default value of {{{defaultValue}}}{{/unless}}{{/if}}{{#eq getFormat "uuid"}}value must be a uuid{{/eq}}{{#eq getFormat "date"}}value must conform to RFC-3339 full-date YYYY-MM-DD{{/eq}}{{#eq getFormat "date-time"}}value must conform to RFC-3339 date-time{{/eq}}{{#eq getFormat "number"}}value must be numeric and storable in decimal.Decimal{{/eq}}{{#eq getFormat "int32"}}value must be a 32 bit integer{{/eq}}{{#eq getFormat "int64"}}value must be a 64 bit integer{{/eq}}{{#eq getFormat "double"}}value must be a 64 bit float{{/eq}}{{#eq getFormat "float"}}value must be a 32 bit float{{/eq}}{{/unless}}{{/unless}}
|
@ -15,7 +15,7 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
schemas.ComposedBase,
|
schemas.ComposedBase,
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if isEnum}}
|
{{#if isEnum}}
|
||||||
{{> model_templates/enum_value_to_name }}
|
schemas.EnumBase,
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{> model_templates/xbase_schema }}
|
{{> model_templates/xbase_schema }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
@ -31,13 +31,22 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
"""
|
"""
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#or hasValidation composedSchemas getItems additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars getFormat}}
|
{{#or hasValidation composedSchemas getItems additionalProperties getRequiredVarsMap getHasDiscriminatorWithNonEmptyMapping vars getFormat isEnum}}
|
||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
{{#if getFormat}}
|
{{#if getFormat}}
|
||||||
format = '{{getFormat}}'
|
format = '{{getFormat}}'
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{#if isEnum}}
|
||||||
|
{{#with allowableValues}}
|
||||||
|
enum_value_to_name = {
|
||||||
|
{{#each enumVars}}
|
||||||
|
{{{value}}}: "{{name}}",
|
||||||
|
{{/each}}
|
||||||
|
}
|
||||||
|
{{/with}}
|
||||||
|
{{/if}}
|
||||||
{{#if getItems}}
|
{{#if getItems}}
|
||||||
{{> model_templates/list_partial }}
|
{{> model_templates/list_partial }}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}(
|
class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}{{else}}{{baseName}}{{/if}}{{/if}}(
|
||||||
{{#if isEnum}}
|
{{#if isEnum}}
|
||||||
{{> model_templates/enum_value_to_name }}
|
schemas.EnumBase,
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{> model_templates/xbase_schema }}
|
{{> model_templates/xbase_schema }}
|
||||||
):
|
):
|
||||||
@ -18,12 +18,24 @@ class {{#if this.classname}}{{classname}}{{else}}{{#if nameInSnakeCase}}{{name}}
|
|||||||
"""
|
"""
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#unless isStub}}
|
{{#unless isStub}}
|
||||||
{{#if hasValidation}}
|
{{#or hasValidation isEnum getFormat}}
|
||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
{{> model_templates/validations }}
|
{{#if getFormat}}
|
||||||
|
format = '{{getFormat}}'
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{> model_templates/validations }}
|
||||||
|
{{#if isEnum}}
|
||||||
|
{{#with allowableValues}}
|
||||||
|
enum_value_to_name = {
|
||||||
|
{{#each enumVars}}
|
||||||
|
{{{value}}}: "{{name}}",
|
||||||
|
{{/each}}
|
||||||
|
}
|
||||||
|
{{/with}}
|
||||||
|
{{/if}}
|
||||||
|
{{/or}}
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{#if isEnum}}
|
{{#if isEnum}}
|
||||||
{{> model_templates/enums }}
|
{{> model_templates/enums }}
|
||||||
|
@ -404,7 +404,7 @@ class Schema:
|
|||||||
"""
|
"""
|
||||||
cls._process_schema_classes_oapg(schema_classes)
|
cls._process_schema_classes_oapg(schema_classes)
|
||||||
enum_schema = any(
|
enum_schema = any(
|
||||||
hasattr(this_cls, '_enum_value_to_name') for this_cls in schema_classes)
|
issubclass(this_cls, EnumBase) for this_cls in schema_classes)
|
||||||
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
||||||
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
||||||
suffix = tuple(inheritable_primitive_type)
|
suffix = tuple(inheritable_primitive_type)
|
||||||
@ -873,24 +873,7 @@ class ValidatorBase:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumMakerBase:
|
class EnumBase:
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> 'SchemaEnumMaker':
|
|
||||||
class SchemaEnumMaker(EnumMakerBase):
|
|
||||||
@classmethod
|
|
||||||
def _enum_value_to_name(
|
|
||||||
cls
|
|
||||||
) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
super_enum_value_to_name = super()._enum_value_to_name()
|
|
||||||
except AttributeError:
|
|
||||||
return enum_value_to_name
|
|
||||||
intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items())
|
|
||||||
return intersection
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _validate_oapg(
|
def _validate_oapg(
|
||||||
cls,
|
cls,
|
||||||
@ -898,17 +881,15 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str,
|
|||||||
validation_metadata: ValidationMetadata,
|
validation_metadata: ValidationMetadata,
|
||||||
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
||||||
"""
|
"""
|
||||||
SchemaEnumMaker _validate_oapg
|
EnumBase _validate_oapg
|
||||||
Validates that arg is in the enum's allowed values
|
Validates that arg is in the enum's allowed values
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
cls._enum_value_to_name()[arg]
|
cls.MetaOapg.enum_value_to_name[arg]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name()))
|
raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys()))
|
||||||
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
||||||
|
|
||||||
return SchemaEnumMaker
|
|
||||||
|
|
||||||
|
|
||||||
class BoolBase:
|
class BoolBase:
|
||||||
def is_true_oapg(self) -> bool:
|
def is_true_oapg(self) -> bool:
|
||||||
|
@ -2224,6 +2224,7 @@ components:
|
|||||||
multiple
|
multiple
|
||||||
lines
|
lines
|
||||||
- "double quote \n with newline"
|
- "double quote \n with newline"
|
||||||
|
- null
|
||||||
IntegerEnum:
|
IntegerEnum:
|
||||||
type: integer
|
type: integer
|
||||||
enum:
|
enum:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Model Type Info
|
## Model Type Info
|
||||||
Input Type | Accessed Type | Description | Notes
|
Input Type | Accessed Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
bool, | BoolClass, | | must be one of [schemas.BoolClass.FALSE, ]
|
bool, | BoolClass, | | must be one of [False, ]
|
||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Model Type Info
|
## Model Type Info
|
||||||
Input Type | Accessed Type | Description | Notes
|
Input Type | Accessed Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
bool, | BoolClass, | | must be one of [schemas.BoolClass.TRUE, ]
|
bool, | BoolClass, | | must be one of [True, ]
|
||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWith0DoesNotMatchFalse(
|
class EnumWith0DoesNotMatchFalse(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class EnumWith0DoesNotMatchFalse(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
0: "POSITIVE_0",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_0(cls):
|
def POSITIVE_0(cls):
|
||||||
return cls(0)
|
return cls(0)
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWith0DoesNotMatchFalse(
|
class EnumWith0DoesNotMatchFalse(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWith1DoesNotMatchTrue(
|
class EnumWith1DoesNotMatchTrue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class EnumWith1DoesNotMatchTrue(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
1: "POSITIVE_1",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1(cls):
|
def POSITIVE_1(cls):
|
||||||
return cls(1)
|
return cls(1)
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWith1DoesNotMatchTrue(
|
class EnumWith1DoesNotMatchTrue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,12 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithEscapedCharacters(
|
class EnumWithEscapedCharacters(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"foo\nbar": "FOO_BAR",
|
|
||||||
"foo\rbar": "FOO_BAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -38,6 +33,13 @@ class EnumWithEscapedCharacters(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
"foo\nbar": "FOO_BAR",
|
||||||
|
"foo\rbar": "FOO_BAR",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def FOO_BAR(cls):
|
def FOO_BAR(cls):
|
||||||
return cls("foo\nbar")
|
return cls("foo\nbar")
|
||||||
|
@ -24,12 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithEscapedCharacters(
|
class EnumWithEscapedCharacters(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"foo\nbar": "FOO_BAR",
|
|
||||||
"foo\rbar": "FOO_BAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithFalseDoesNotMatch0(
|
class EnumWithFalseDoesNotMatch0(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.FALSE: "FALSE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class EnumWithFalseDoesNotMatch0(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
schemas.BoolClass.FALSE: "FALSE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def FALSE(cls):
|
def FALSE(cls):
|
||||||
return cls(schemas.BoolClass.FALSE)
|
return cls(False)
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithFalseDoesNotMatch0(
|
class EnumWithFalseDoesNotMatch0(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.FALSE: "FALSE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,4 +35,4 @@ class EnumWithFalseDoesNotMatch0(
|
|||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def FALSE(cls):
|
def FALSE(cls):
|
||||||
return cls(schemas.BoolClass.FALSE)
|
return cls(False)
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithTrueDoesNotMatch1(
|
class EnumWithTrueDoesNotMatch1(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.TRUE: "TRUE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class EnumWithTrueDoesNotMatch1(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
schemas.BoolClass.TRUE: "TRUE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def TRUE(cls):
|
def TRUE(cls):
|
||||||
return cls(schemas.BoolClass.TRUE)
|
return cls(True)
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumWithTrueDoesNotMatch1(
|
class EnumWithTrueDoesNotMatch1(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.TRUE: "TRUE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,4 +35,4 @@ class EnumWithTrueDoesNotMatch1(
|
|||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def TRUE(cls):
|
def TRUE(cls):
|
||||||
return cls(schemas.BoolClass.TRUE)
|
return cls(True)
|
||||||
|
@ -42,13 +42,15 @@ class EnumsInProperties(
|
|||||||
|
|
||||||
|
|
||||||
class bar(
|
class bar(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"bar": "BAR",
|
"bar": "BAR",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def BAR(cls):
|
def BAR(cls):
|
||||||
@ -56,13 +58,15 @@ class EnumsInProperties(
|
|||||||
|
|
||||||
|
|
||||||
class foo(
|
class foo(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"foo": "FOO",
|
"foo": "FOO",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def FOO(cls):
|
def FOO(cls):
|
||||||
|
@ -42,11 +42,7 @@ class EnumsInProperties(
|
|||||||
|
|
||||||
|
|
||||||
class bar(
|
class bar(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"bar": "BAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -56,11 +52,7 @@ class EnumsInProperties(
|
|||||||
|
|
||||||
|
|
||||||
class foo(
|
class foo(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"foo": "FOO",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class NulCharactersInStrings(
|
class NulCharactersInStrings(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"hello\x00there": "HELLOTHERE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class NulCharactersInStrings(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
"hello\x00there": "HELLOTHERE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def HELLOTHERE(cls):
|
def HELLOTHERE(cls):
|
||||||
return cls("hello\x00there")
|
return cls("hello\x00there")
|
||||||
|
@ -24,11 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class NulCharactersInStrings(
|
class NulCharactersInStrings(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"hello\x00there": "HELLOTHERE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,13 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class SimpleEnumValidation(
|
class SimpleEnumValidation(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
3: "POSITIVE_3",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,6 +33,14 @@ class SimpleEnumValidation(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
1: "POSITIVE_1",
|
||||||
|
2: "POSITIVE_2",
|
||||||
|
3: "POSITIVE_3",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1(cls):
|
def POSITIVE_1(cls):
|
||||||
return cls(1)
|
return cls(1)
|
||||||
|
@ -24,13 +24,7 @@ from unit_test_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class SimpleEnumValidation(
|
class SimpleEnumValidation(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
3: "POSITIVE_3",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.NumberSchema
|
schemas.NumberSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -411,7 +411,7 @@ class Schema:
|
|||||||
"""
|
"""
|
||||||
cls._process_schema_classes_oapg(schema_classes)
|
cls._process_schema_classes_oapg(schema_classes)
|
||||||
enum_schema = any(
|
enum_schema = any(
|
||||||
hasattr(this_cls, '_enum_value_to_name') for this_cls in schema_classes)
|
issubclass(this_cls, EnumBase) for this_cls in schema_classes)
|
||||||
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
||||||
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
||||||
suffix = tuple(inheritable_primitive_type)
|
suffix = tuple(inheritable_primitive_type)
|
||||||
@ -880,24 +880,7 @@ class ValidatorBase:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumMakerBase:
|
class EnumBase:
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> 'SchemaEnumMaker':
|
|
||||||
class SchemaEnumMaker(EnumMakerBase):
|
|
||||||
@classmethod
|
|
||||||
def _enum_value_to_name(
|
|
||||||
cls
|
|
||||||
) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
super_enum_value_to_name = super()._enum_value_to_name()
|
|
||||||
except AttributeError:
|
|
||||||
return enum_value_to_name
|
|
||||||
intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items())
|
|
||||||
return intersection
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _validate_oapg(
|
def _validate_oapg(
|
||||||
cls,
|
cls,
|
||||||
@ -905,17 +888,15 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str,
|
|||||||
validation_metadata: ValidationMetadata,
|
validation_metadata: ValidationMetadata,
|
||||||
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
||||||
"""
|
"""
|
||||||
SchemaEnumMaker _validate_oapg
|
EnumBase _validate_oapg
|
||||||
Validates that arg is in the enum's allowed values
|
Validates that arg is in the enum's allowed values
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
cls._enum_value_to_name()[arg]
|
cls.MetaOapg.enum_value_to_name[arg]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name()))
|
raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys()))
|
||||||
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
||||||
|
|
||||||
return SchemaEnumMaker
|
|
||||||
|
|
||||||
|
|
||||||
class BoolBase:
|
class BoolBase:
|
||||||
def is_true_oapg(self) -> bool:
|
def is_true_oapg(self) -> bool:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Model Type Info
|
## Model Type Info
|
||||||
Input Type | Accessed Type | Description | Notes
|
Input Type | Accessed Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
bool, | BoolClass, | | must be one of [schemas.BoolClass.TRUE, ]
|
bool, | BoolClass, | | must be one of [True, ]
|
||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Model Type Info
|
## Model Type Info
|
||||||
Input Type | Accessed Type | Description | Notes
|
Input Type | Accessed Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
None, str, | NoneClass, str, | | must be one of ["placed", "approved", "delivered", "single quoted", "multiple\nlines", "double quote \n with newline", ]
|
None, str, | NoneClass, str, | | must be one of ["placed", "approved", "delivered", "single quoted", "multiple\nlines", "double quote \n with newline", None, ]
|
||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ class ArrayWithValidationsInItems(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int64'
|
||||||
inclusive_maximum = 7
|
inclusive_maximum = 7
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
|
@ -42,13 +42,15 @@ class BasquePig(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"BasquePig": "BASQUE_PIG",
|
"BasquePig": "BASQUE_PIG",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def BASQUE_PIG(cls):
|
def BASQUE_PIG(cls):
|
||||||
|
@ -42,11 +42,7 @@ class BasquePig(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"BasquePig": "BASQUE_PIG",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -24,11 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class BooleanEnum(
|
class BooleanEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.TRUE: "TRUE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class BooleanEnum(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
schemas.BoolClass.TRUE: "TRUE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def TRUE(cls):
|
def TRUE(cls):
|
||||||
return cls(schemas.BoolClass.TRUE)
|
return cls(True)
|
||||||
|
@ -24,11 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class BooleanEnum(
|
class BooleanEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.BoolClass.TRUE: "TRUE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.BoolSchema
|
schemas.BoolSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,4 +35,4 @@ class BooleanEnum(
|
|||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def TRUE(cls):
|
def TRUE(cls):
|
||||||
return cls(schemas.BoolClass.TRUE)
|
return cls(True)
|
||||||
|
@ -47,13 +47,15 @@ class ComplexQuadrilateral(
|
|||||||
|
|
||||||
|
|
||||||
class quadrilateralType(
|
class quadrilateralType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"ComplexQuadrilateral": "COMPLEX_QUADRILATERAL",
|
"ComplexQuadrilateral": "COMPLEX_QUADRILATERAL",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def COMPLEX_QUADRILATERAL(cls):
|
def COMPLEX_QUADRILATERAL(cls):
|
||||||
|
@ -47,11 +47,7 @@ class ComplexQuadrilateral(
|
|||||||
|
|
||||||
|
|
||||||
class quadrilateralType(
|
class quadrilateralType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"ComplexQuadrilateral": "COMPLEX_QUADRILATERAL",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -94,6 +94,7 @@ class ComposedOneOfDifferentTypes(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'date-time'
|
||||||
regex=[{
|
regex=[{
|
||||||
'pattern': r'^2020.*', # noqa: E501
|
'pattern': r'^2020.*', # noqa: E501
|
||||||
}]
|
}]
|
||||||
|
@ -24,12 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class Currency(
|
class Currency(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"eur": "EUR",
|
|
||||||
"usd": "USD",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -38,6 +33,13 @@ class Currency(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
"eur": "EUR",
|
||||||
|
"usd": "USD",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def EUR(cls):
|
def EUR(cls):
|
||||||
return cls("eur")
|
return cls("eur")
|
||||||
|
@ -24,12 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class Currency(
|
class Currency(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"eur": "EUR",
|
|
||||||
"usd": "USD",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -42,13 +42,15 @@ class DanishPig(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"DanishPig": "DANISH_PIG",
|
"DanishPig": "DANISH_PIG",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def DANISH_PIG(cls):
|
def DANISH_PIG(cls):
|
||||||
|
@ -42,11 +42,7 @@ class DanishPig(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"DanishPig": "DANISH_PIG",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class DateTimeWithValidations(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'date-time'
|
||||||
regex=[{
|
regex=[{
|
||||||
'pattern': r'^2020.*', # noqa: E501
|
'pattern': r'^2020.*', # noqa: E501
|
||||||
}]
|
}]
|
||||||
|
@ -34,6 +34,7 @@ class DateWithValidations(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'date'
|
||||||
regex=[{
|
regex=[{
|
||||||
'pattern': r'^2020.*', # noqa: E501
|
'pattern': r'^2020.*', # noqa: E501
|
||||||
}]
|
}]
|
||||||
|
@ -39,14 +39,16 @@ class EnumArrays(
|
|||||||
|
|
||||||
|
|
||||||
class just_symbol(
|
class just_symbol(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
">=": "GREATER_THAN_EQUALS",
|
">=": "GREATER_THAN_EQUALS",
|
||||||
"$": "DOLLAR",
|
"$": "DOLLAR",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def GREATER_THAN_EQUALS(cls):
|
def GREATER_THAN_EQUALS(cls):
|
||||||
@ -66,14 +68,16 @@ class EnumArrays(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"fish": "FISH",
|
"fish": "FISH",
|
||||||
"crab": "CRAB",
|
"crab": "CRAB",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def FISH(cls):
|
def FISH(cls):
|
||||||
|
@ -39,12 +39,7 @@ class EnumArrays(
|
|||||||
|
|
||||||
|
|
||||||
class just_symbol(
|
class just_symbol(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
">=": "GREATER_THAN_EQUALS",
|
|
||||||
"$": "DOLLAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -66,12 +61,7 @@ class EnumArrays(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"fish": "FISH",
|
|
||||||
"crab": "CRAB",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -24,15 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumClass(
|
class EnumClass(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"_abc": "_ABC",
|
|
||||||
"-efg": "EFG",
|
|
||||||
"(xyz)": "XYZ",
|
|
||||||
"COUNT_1M": "COUNT_1M",
|
|
||||||
"COUNT_50M": "COUNT_50M",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -41,6 +33,16 @@ class EnumClass(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
"_abc": "_ABC",
|
||||||
|
"-efg": "EFG",
|
||||||
|
"(xyz)": "XYZ",
|
||||||
|
"COUNT_1M": "COUNT_1M",
|
||||||
|
"COUNT_50M": "COUNT_50M",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def _ABC(cls):
|
def _ABC(cls):
|
||||||
return cls("_abc")
|
return cls("_abc")
|
||||||
|
@ -24,15 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class EnumClass(
|
class EnumClass(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"_abc": "_ABC",
|
|
||||||
"-efg": "EFG",
|
|
||||||
"(xyz)": "XYZ",
|
|
||||||
"COUNT_1M": "COUNT_1M",
|
|
||||||
"COUNT_50M": "COUNT_50M",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -42,15 +42,17 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_string_required(
|
class enum_string_required(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"UPPER": "UPPER",
|
"UPPER": "UPPER",
|
||||||
"lower": "LOWER",
|
"lower": "LOWER",
|
||||||
"": "EMPTY",
|
"": "EMPTY",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def UPPER(cls):
|
def UPPER(cls):
|
||||||
@ -66,15 +68,17 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_string(
|
class enum_string(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"UPPER": "UPPER",
|
"UPPER": "UPPER",
|
||||||
"lower": "LOWER",
|
"lower": "LOWER",
|
||||||
"": "EMPTY",
|
"": "EMPTY",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def UPPER(cls):
|
def UPPER(cls):
|
||||||
@ -90,14 +94,17 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_integer(
|
class enum_integer(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.Int32Schema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
format = 'int32'
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
1: "POSITIVE_1",
|
1: "POSITIVE_1",
|
||||||
-1: "NEGATIVE_1",
|
-1: "NEGATIVE_1",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.Int32Schema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1(cls):
|
def POSITIVE_1(cls):
|
||||||
@ -109,14 +116,17 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_number(
|
class enum_number(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.Float64Schema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
format = 'double'
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
1.1: "POSITIVE_1_PT_1",
|
1.1: "POSITIVE_1_PT_1",
|
||||||
-1.2: "NEGATIVE_1_PT_2",
|
-1.2: "NEGATIVE_1_PT_2",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.Float64Schema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1_PT_1(cls):
|
def POSITIVE_1_PT_1(cls):
|
||||||
|
@ -42,13 +42,7 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_string_required(
|
class enum_string_required(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"UPPER": "UPPER",
|
|
||||||
"lower": "LOWER",
|
|
||||||
"": "EMPTY",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -66,13 +60,7 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_string(
|
class enum_string(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"UPPER": "UPPER",
|
|
||||||
"lower": "LOWER",
|
|
||||||
"": "EMPTY",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -90,12 +78,7 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_integer(
|
class enum_integer(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
-1: "NEGATIVE_1",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.Int32Schema
|
schemas.Int32Schema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -109,12 +92,7 @@ class EnumTest(
|
|||||||
|
|
||||||
|
|
||||||
class enum_number(
|
class enum_number(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1.1: "POSITIVE_1_PT_1",
|
|
||||||
-1.2: "NEGATIVE_1_PT_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.Float64Schema
|
schemas.Float64Schema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -47,13 +47,15 @@ class EquilateralTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"EquilateralTriangle": "EQUILATERAL_TRIANGLE",
|
"EquilateralTriangle": "EQUILATERAL_TRIANGLE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def EQUILATERAL_TRIANGLE(cls):
|
def EQUILATERAL_TRIANGLE(cls):
|
||||||
|
@ -47,11 +47,7 @@ class EquilateralTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"EquilateralTriangle": "EQUILATERAL_TRIANGLE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ class FormatTest(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'password'
|
||||||
max_length = 64
|
max_length = 64
|
||||||
min_length = 10
|
min_length = 10
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ class FormatTest(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int32'
|
||||||
inclusive_maximum = 200
|
inclusive_maximum = 200
|
||||||
inclusive_minimum = 20
|
inclusive_minimum = 20
|
||||||
int64 = schemas.Int64Schema
|
int64 = schemas.Int64Schema
|
||||||
@ -96,6 +98,7 @@ class FormatTest(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'float'
|
||||||
inclusive_maximum = 987.6
|
inclusive_maximum = 987.6
|
||||||
inclusive_minimum = 54.3
|
inclusive_minimum = 54.3
|
||||||
float32 = schemas.Float32Schema
|
float32 = schemas.Float32Schema
|
||||||
@ -107,6 +110,7 @@ class FormatTest(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'double'
|
||||||
inclusive_maximum = 123.4
|
inclusive_maximum = 123.4
|
||||||
inclusive_minimum = 67.8
|
inclusive_minimum = 67.8
|
||||||
float64 = schemas.Float64Schema
|
float64 = schemas.Float64Schema
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnum(
|
class IntegerEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,6 +33,14 @@ class IntegerEnum(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
0: "POSITIVE_0",
|
||||||
|
1: "POSITIVE_1",
|
||||||
|
2: "POSITIVE_2",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_0(cls):
|
def POSITIVE_0(cls):
|
||||||
return cls(0)
|
return cls(0)
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnum(
|
class IntegerEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumBig(
|
class IntegerEnumBig(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
10: "POSITIVE_10",
|
|
||||||
11: "POSITIVE_11",
|
|
||||||
12: "POSITIVE_12",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,6 +33,14 @@ class IntegerEnumBig(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
10: "POSITIVE_10",
|
||||||
|
11: "POSITIVE_11",
|
||||||
|
12: "POSITIVE_12",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_10(cls):
|
def POSITIVE_10(cls):
|
||||||
return cls(10)
|
return cls(10)
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumBig(
|
class IntegerEnumBig(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
10: "POSITIVE_10",
|
|
||||||
11: "POSITIVE_11",
|
|
||||||
12: "POSITIVE_12",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,11 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumOneValue(
|
class IntegerEnumOneValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -37,6 +33,12 @@ class IntegerEnumOneValue(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
0: "POSITIVE_0",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_0(cls):
|
def POSITIVE_0(cls):
|
||||||
return cls(0)
|
return cls(0)
|
||||||
|
@ -24,11 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumOneValue(
|
class IntegerEnumOneValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumWithDefaultValue(
|
class IntegerEnumWithDefaultValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,6 +33,14 @@ class IntegerEnumWithDefaultValue(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
0: "POSITIVE_0",
|
||||||
|
1: "POSITIVE_1",
|
||||||
|
2: "POSITIVE_2",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_0(cls):
|
def POSITIVE_0(cls):
|
||||||
return cls(0)
|
return cls(0)
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class IntegerEnumWithDefaultValue(
|
class IntegerEnumWithDefaultValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
0: "POSITIVE_0",
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
2: "POSITIVE_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.IntSchema
|
schemas.IntSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -34,4 +34,5 @@ class IntegerMax10(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int64'
|
||||||
inclusive_maximum = 10
|
inclusive_maximum = 10
|
||||||
|
@ -34,4 +34,5 @@ class IntegerMin15(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int64'
|
||||||
inclusive_minimum = 15
|
inclusive_minimum = 15
|
||||||
|
@ -47,13 +47,15 @@ class IsoscelesTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"IsoscelesTriangle": "ISOSCELES_TRIANGLE",
|
"IsoscelesTriangle": "ISOSCELES_TRIANGLE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def ISOSCELES_TRIANGLE(cls):
|
def ISOSCELES_TRIANGLE(cls):
|
||||||
|
@ -47,11 +47,7 @@ class IsoscelesTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"IsoscelesTriangle": "ISOSCELES_TRIANGLE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -46,15 +46,17 @@ class JSONPatchRequestAddReplaceTest(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"add": "ADD",
|
"add": "ADD",
|
||||||
"replace": "REPLACE",
|
"replace": "REPLACE",
|
||||||
"test": "TEST",
|
"test": "TEST",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def ADD(cls):
|
def ADD(cls):
|
||||||
|
@ -46,13 +46,7 @@ class JSONPatchRequestAddReplaceTest(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"add": "ADD",
|
|
||||||
"replace": "REPLACE",
|
|
||||||
"test": "TEST",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -46,14 +46,16 @@ class JSONPatchRequestMoveCopy(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"move": "MOVE",
|
"move": "MOVE",
|
||||||
"copy": "COPY",
|
"copy": "COPY",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def MOVE(cls):
|
def MOVE(cls):
|
||||||
|
@ -46,12 +46,7 @@ class JSONPatchRequestMoveCopy(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"move": "MOVE",
|
|
||||||
"copy": "COPY",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -44,13 +44,15 @@ class JSONPatchRequestRemove(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"remove": "REMOVE",
|
"remove": "REMOVE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def REMOVE(cls):
|
def REMOVE(cls):
|
||||||
|
@ -44,11 +44,7 @@ class JSONPatchRequestRemove(
|
|||||||
|
|
||||||
|
|
||||||
class op(
|
class op(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"remove": "REMOVE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -104,14 +104,16 @@ class MapTest(
|
|||||||
|
|
||||||
|
|
||||||
class additional_properties(
|
class additional_properties(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"UPPER": "UPPER",
|
"UPPER": "UPPER",
|
||||||
"lower": "LOWER",
|
"lower": "LOWER",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def UPPER(cls):
|
def UPPER(cls):
|
||||||
|
@ -104,12 +104,7 @@ class MapTest(
|
|||||||
|
|
||||||
|
|
||||||
class additional_properties(
|
class additional_properties(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"UPPER": "UPPER",
|
|
||||||
"lower": "LOWER",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -43,15 +43,17 @@ class Order(
|
|||||||
|
|
||||||
|
|
||||||
class status(
|
class status(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"placed": "PLACED",
|
"placed": "PLACED",
|
||||||
"approved": "APPROVED",
|
"approved": "APPROVED",
|
||||||
"delivered": "DELIVERED",
|
"delivered": "DELIVERED",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def PLACED(cls):
|
def PLACED(cls):
|
||||||
|
@ -43,13 +43,7 @@ class Order(
|
|||||||
|
|
||||||
|
|
||||||
class status(
|
class status(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"placed": "PLACED",
|
|
||||||
"approved": "APPROVED",
|
|
||||||
"delivered": "DELIVERED",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -100,15 +100,17 @@ class Pet(
|
|||||||
|
|
||||||
|
|
||||||
class status(
|
class status(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"available": "AVAILABLE",
|
"available": "AVAILABLE",
|
||||||
"pending": "PENDING",
|
"pending": "PENDING",
|
||||||
"sold": "SOLD",
|
"sold": "SOLD",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def AVAILABLE(cls):
|
def AVAILABLE(cls):
|
||||||
|
@ -100,13 +100,7 @@ class Pet(
|
|||||||
|
|
||||||
|
|
||||||
class status(
|
class status(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"available": "AVAILABLE",
|
|
||||||
"pending": "PENDING",
|
|
||||||
"sold": "SOLD",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -43,13 +43,15 @@ class QuadrilateralInterface(
|
|||||||
|
|
||||||
|
|
||||||
class shapeType(
|
class shapeType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"Quadrilateral": "QUADRILATERAL",
|
"Quadrilateral": "QUADRILATERAL",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def QUADRILATERAL(cls):
|
def QUADRILATERAL(cls):
|
||||||
|
@ -43,11 +43,7 @@ class QuadrilateralInterface(
|
|||||||
|
|
||||||
|
|
||||||
class shapeType(
|
class shapeType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"Quadrilateral": "QUADRILATERAL",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -47,13 +47,15 @@ class ScaleneTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"ScaleneTriangle": "SCALENE_TRIANGLE",
|
"ScaleneTriangle": "SCALENE_TRIANGLE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def SCALENE_TRIANGLE(cls):
|
def SCALENE_TRIANGLE(cls):
|
||||||
|
@ -47,11 +47,7 @@ class ScaleneTriangle(
|
|||||||
|
|
||||||
|
|
||||||
class triangleType(
|
class triangleType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"ScaleneTriangle": "SCALENE_TRIANGLE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -47,13 +47,15 @@ class SimpleQuadrilateral(
|
|||||||
|
|
||||||
|
|
||||||
class quadrilateralType(
|
class quadrilateralType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"SimpleQuadrilateral": "SIMPLE_QUADRILATERAL",
|
"SimpleQuadrilateral": "SIMPLE_QUADRILATERAL",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def SIMPLE_QUADRILATERAL(cls):
|
def SIMPLE_QUADRILATERAL(cls):
|
||||||
|
@ -47,11 +47,7 @@ class SimpleQuadrilateral(
|
|||||||
|
|
||||||
|
|
||||||
class quadrilateralType(
|
class quadrilateralType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"SimpleQuadrilateral": "SIMPLE_QUADRILATERAL",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -24,17 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class StringEnum(
|
class StringEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.NoneClass.NONE: "NONE",
|
|
||||||
"placed": "PLACED",
|
|
||||||
"approved": "APPROVED",
|
|
||||||
"delivered": "DELIVERED",
|
|
||||||
"single quoted": "SINGLE_QUOTED",
|
|
||||||
"multiple\nlines": "MULTIPLE_LINES",
|
|
||||||
"double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrBase,
|
schemas.StrBase,
|
||||||
schemas.NoneBase,
|
schemas.NoneBase,
|
||||||
schemas.Schema,
|
schemas.Schema,
|
||||||
@ -46,9 +36,17 @@ class StringEnum(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@schemas.classproperty
|
|
||||||
def NONE(cls):
|
class MetaOapg:
|
||||||
return cls(None)
|
enum_value_to_name = {
|
||||||
|
"placed": "PLACED",
|
||||||
|
"approved": "APPROVED",
|
||||||
|
"delivered": "DELIVERED",
|
||||||
|
"single quoted": "SINGLE_QUOTED",
|
||||||
|
"multiple\nlines": "MULTIPLE_LINES",
|
||||||
|
"double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE",
|
||||||
|
schemas.NoneClass.NONE: "NONE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def PLACED(cls):
|
def PLACED(cls):
|
||||||
@ -74,6 +72,10 @@ class StringEnum(
|
|||||||
def DOUBLE_QUOTE_WITH_NEWLINE(cls):
|
def DOUBLE_QUOTE_WITH_NEWLINE(cls):
|
||||||
return cls("double quote \n with newline")
|
return cls("double quote \n with newline")
|
||||||
|
|
||||||
|
@schemas.classproperty
|
||||||
|
def NONE(cls):
|
||||||
|
return cls(None)
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
@ -24,17 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class StringEnum(
|
class StringEnum(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
schemas.NoneClass.NONE: "NONE",
|
|
||||||
"placed": "PLACED",
|
|
||||||
"approved": "APPROVED",
|
|
||||||
"delivered": "DELIVERED",
|
|
||||||
"single quoted": "SINGLE_QUOTED",
|
|
||||||
"multiple\nlines": "MULTIPLE_LINES",
|
|
||||||
"double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrBase,
|
schemas.StrBase,
|
||||||
schemas.NoneBase,
|
schemas.NoneBase,
|
||||||
schemas.Schema,
|
schemas.Schema,
|
||||||
@ -46,9 +36,17 @@ class StringEnum(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@schemas.classproperty
|
|
||||||
def NONE(cls):
|
class MetaOapg:
|
||||||
return cls(None)
|
enum_value_to_name = {
|
||||||
|
"placed": "PLACED",
|
||||||
|
"approved": "APPROVED",
|
||||||
|
"delivered": "DELIVERED",
|
||||||
|
"single quoted": "SINGLE_QUOTED",
|
||||||
|
"multiple\nlines": "MULTIPLE_LINES",
|
||||||
|
"double quote \n with newline": "DOUBLE_QUOTE_WITH_NEWLINE",
|
||||||
|
schemas.NoneClass.NONE: "NONE",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def PLACED(cls):
|
def PLACED(cls):
|
||||||
@ -74,6 +72,10 @@ class StringEnum(
|
|||||||
def DOUBLE_QUOTE_WITH_NEWLINE(cls):
|
def DOUBLE_QUOTE_WITH_NEWLINE(cls):
|
||||||
return cls("double quote \n with newline")
|
return cls("double quote \n with newline")
|
||||||
|
|
||||||
|
@schemas.classproperty
|
||||||
|
def NONE(cls):
|
||||||
|
return cls(None)
|
||||||
|
|
||||||
|
|
||||||
def __new__(
|
def __new__(
|
||||||
cls,
|
cls,
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class StringEnumWithDefaultValue(
|
class StringEnumWithDefaultValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"placed": "PLACED",
|
|
||||||
"approved": "APPROVED",
|
|
||||||
"delivered": "DELIVERED",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
@ -39,6 +33,14 @@ class StringEnumWithDefaultValue(
|
|||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
enum_value_to_name = {
|
||||||
|
"placed": "PLACED",
|
||||||
|
"approved": "APPROVED",
|
||||||
|
"delivered": "DELIVERED",
|
||||||
|
}
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def PLACED(cls):
|
def PLACED(cls):
|
||||||
return cls("placed")
|
return cls("placed")
|
||||||
|
@ -24,13 +24,7 @@ from petstore_api import schemas # noqa: F401
|
|||||||
|
|
||||||
|
|
||||||
class StringEnumWithDefaultValue(
|
class StringEnumWithDefaultValue(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"placed": "PLACED",
|
|
||||||
"approved": "APPROVED",
|
|
||||||
"delivered": "DELIVERED",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
"""NOTE: This class is auto generated by OpenAPI Generator.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
@ -43,13 +43,15 @@ class TriangleInterface(
|
|||||||
|
|
||||||
|
|
||||||
class shapeType(
|
class shapeType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"Triangle": "TRIANGLE",
|
"Triangle": "TRIANGLE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def TRIANGLE(cls):
|
def TRIANGLE(cls):
|
||||||
|
@ -43,11 +43,7 @@ class TriangleInterface(
|
|||||||
|
|
||||||
|
|
||||||
class shapeType(
|
class shapeType(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"Triangle": "TRIANGLE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -34,4 +34,5 @@ class UUIDString(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'uuid'
|
||||||
min_length = 1
|
min_length = 1
|
||||||
|
@ -42,13 +42,15 @@ class Whale(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"whale": "WHALE",
|
"whale": "WHALE",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def WHALE(cls):
|
def WHALE(cls):
|
||||||
|
@ -42,11 +42,7 @@ class Whale(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"whale": "WHALE",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -42,13 +42,15 @@ class Zebra(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"zebra": "ZEBRA",
|
"zebra": "ZEBRA",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def ZEBRA(cls):
|
def ZEBRA(cls):
|
||||||
@ -56,15 +58,17 @@ class Zebra(
|
|||||||
|
|
||||||
|
|
||||||
class type(
|
class type(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"plains": "PLAINS",
|
"plains": "PLAINS",
|
||||||
"mountain": "MOUNTAIN",
|
"mountain": "MOUNTAIN",
|
||||||
"grevys": "GREVYS",
|
"grevys": "GREVYS",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def PLAINS(cls):
|
def PLAINS(cls):
|
||||||
|
@ -42,11 +42,7 @@ class Zebra(
|
|||||||
|
|
||||||
|
|
||||||
class className(
|
class className(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"zebra": "ZEBRA",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -56,13 +52,7 @@ class Zebra(
|
|||||||
|
|
||||||
|
|
||||||
class type(
|
class type(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"plains": "PLAINS",
|
|
||||||
"mountain": "MOUNTAIN",
|
|
||||||
"grevys": "GREVYS",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -39,14 +39,16 @@ class EnumQueryStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
">": "GREATER_THAN",
|
">": "GREATER_THAN",
|
||||||
"$": "DOLLAR",
|
"$": "DOLLAR",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def GREATER_THAN(cls):
|
def GREATER_THAN(cls):
|
||||||
@ -72,15 +74,17 @@ class EnumQueryStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryStringSchema(
|
class EnumQueryStringSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"_abc": "_ABC",
|
"_abc": "_ABC",
|
||||||
"-efg": "EFG",
|
"-efg": "EFG",
|
||||||
"(xyz)": "XYZ",
|
"(xyz)": "XYZ",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def _ABC(cls):
|
def _ABC(cls):
|
||||||
@ -96,14 +100,17 @@ class EnumQueryStringSchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryIntegerSchema(
|
class EnumQueryIntegerSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.Int32Schema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
format = 'int32'
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
1: "POSITIVE_1",
|
1: "POSITIVE_1",
|
||||||
-2: "NEGATIVE_2",
|
-2: "NEGATIVE_2",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.Int32Schema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1(cls):
|
def POSITIVE_1(cls):
|
||||||
@ -115,14 +122,17 @@ class EnumQueryIntegerSchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryDoubleSchema(
|
class EnumQueryDoubleSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.Float64Schema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
|
format = 'double'
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
1.1: "POSITIVE_1_PT_1",
|
1.1: "POSITIVE_1_PT_1",
|
||||||
-1.2: "NEGATIVE_1_PT_2",
|
-1.2: "NEGATIVE_1_PT_2",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.Float64Schema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def POSITIVE_1_PT_1(cls):
|
def POSITIVE_1_PT_1(cls):
|
||||||
@ -188,14 +198,16 @@ class EnumHeaderStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
">": "GREATER_THAN",
|
">": "GREATER_THAN",
|
||||||
"$": "DOLLAR",
|
"$": "DOLLAR",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def GREATER_THAN(cls):
|
def GREATER_THAN(cls):
|
||||||
@ -221,15 +233,17 @@ class EnumHeaderStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumHeaderStringSchema(
|
class EnumHeaderStringSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"_abc": "_ABC",
|
"_abc": "_ABC",
|
||||||
"-efg": "EFG",
|
"-efg": "EFG",
|
||||||
"(xyz)": "XYZ",
|
"(xyz)": "XYZ",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def _ABC(cls):
|
def _ABC(cls):
|
||||||
@ -293,14 +307,16 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
">": "GREATER_THAN",
|
">": "GREATER_THAN",
|
||||||
"$": "DOLLAR",
|
"$": "DOLLAR",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def GREATER_THAN(cls):
|
def GREATER_THAN(cls):
|
||||||
@ -326,15 +342,17 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class enum_form_string(
|
class enum_form_string(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"_abc": "_ABC",
|
"_abc": "_ABC",
|
||||||
"-efg": "EFG",
|
"-efg": "EFG",
|
||||||
"(xyz)": "XYZ",
|
"(xyz)": "XYZ",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def _ABC(cls):
|
def _ABC(cls):
|
||||||
|
@ -37,12 +37,7 @@ class EnumQueryStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
">": "GREATER_THAN",
|
|
||||||
"$": "DOLLAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -70,13 +65,7 @@ class EnumQueryStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryStringSchema(
|
class EnumQueryStringSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"_abc": "_ABC",
|
|
||||||
"-efg": "EFG",
|
|
||||||
"(xyz)": "XYZ",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -94,12 +83,7 @@ class EnumQueryStringSchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryIntegerSchema(
|
class EnumQueryIntegerSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1: "POSITIVE_1",
|
|
||||||
-2: "NEGATIVE_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.Int32Schema
|
schemas.Int32Schema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -113,12 +97,7 @@ class EnumQueryIntegerSchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumQueryDoubleSchema(
|
class EnumQueryDoubleSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
1.1: "POSITIVE_1_PT_1",
|
|
||||||
-1.2: "NEGATIVE_1_PT_2",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.Float64Schema
|
schemas.Float64Schema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -141,12 +120,7 @@ class EnumHeaderStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
">": "GREATER_THAN",
|
|
||||||
"$": "DOLLAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -174,13 +148,7 @@ class EnumHeaderStringArraySchema(
|
|||||||
|
|
||||||
|
|
||||||
class EnumHeaderStringSchema(
|
class EnumHeaderStringSchema(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"_abc": "_ABC",
|
|
||||||
"-efg": "EFG",
|
|
||||||
"(xyz)": "XYZ",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -217,12 +185,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
">": "GREATER_THAN",
|
|
||||||
"$": "DOLLAR",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
@ -250,13 +213,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class enum_form_string(
|
class enum_form_string(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"_abc": "_ABC",
|
|
||||||
"-efg": "EFG",
|
|
||||||
"(xyz)": "XYZ",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int32'
|
||||||
inclusive_maximum = 200
|
inclusive_maximum = 200
|
||||||
inclusive_minimum = 20
|
inclusive_minimum = 20
|
||||||
int64 = schemas.Int64Schema
|
int64 = schemas.Int64Schema
|
||||||
@ -83,6 +84,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'float'
|
||||||
inclusive_maximum = 987.6
|
inclusive_maximum = 987.6
|
||||||
|
|
||||||
|
|
||||||
@ -92,6 +94,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'double'
|
||||||
inclusive_maximum = 123.4
|
inclusive_maximum = 123.4
|
||||||
inclusive_minimum = 67.8
|
inclusive_minimum = 67.8
|
||||||
|
|
||||||
@ -131,6 +134,7 @@ class SchemaForRequestBodyApplicationXWwwFormUrlencoded(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'password'
|
||||||
max_length = 64
|
max_length = 64
|
||||||
min_length = 10
|
min_length = 10
|
||||||
callback = schemas.StrSchema
|
callback = schemas.StrSchema
|
||||||
|
@ -41,15 +41,17 @@ class StatusSchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
|
schemas.StrSchema
|
||||||
|
):
|
||||||
|
|
||||||
|
|
||||||
|
class MetaOapg:
|
||||||
enum_value_to_name = {
|
enum_value_to_name = {
|
||||||
"available": "AVAILABLE",
|
"available": "AVAILABLE",
|
||||||
"pending": "PENDING",
|
"pending": "PENDING",
|
||||||
"sold": "SOLD",
|
"sold": "SOLD",
|
||||||
}
|
}
|
||||||
),
|
|
||||||
schemas.StrSchema
|
|
||||||
):
|
|
||||||
|
|
||||||
@schemas.classproperty
|
@schemas.classproperty
|
||||||
def AVAILABLE(cls):
|
def AVAILABLE(cls):
|
||||||
|
@ -39,13 +39,7 @@ class StatusSchema(
|
|||||||
|
|
||||||
|
|
||||||
class items(
|
class items(
|
||||||
schemas.SchemaEnumMakerClsFactory(
|
schemas.EnumBase,
|
||||||
enum_value_to_name={
|
|
||||||
"available": "AVAILABLE",
|
|
||||||
"pending": "PENDING",
|
|
||||||
"sold": "SOLD",
|
|
||||||
}
|
|
||||||
),
|
|
||||||
schemas.StrSchema
|
schemas.StrSchema
|
||||||
):
|
):
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class OrderIdSchema(
|
|||||||
|
|
||||||
|
|
||||||
class MetaOapg:
|
class MetaOapg:
|
||||||
|
format = 'int64'
|
||||||
inclusive_maximum = 5
|
inclusive_maximum = 5
|
||||||
inclusive_minimum = 1
|
inclusive_minimum = 1
|
||||||
RequestRequiredPathParams = typing_extensions.TypedDict(
|
RequestRequiredPathParams = typing_extensions.TypedDict(
|
||||||
|
@ -411,7 +411,7 @@ class Schema:
|
|||||||
"""
|
"""
|
||||||
cls._process_schema_classes_oapg(schema_classes)
|
cls._process_schema_classes_oapg(schema_classes)
|
||||||
enum_schema = any(
|
enum_schema = any(
|
||||||
hasattr(this_cls, '_enum_value_to_name') for this_cls in schema_classes)
|
issubclass(this_cls, EnumBase) for this_cls in schema_classes)
|
||||||
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
inheritable_primitive_type = schema_classes.intersection(cls.__inheritable_primitive_types_set)
|
||||||
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
chosen_schema_classes = schema_classes - inheritable_primitive_type
|
||||||
suffix = tuple(inheritable_primitive_type)
|
suffix = tuple(inheritable_primitive_type)
|
||||||
@ -880,24 +880,7 @@ class ValidatorBase:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class EnumMakerBase:
|
class EnumBase:
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]) -> 'SchemaEnumMaker':
|
|
||||||
class SchemaEnumMaker(EnumMakerBase):
|
|
||||||
@classmethod
|
|
||||||
def _enum_value_to_name(
|
|
||||||
cls
|
|
||||||
) -> typing.Dict[typing.Union[str, decimal.Decimal, bool, none_type], str]:
|
|
||||||
pass
|
|
||||||
try:
|
|
||||||
super_enum_value_to_name = super()._enum_value_to_name()
|
|
||||||
except AttributeError:
|
|
||||||
return enum_value_to_name
|
|
||||||
intersection = dict(enum_value_to_name.items() & super_enum_value_to_name.items())
|
|
||||||
return intersection
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _validate_oapg(
|
def _validate_oapg(
|
||||||
cls,
|
cls,
|
||||||
@ -905,17 +888,15 @@ def SchemaEnumMakerClsFactory(enum_value_to_name: typing.Dict[typing.Union[str,
|
|||||||
validation_metadata: ValidationMetadata,
|
validation_metadata: ValidationMetadata,
|
||||||
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
) -> typing.Dict[typing.Tuple[typing.Union[str, int], ...], typing.Set[typing.Union['Schema', str, decimal.Decimal, BoolClass, NoneClass, frozendict.frozendict, tuple]]]:
|
||||||
"""
|
"""
|
||||||
SchemaEnumMaker _validate_oapg
|
EnumBase _validate_oapg
|
||||||
Validates that arg is in the enum's allowed values
|
Validates that arg is in the enum's allowed values
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
cls._enum_value_to_name()[arg]
|
cls.MetaOapg.enum_value_to_name[arg]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise ApiValueError("Invalid value {} passed in to {}, {}".format(arg, cls, cls._enum_value_to_name()))
|
raise ApiValueError("Invalid value {} passed in to {}, allowed_values={}".format(arg, cls, cls.MetaOapg.enum_value_to_name.keys()))
|
||||||
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
return super()._validate_oapg(arg, validation_metadata=validation_metadata)
|
||||||
|
|
||||||
return SchemaEnumMaker
|
|
||||||
|
|
||||||
|
|
||||||
class BoolBase:
|
class BoolBase:
|
||||||
def is_true_oapg(self) -> bool:
|
def is_true_oapg(self) -> bool:
|
||||||
|
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