[python] Fixes additional_properties_type for models (#8802)

* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests

* Moves this.setDisallowAdditionalPropertiesIfNotPresent higher

* Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two

* Fixes oneOf anyOf allOf instantiation logic

* Removes Address from Cat definition

* Adds required vars for apple and banana, removes required vars from composed schema init sig

* Updates composed schema vars to be set on self and all composed instances

* Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances

* Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps

* Fixes FruitReq tests

* Fixes GmFruit tests

* Fixes discard_unknown_keys tests

* Samples updated

* Removes additionalproperties False in Child

* Samples updated

* Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug

* Adds cli option disallowAdditionalPropertiesIfNotPresent to python

* Adds getAdditionalProperties method so the value for addProps will be correct

* Reverts file

* Reverts file

* Updates python doc

* Reverted anytype_3 definition

* Updates test_deserialize_lizard

* Updates test_deserialize_dict_str_dog

* Updates testDog

* Updates testChild

* Adds v2 python_composition sample

* Adds needed files for python testing

* Adds existing tests into the new python sample

* Fixes test_dog

* Removes addProps false form Dog

* Fixes testChild

* Updates how additionalProperties are set

* Fixes empty_map type

* Type generation fixed for v2 and v3 specs

* Refactors getTypeString, updates artifactids in pom.xml files

* Adds new python sample to CI testing I think

* Fixes artifactId collision, regenrates docs
This commit is contained in:
Justin Black
2021-03-31 08:48:12 -07:00
committed by GitHub
parent 3973d4c831
commit 6cc270633b
539 changed files with 32476 additions and 1617 deletions

View File

@@ -1,7 +1,10 @@
# this file exists because in this file we omit setting disallowAdditionalPropertiesIfNotPresent
# which makes it default to false
# that false setting is needed for composed schemas to work
# Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword.
generatorName: python generatorName: python
outputDir: samples/client/petstore/python outputDir: samples/client/petstore/python
inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/python templateDir: modules/openapi-generator/src/main/resources/python
additionalProperties: additionalProperties:
disallowAdditionalPropertiesIfNotPresent: "true"
packageName: petstore_api packageName: petstore_api

View File

@@ -0,0 +1,7 @@
generatorName: python
outputDir: samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent
inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/python
additionalProperties:
disallowAdditionalPropertiesIfNotPresent: "true"
packageName: petstore_api

View File

@@ -7,6 +7,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Option | Description | Values | Default | | Option | Description | Values | Default |
| ------ | ----------- | ------ | ------- | | ------ | ----------- | ------ | ------- |
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|<dl><dt>**false**</dt><dd>The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.</dd><dt>**true**</dt><dd>Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: this option breaks composition and will be removed in 6.0.0</dd></dl>|false|
|generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false| |generateSourceCodeOnly|Specifies that only a library source code is to be generated.| |false|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true|
|library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3| |library|library template (sub-template) to use: asyncio, tornado, urllib3| |urllib3|
@@ -28,7 +29,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
| Type/Alias | Instantiated By | | Type/Alias | Instantiated By |
| ---------- | --------------- | | ---------- | --------------- |
|map|dict|
## LANGUAGE PRIMITIVES ## LANGUAGE PRIMITIVES

View File

@@ -65,10 +65,6 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
// in other code generators, support needs to be enabled on a case-by-case basis. // in other code generators, support needs to be enabled on a case-by-case basis.
supportsAdditionalPropertiesWithComposedSchema = true; supportsAdditionalPropertiesWithComposedSchema = true;
// When the 'additionalProperties' keyword is not present in a OAS schema, allow
// undeclared properties. This is compliant with the JSON schema specification.
this.setDisallowAdditionalPropertiesIfNotPresent(false);
modifyFeatureSet(features -> features modifyFeatureSet(features -> features
.includeDocumentationFeatures(DocumentationFeature.Readme) .includeDocumentationFeatures(DocumentationFeature.Readme)
.wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom)) .wireFormatFeatures(EnumSet.of(WireFormatFeature.JSON, WireFormatFeature.XML, WireFormatFeature.Custom))
@@ -94,9 +90,8 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
ParameterFeature.Cookie ParameterFeature.Cookie
) )
); );
// needed for type object with additionalProperties: false
// this may set datatype right for additional properties typeMapping.put("object", "dict");
instantiationTypes.put("map", "dict");
languageSpecificPrimitives.add("file_type"); languageSpecificPrimitives.add("file_type");
languageSpecificPrimitives.add("none_type"); languageSpecificPrimitives.add("none_type");
@@ -111,6 +106,20 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC) cliOptions.add(new CliOption(CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET, CodegenConstants.PYTHON_ATTR_NONE_IF_UNSET_DESC)
.defaultValue(Boolean.FALSE.toString())); .defaultValue(Boolean.FALSE.toString()));
// option to change how we process + set the data in the 'additionalProperties' keyword.
CliOption disallowAdditionalPropertiesIfNotPresentOpt = CliOption.newBoolean(
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT,
CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC).defaultValue(Boolean.FALSE.toString());
Map<String, String> disallowAdditionalPropertiesIfNotPresentOpts = new HashMap<>();
disallowAdditionalPropertiesIfNotPresentOpts.put("false",
"The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.");
disallowAdditionalPropertiesIfNotPresentOpts.put("true",
"Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. NOTE: "+
"this option breaks composition and will be removed in 6.0.0"
);
disallowAdditionalPropertiesIfNotPresentOpt.setEnum(disallowAdditionalPropertiesIfNotPresentOpts);
cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt);
generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata) generatorMetadata = GeneratorMetadata.newBuilder(generatorMetadata)
.stability(Stability.EXPERIMENTAL) .stability(Stability.EXPERIMENTAL)
.build(); .build();
@@ -160,6 +169,18 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
} }
additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset); additionalProperties.put("attrNoneIfUnset", attrNoneIfUnset);
// When the 'additionalProperties' keyword is not present in a OAS schema, allow
// undeclared properties. This is compliant with the JSON schema specification.
// setting this to false is required to have composed schemas work because:
// anyOf SchemaA + SchemaB, requires that props present only in A are accepted in B because in B
// they are additional properties
Boolean disallowAddProps = false;
if (additionalProperties.containsKey(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)) {
disallowAddProps = Boolean.valueOf(additionalProperties.get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString());
}
this.setDisallowAdditionalPropertiesIfNotPresent(disallowAddProps);
// check library option to ensure only urllib3 is supported // check library option to ensure only urllib3 is supported
if (!DEFAULT_LIBRARY.equals(getLibrary())) { if (!DEFAULT_LIBRARY.equals(getLibrary())) {
throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator."); throw new RuntimeException("Only the `urllib3` library is supported in the refactored `python` client generator at the moment. Please fall back to `python-legacy` client generator for the time being. We welcome contributions to add back `asyncio`, `tornado` support to the `python` client generator.");
@@ -728,6 +749,62 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
return null; return null;
} }
@Override
protected Schema getAdditionalProperties(Schema schema) {
/*
Use cases:
1. addProps set to schema in spec: return that schema
2. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent -> null
3. addProps unset w/ getDisallowAdditionalPropertiesIfNotPresent=False -> new Schema()
4. addProps true -> new Schema() NOTE: v3 only
5. addprops false -> null NOTE: v3 only
*/
Object addProps = schema.getAdditionalProperties();
if (addProps instanceof Schema) {
return (Schema) addProps;
}
if (addProps == null) {
// When reaching this code path, this should indicate the 'additionalProperties' keyword is
// not present in the OAS schema. This is true for OAS 3.0 documents.
// However, the parsing logic is broken for OAS 2.0 documents because of the
// https://github.com/swagger-api/swagger-parser/issues/1369 issue.
// When OAS 2.0 documents are parsed, the swagger-v2-converter ignores the 'additionalProperties'
// keyword if the value is boolean. That means codegen is unable to determine whether
// additional properties are allowed or not.
//
// The original behavior was to assume additionalProperties had been set to false.
if (getDisallowAdditionalPropertiesIfNotPresent()) {
// If the 'additionalProperties' keyword is not present in a OAS schema,
// interpret as if the 'additionalProperties' keyword had been set to false.
// This is NOT compliant with the JSON schema specification. It is the original
// 'openapi-generator' behavior.
return null;
}
/*
// The disallowAdditionalPropertiesIfNotPresent CLI option has been set to true,
// but for now that only works with OAS 3.0 documents.
// The new behavior does not work with OAS 2.0 documents.
if (extensions == null || !extensions.containsKey(EXTENSION_OPENAPI_DOC_VERSION)) {
// Fallback to the legacy behavior.
return null;
}
// Get original swagger version from OAS extension.
// Note openAPI.getOpenapi() is always set to 3.x even when the document
// is converted from a OAS/Swagger 2.0 document.
// https://github.com/swagger-api/swagger-parser/pull/1374
SemVer version = new SemVer((String)extensions.get(EXTENSION_OPENAPI_DOC_VERSION));
if (version.major != 3) {
return null;
}
*/
}
if (addProps == null || (addProps instanceof Boolean && (Boolean) addProps)) {
// Return empty schema to allow any type
return new Schema();
}
return null;
}
/** /**
* Return a string representation of the Python types for the specified OAS schema. * Return a string representation of the Python types for the specified OAS schema.
* Primitive types in the OAS specification are implemented in Python using the corresponding * Primitive types in the OAS specification are implemented in Python using the corresponding
@@ -767,16 +844,39 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
} }
} }
if (isAnyTypeSchema(p)) { if (isAnyTypeSchema(p)) {
// for v2 specs only, swagger-parser never generates an AnyType schemas even though it should generate them
// https://github.com/swagger-api/swagger-parser/issues/1378
// switch to v3 if you need AnyType to work
return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix; return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + suffix;
} }
String originalSpecVersion = "X";
if (this.openAPI.getExtensions() != null && this.openAPI.getExtensions().containsKey("x-original-swagger-version")) {
originalSpecVersion = (String) this.openAPI.getExtensions().get("x-original-swagger-version");
originalSpecVersion = originalSpecVersion.substring(0, 1);
}
Boolean v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase = (getAdditionalProperties(p) == null && this.getDisallowAdditionalPropertiesIfNotPresent() && originalSpecVersion.equals("2"));
Schema emptySchema = new Schema();
Boolean v2WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("2"));
if (isFreeFormObject(p) && (v2DisallowAdditionalPropertiesIfNotPresentAddPropsNullCase || v2WithCompositionAddPropsAnyTypeSchemaCase)) {
// for v2 specs only, input AnyType schemas (type unset) or schema {} results in FreeFromObject schemas
// per https://github.com/swagger-api/swagger-parser/issues/1378
// v2 spec uses cases
// 1. AnyType schemas
// 2. type object schema with no other info
// use case 1 + 2 -> both become use case 1
// switch to v3 if you need use cases 1 + 2 to work correctly
return prefix + "bool, date, datetime, dict, float, int, list, str, none_type" + fullSuffix;
}
// Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references. // Resolve $ref because ModelUtils.isXYZ methods do not automatically resolve references.
if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) { if (ModelUtils.isNullable(ModelUtils.getReferencedSchema(this.openAPI, p))) {
fullSuffix = ", none_type" + suffix; fullSuffix = ", none_type" + suffix;
} }
if (isFreeFormObject(p) && getAdditionalProperties(p) == null) { Boolean v3WithCompositionAddPropsAnyTypeSchemaCase = (getAdditionalProperties(p) != null && emptySchema.equals(getAdditionalProperties(p)) && originalSpecVersion.equals("3"));
return prefix + "bool, date, datetime, dict, float, int, list, str" + fullSuffix; if (isFreeFormObject(p) && v3WithCompositionAddPropsAnyTypeSchemaCase) {
} // v3 code path, use case: type object schema with no other schema info
if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) { return prefix + "{str: (bool, date, datetime, dict, float, int, list, str, none_type)}" + fullSuffix;
} else if ((ModelUtils.isMapSchema(p) || "object".equals(p.getType())) && getAdditionalProperties(p) != null) {
Schema inner = getAdditionalProperties(p); Schema inner = getAdditionalProperties(p);
return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix; return prefix + "{str: " + getTypeString(inner, "(", ")", referencedModelNames) + "}" + fullSuffix;
} else if (ModelUtils.isArraySchema(p)) { } else if (ModelUtils.isArraySchema(p)) {
@@ -835,7 +935,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
// The 'addProps' may be a reference, getTypeDeclaration will resolve // The 'addProps' may be a reference, getTypeDeclaration will resolve
// the reference. // the reference.
List<String> referencedModelNames = new ArrayList<String>(); List<String> referencedModelNames = new ArrayList<String>();
codegenModel.additionalPropertiesType = getTypeString(addProps, "", "", referencedModelNames); getTypeString(addProps, "", "", referencedModelNames);
if (referencedModelNames.size() != 0) { if (referencedModelNames.size() != 0) {
// Models that are referenced in the 'additionalPropertiesType' keyword // Models that are referenced in the 'additionalPropertiesType' keyword
// must be added to the imports. // must be added to the imports.

View File

@@ -35,6 +35,7 @@ public class PythonLegacyClientCodegen extends AbstractPythonCodegen implements
// nose is a python testing framework, we use pytest if USE_NOSE is unset // nose is a python testing framework, we use pytest if USE_NOSE is unset
public static final String USE_NOSE = "useNose"; public static final String USE_NOSE = "useNose";
public static final String RECURSION_LIMIT = "recursionLimit"; public static final String RECURSION_LIMIT = "recursionLimit";
public static final String PYTHON_ATTR_NONE_IF_UNSET = "pythonAttrNoneIfUnset";
protected String packageUrl; protected String packageUrl;
protected String apiDocPath = "docs/"; protected String apiDocPath = "docs/";

View File

@@ -28,9 +28,9 @@ Name | Type | Description | Notes
{{#optionalVars}} {{#optionalVars}}
**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}} **{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
{{/optionalVars}} {{/optionalVars}}
{{#additionalPropertiesType}} {{#additionalProperties}}
**any string name** | **{{additionalPropertiesType}}** | any string name can be used but the value must be the correct type | [optional] **any string name** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | any string name can be used but the value must be the correct type | [optional]
{{/additionalPropertiesType}} {{/additionalProperties}}
[[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)

View File

@@ -60,7 +60,7 @@
{{/optionalVars}} {{/optionalVars}}
} }
{{#additionalPropertiesType}} {{#additionalProperties}}
@cached_property @cached_property
def additional_properties_type(): def additional_properties_type():
""" """
@@ -72,11 +72,11 @@
lazy_import() lazy_import()
{{/-first}} {{/-first}}
{{/imports}} {{/imports}}
return ({{{additionalPropertiesType}}},) # noqa: E501 return ({{{dataType}}},) # noqa: E501
{{/additionalPropertiesType}} {{/additionalProperties}}
{{^additionalPropertiesType}} {{^additionalProperties}}
additional_properties_type = None additional_properties_type = None
{{/additionalPropertiesType}} {{/additionalProperties}}
_nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}} _nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}}

View File

@@ -10,7 +10,52 @@
'_additional_properties_model_instances', '_additional_properties_model_instances',
]) ])
{{> model_templates/method_init_shared }} @convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""{{classname}} - a model defined in OpenAPI
Keyword Args:
{{#requiredVars}}
{{#defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{/defaultValue}}
{{^defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}{{/description}}
{{/defaultValue}}
{{/requiredVars}}
{{> model_templates/docstring_init_required_kwargs }}
{{#optionalVars}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501
{{/optionalVars}}
"""
{{#requiredVars}}
{{#defaultValue}}
{{name}} = kwargs.get('{{name}}', {{{defaultValue}}})
{{/defaultValue}}
{{/requiredVars}}
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
constant_args = { constant_args = {
'_check_type': _check_type, '_check_type': _check_type,
@@ -19,28 +64,18 @@
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
{{#requiredVars}}
'{{name}}': {{name}},
{{/requiredVars}}
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -4,27 +4,43 @@
self.__dict__[name] = value self.__dict__[name] = value
return return
# set the attribute on the correct instance """
model_instances = self._var_name_to_model_instances.get( Use cases:
name, self._additional_properties_model_instances) 1. additional_properties_type is None (additionalProperties == False in spec)
if model_instances: Check for property presence in self.openapi_types
for model_instance in model_instances: if not present then throw an error
if model_instance == self: if present set in self, set attribute
self.set_attribute(name, value) always set on composed schemas
else: 2. additional_properties_type exists
setattr(model_instance, name, value) set attribute on self
if name not in self._var_name_to_model_instances: always set on composed schemas
# we assigned an additional property """
self.__dict__['_var_name_to_model_instances'][name] = ( if self.additional_properties_type is None:
model_instance """
) For an attribute to exist on a composed schema it must:
return None - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND
- fulfill schema_requirements in each oneOf/anyOf/allOf schemas
raise ApiAttributeError( schema_requirements:
"{0} has no attribute '{1}'".format( For an attribute to exist on a schema it must:
type(self).__name__, name), - be present in properties at the schema OR
[e for e in [self._path_to_item, name] if e] - have additionalProperties unset (defaults additionalProperties = any type) OR
) - have additionalProperties set
"""
if name not in self.openapi_types:
raise ApiAttributeError(
"{0} has no attribute '{1}'".format(
type(self).__name__, name),
[e for e in [self._path_to_item, name] if e]
)
# attribute must be set on self and composed instances
self.set_attribute(name, value)
for model_instance in self._composed_instances:
setattr(model_instance, name, value)
if name not in self._var_name_to_model_instances:
# we assigned an additional property
self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self]
return None
__unset_attribute_value__ = object() __unset_attribute_value__ = object()
@@ -34,13 +50,12 @@
return self.__dict__[name] return self.__dict__[name]
# get the attribute from the correct instance # get the attribute from the correct instance
model_instances = self._var_name_to_model_instances.get( model_instances = self._var_name_to_model_instances.get(name)
name, self._additional_properties_model_instances)
values = [] values = []
# A composed model stores child (oneof/anyOf/allOf) models under # A composed model stores self and child (oneof/anyOf/allOf) models under
# self._var_name_to_model_instances. A named property can exist in # self._var_name_to_model_instances.
# multiple child models. If the property is present in more than one # Any property must exist in self and all model instances
# child model, the value must be the same across all the child models. # The value stored in all model instances must be the same
if model_instances: if model_instances:
for model_instance in model_instances: for model_instance in model_instances:
if name in model_instance._data_store: if name in model_instance._data_store:

View File

@@ -1291,8 +1291,13 @@ def get_allof_instances(self, model_args, constant_args):
self: the class we are handling self: the class we are handling
model_args (dict): var_name to var_value model_args (dict): var_name to var_value
used to make instances used to make instances
constant_args (dict): var_name to var_value constant_args (dict):
used to make instances metadata arguments:
_check_type
_path_to_item
_spec_property_naming
_configuration
_visited_composed_classes
Returns Returns
composed_instances (list) composed_instances (list)
@@ -1300,20 +1305,8 @@ def get_allof_instances(self, model_args, constant_args):
composed_instances = [] composed_instances = []
for allof_class in self._composed_schemas['allOf']: for allof_class in self._composed_schemas['allOf']:
# no need to handle changing js keys to python because
# for composed schemas, allof parameters are included in the
# composed schema and were changed to python keys in __new__
# extract a dict of only required keys from fixed_model_args
kwargs = {}
var_names = set(allof_class.openapi_types.keys())
for var_name in var_names:
if var_name in model_args:
kwargs[var_name] = model_args[var_name]
# and use it to make the instance
kwargs.update(constant_args)
try: try:
allof_instance = allof_class(**kwargs) allof_instance = allof_class(**model_args, **constant_args)
composed_instances.append(allof_instance) composed_instances.append(allof_instance)
except Exception as ex: except Exception as ex:
raise ApiValueError( raise ApiValueError(
@@ -1373,31 +1366,9 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None):
single_value_input = allows_single_value_input(oneof_class) single_value_input = allows_single_value_input(oneof_class)
if not single_value_input:
# transform js keys from input data to python keys in fixed_model_args
fixed_model_args = change_keys_js_to_python(
model_kwargs, oneof_class)
# Extract a dict with the properties that are declared in the oneOf schema.
# Undeclared properties (e.g. properties that are allowed because of the
# additionalProperties attribute in the OAS document) are not added to
# the dict.
kwargs = {}
var_names = set(oneof_class.openapi_types.keys())
for var_name in var_names:
if var_name in fixed_model_args:
kwargs[var_name] = fixed_model_args[var_name]
# do not try to make a model with no input args
if len(kwargs) == 0:
continue
# and use it to make the instance
kwargs.update(constant_kwargs)
try: try:
if not single_value_input: if not single_value_input:
oneof_instance = oneof_class(**kwargs) oneof_instance = oneof_class(**model_kwargs, **constant_kwargs)
else: else:
if issubclass(oneof_class, ModelSimple): if issubclass(oneof_class, ModelSimple):
oneof_instance = oneof_class(model_arg, **constant_kwargs) oneof_instance = oneof_class(model_arg, **constant_kwargs)
@@ -1454,24 +1425,8 @@ def get_anyof_instances(self, model_args, constant_args):
# none_type deserialization is handled in the __new__ method # none_type deserialization is handled in the __new__ method
continue continue
# transform js keys to python keys in fixed_model_args
fixed_model_args = change_keys_js_to_python(model_args, anyof_class)
# extract a dict of only required keys from these_model_vars
kwargs = {}
var_names = set(anyof_class.openapi_types.keys())
for var_name in var_names:
if var_name in fixed_model_args:
kwargs[var_name] = fixed_model_args[var_name]
# do not try to make a model with no input args
if len(kwargs) == 0:
continue
# and use it to make the instance
kwargs.update(constant_args)
try: try:
anyof_instance = anyof_class(**kwargs) anyof_instance = anyof_class(**model_args, **constant_args)
anyof_instances.append(anyof_instance) anyof_instances.append(anyof_instance)
except Exception: except Exception:
pass pass
@@ -1484,47 +1439,34 @@ def get_anyof_instances(self, model_args, constant_args):
return anyof_instances return anyof_instances
def get_additional_properties_model_instances( def get_discarded_args(self, composed_instances, model_args):
composed_instances, self): """
additional_properties_model_instances = [] Gathers the args that were discarded by configuration.discard_unknown_keys
all_instances = [self] """
all_instances.extend(composed_instances) model_arg_keys = model_args.keys()
for instance in all_instances: discarded_args = set()
if instance.additional_properties_type is not None: # arguments passed to self were already converted to python names
additional_properties_model_instances.append(instance)
return additional_properties_model_instances
def get_var_name_to_model_instances(self, composed_instances):
var_name_to_model_instances = {}
all_instances = [self]
all_instances.extend(composed_instances)
for instance in all_instances:
for var_name in instance.openapi_types:
if var_name not in var_name_to_model_instances:
var_name_to_model_instances[var_name] = [instance]
else:
var_name_to_model_instances[var_name].append(instance)
return var_name_to_model_instances
def get_unused_args(self, composed_instances, model_args):
unused_args = dict(model_args)
# arguments apssed to self were already converted to python names
# before __init__ was called # before __init__ was called
for var_name_py in self.attribute_map:
if var_name_py in unused_args:
del unused_args[var_name_py]
for instance in composed_instances: for instance in composed_instances:
if instance.__class__ in self._composed_schemas['allOf']: if instance.__class__ in self._composed_schemas['allOf']:
for var_name_py in instance.attribute_map: try:
if var_name_py in unused_args: keys = instance.to_dict().keys()
del unused_args[var_name_py] discarded_keys = model_args - keys
discarded_args.update(discarded_keys)
except Exception:
# allOf integer schema will throw exception
pass
else: else:
for var_name_js in instance.attribute_map.values(): try:
if var_name_js in unused_args: all_keys = set(model_to_dict(instance, serialize=False).keys())
del unused_args[var_name_js] js_keys = model_to_dict(instance, serialize=True).keys()
return unused_args all_keys.update(js_keys)
discarded_keys = model_arg_keys - all_keys
discarded_args.update(discarded_keys)
except Exception:
# allOf integer schema will throw exception
pass
return discarded_args
def validate_get_composed_info(constant_args, model_args, self): def validate_get_composed_info(constant_args, model_args, self):
@@ -1568,36 +1510,42 @@ def validate_get_composed_info(constant_args, model_args, self):
composed_instances.append(oneof_instance) composed_instances.append(oneof_instance)
anyof_instances = get_anyof_instances(self, model_args, constant_args) anyof_instances = get_anyof_instances(self, model_args, constant_args)
composed_instances.extend(anyof_instances) composed_instances.extend(anyof_instances)
"""
set additional_properties_model_instances
additional properties must be evaluated at the schema level
so self's additional properties are most important
If self is a composed schema with:
- no properties defined in self
- additionalProperties: False
Then for object payloads every property is an additional property
and they are not allowed, so only empty dict is allowed
Properties must be set on all matching schemas
so when a property is assigned toa composed instance, it must be set on all
composed instances regardless of additionalProperties presence
keeping it to prevent breaking changes in v5.0.1
TODO remove cls._additional_properties_model_instances in 6.0.0
"""
additional_properties_model_instances = []
if self.additional_properties_type is not None:
additional_properties_model_instances = [self]
"""
no need to set properties on self in here, they will be set in __init__
By here all composed schema oneOf/anyOf/allOf instances have their properties set using
model_args
"""
discarded_args = get_discarded_args(self, composed_instances, model_args)
# map variable names to composed_instances # map variable names to composed_instances
var_name_to_model_instances = get_var_name_to_model_instances( var_name_to_model_instances = {}
self, composed_instances) for prop_name in model_args:
if prop_name not in discarded_args:
# set additional_properties_model_instances var_name_to_model_instances[prop_name] = [self] + composed_instances
additional_properties_model_instances = (
get_additional_properties_model_instances(composed_instances, self)
)
# set any remaining values
unused_args = get_unused_args(self, composed_instances, model_args)
if len(unused_args) > 0 and \
len(additional_properties_model_instances) == 0 and \
(self._configuration is None or
not self._configuration.discard_unknown_keys):
raise ApiValueError(
"Invalid input arguments input when making an instance of "
"class %s. Not all inputs were used. The unused input data "
"is %s" % (self.__class__.__name__, unused_args)
)
# no need to add additional_properties to var_name_to_model_instances here
# because additional_properties_model_instances will direct us to that
# instance when we use getattr or setattr
# and we update var_name_to_model_instances in setattr
return [ return [
composed_instances, composed_instances,
var_name_to_model_instances, var_name_to_model_instances,
additional_properties_model_instances, additional_properties_model_instances,
unused_args discarded_args
] ]

View File

@@ -19,7 +19,7 @@ package org.openapitools.codegen.options;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.languages.PythonLegacyClientCodegen; import org.openapitools.codegen.languages.PythonClientCodegen;
import java.util.Map; import java.util.Map;
@@ -30,6 +30,8 @@ public class PythonClientOptionsProvider implements OptionsProvider {
public static final String PACKAGE_URL_VALUE = ""; public static final String PACKAGE_URL_VALUE = "";
public static final String USE_NOSE_VALUE = "false"; public static final String USE_NOSE_VALUE = "false";
public static final String RECURSION_LIMIT = "1200"; public static final String RECURSION_LIMIT = "1200";
public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT = "false";
public static final String PYTHON_ATTR_NONE_IF_UNSET = "false";
@Override @Override
public String getLanguage() { public String getLanguage() {
@@ -39,16 +41,17 @@ public class PythonClientOptionsProvider implements OptionsProvider {
@Override @Override
public Map<String, String> createOptions() { public Map<String, String> createOptions() {
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>(); ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE) return builder.put(PythonClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE)
.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
.put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE) .put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE)
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
.put(CodegenConstants.SOURCECODEONLY_GENERATION, "false") .put(CodegenConstants.SOURCECODEONLY_GENERATION, "false")
.put(CodegenConstants.LIBRARY, "urllib3") .put(CodegenConstants.LIBRARY, "urllib3")
.put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE) .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT)
.put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT) .put(PythonClientCodegen.USE_NOSE, USE_NOSE_VALUE)
.put(PythonClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT)
.put(PythonClientCodegen.PYTHON_ATTR_NONE_IF_UNSET, PYTHON_ATTR_NONE_IF_UNSET)
.build(); .build();
} }

View File

@@ -0,0 +1,59 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.options;
import com.google.common.collect.ImmutableMap;
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.languages.PythonLegacyClientCodegen;
import java.util.Map;
public class PythonLegacyClientOptionsProvider implements OptionsProvider {
public static final String PACKAGE_NAME_VALUE = "swagger_client_python";
public static final String PROJECT_NAME_VALUE = "swagger-client-python";
public static final String PACKAGE_VERSION_VALUE = "1.0.0-SNAPSHOT";
public static final String PACKAGE_URL_VALUE = "";
public static final String USE_NOSE_VALUE = "false";
public static final String RECURSION_LIMIT = "1200";
@Override
public String getLanguage() {
return "python";
}
@Override
public Map<String, String> createOptions() {
ImmutableMap.Builder<String, String> builder = new ImmutableMap.Builder<String, String>();
return builder.put(PythonLegacyClientCodegen.PACKAGE_URL, PACKAGE_URL_VALUE)
.put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE)
.put(CodegenConstants.PROJECT_NAME, PROJECT_NAME_VALUE)
.put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE)
.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, "true")
.put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true")
.put(CodegenConstants.SOURCECODEONLY_GENERATION, "false")
.put(CodegenConstants.LIBRARY, "urllib3")
.put(PythonLegacyClientCodegen.USE_NOSE, USE_NOSE_VALUE)
.put(PythonLegacyClientCodegen.RECURSION_LIMIT, RECURSION_LIMIT)
.build();
}
@Override
public boolean isServer() {
return false;
}
}

View File

@@ -19,7 +19,7 @@ package org.openapitools.codegen.python;
import org.openapitools.codegen.AbstractOptionsTest; import org.openapitools.codegen.AbstractOptionsTest;
import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.languages.PythonLegacyClientCodegen; import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.options.PythonClientOptionsProvider; import org.openapitools.codegen.options.PythonClientOptionsProvider;
import org.testng.Assert; import org.testng.Assert;
@@ -29,7 +29,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verify;
public class PythonClientOptionsTest extends AbstractOptionsTest { public class PythonClientOptionsTest extends AbstractOptionsTest {
private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings); private PythonClientCodegen clientCodegen = mock(PythonClientCodegen.class, mockSettings);
public PythonClientOptionsTest() { public PythonClientOptionsTest() {
super(new PythonClientOptionsProvider()); super(new PythonClientOptionsProvider());

View File

@@ -0,0 +1,54 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
* Copyright 2018 SmartBear Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.python;
import org.openapitools.codegen.AbstractOptionsTest;
import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.languages.PythonLegacyClientCodegen;
import org.openapitools.codegen.options.PythonLegacyClientOptionsProvider;
import org.testng.Assert;
import java.io.File;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
public class PythonLegacyClientOptionsTest extends AbstractOptionsTest {
private PythonLegacyClientCodegen clientCodegen = mock(PythonLegacyClientCodegen.class, mockSettings);
public PythonLegacyClientOptionsTest() {
super(new PythonLegacyClientOptionsProvider());
}
@Override
protected CodegenConfig getCodegenConfig() {
return clientCodegen;
}
@SuppressWarnings("unused")
@Override
protected void verifyOptions() {
Assert.assertEquals(clientCodegen.packagePath(), PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE.replace('.', File.separatorChar));
verify(clientCodegen).setPackageName(PythonLegacyClientOptionsProvider.PACKAGE_NAME_VALUE);
verify(clientCodegen).setProjectName(PythonLegacyClientOptionsProvider.PROJECT_NAME_VALUE);
verify(clientCodegen).setPackageVersion(PythonLegacyClientOptionsProvider.PACKAGE_VERSION_VALUE);
verify(clientCodegen).setPackageUrl(PythonLegacyClientOptionsProvider.PACKAGE_URL_VALUE);
verify(clientCodegen).setUseNose(PythonLegacyClientOptionsProvider.USE_NOSE_VALUE);
}
}

View File

@@ -1373,8 +1373,6 @@ definitions:
properties: properties:
breed: breed:
type: string type: string
additionalProperties: false
additionalProperties: false
Cat: Cat:
allOf: allOf:
- $ref: '#/definitions/Animal' - $ref: '#/definitions/Animal'
@@ -1523,8 +1521,7 @@ definitions:
type: object type: object
additionalProperties: additionalProperties:
type: array type: array
items: items: {}
type: object
map_map_string: map_map_string:
type: object type: object
additionalProperties: additionalProperties:
@@ -1535,14 +1532,15 @@ definitions:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
additionalProperties: additionalProperties: {}
type: object anytype_1: {}
anytype_1: anytype_2:
type: object description: no type is set for this
anytype_2: {}
anytype_3: anytype_3:
type: object type: object
properties: {} properties: {}
description: 'because of a bug in swagger-parser, this should have values {str: (str, int, float...)}
but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378'
AdditionalPropertiesString: AdditionalPropertiesString:
type: object type: object
properties: properties:
@@ -2091,7 +2089,6 @@ definitions:
properties: properties:
interNet: interNet:
type: boolean type: boolean
additionalProperties: false
GrandparentAnimal: GrandparentAnimal:
type: object type: object
required: required:

View File

@@ -1584,7 +1584,6 @@ components:
Cat: Cat:
allOf: allOf:
- $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Animal'
- $ref: '#/components/schemas/Address'
- type: object - type: object
properties: properties:
declawed: declawed:
@@ -2037,6 +2036,9 @@ components:
items: items:
type: object type: object
nullable: true nullable: true
object_nullable:
type: object
nullable: true
object_nullable_prop: object_nullable_prop:
type: object type: object
nullable: true nullable: true
@@ -2054,18 +2056,27 @@ components:
type: object type: object
nullable: true nullable: true
additionalProperties: additionalProperties:
type: object
nullable: true nullable: true
ComposedSchemaWithPropsAndNoAddProps:
properties:
color:
type: string
allOf:
- $ref: '#/components/schemas/Tag'
# Below additionalProperties is set to false to validate the use
# case when a composed schema has additionalProperties set to false.
# This definition will only allow in object payloads that set color and no other properties because
# additionalProperties are evaluated at the schema level and do not include composed schema
# properties. Only color is defined here, all others are additional
additionalProperties: false
fruit: fruit:
description: a schema that tests oneOf and includes a schema level property
properties: properties:
color: color:
type: string type: string
oneOf: oneOf:
- $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana' - $ref: '#/components/schemas/banana'
# Below additionalProperties is set to false to validate the use
# case when a composed schema has additionalProperties set to false.
additionalProperties: false
apple: apple:
type: object type: object
properties: properties:
@@ -2075,12 +2086,16 @@ components:
origin: origin:
type: string type: string
pattern: /^[A-Z\s]*$/i pattern: /^[A-Z\s]*$/i
required:
- cultivar
nullable: true nullable: true
banana: banana:
type: object type: object
properties: properties:
lengthCm: lengthCm:
type: number type: number
required:
- lengthCm
mammal: mammal:
oneOf: oneOf:
- $ref: '#/components/schemas/whale' - $ref: '#/components/schemas/whale'
@@ -2140,13 +2155,13 @@ components:
anyOf: anyOf:
- $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/apple'
- $ref: '#/components/schemas/banana' - $ref: '#/components/schemas/banana'
additionalProperties: false
fruitReq: fruitReq:
description: a schema where additionalProperties is on in the composed schema and off in the oneOf object schemas
also, this schem accepts null as a value
oneOf: oneOf:
- type: 'null' - type: 'null'
- $ref: '#/components/schemas/appleReq' - $ref: '#/components/schemas/appleReq'
- $ref: '#/components/schemas/bananaReq' - $ref: '#/components/schemas/bananaReq'
additionalProperties: false
appleReq: appleReq:
type: object type: object
properties: properties:
@@ -2250,7 +2265,6 @@ components:
allOf: allOf:
- $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/ShapeInterface'
- $ref: '#/components/schemas/TriangleInterface' - $ref: '#/components/schemas/TriangleInterface'
additionalProperties: false
ScaleneTriangle: ScaleneTriangle:
allOf: allOf:
- $ref: '#/components/schemas/ShapeInterface' - $ref: '#/components/schemas/ShapeInterface'

View File

@@ -1206,6 +1206,7 @@
<!--<module>samples/client/petstore/javascript-apollo</module>--> <!--<module>samples/client/petstore/javascript-apollo</module>-->
<module>samples/client/petstore/javascript-flowtyped</module> <module>samples/client/petstore/javascript-flowtyped</module>
<module>samples/client/petstore/python</module> <module>samples/client/petstore/python</module>
<module>samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent</module>
<module>samples/client/petstore/python-legacy</module> <module>samples/client/petstore/python-legacy</module>
<module>samples/client/petstore/python-asyncio</module> <module>samples/client/petstore/python-asyncio</module>
<module>samples/client/petstore/python-tornado</module> <module>samples/client/petstore/python-tornado</module>

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional] **name** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str** | any string name can be used but the value must be the correct type | [optional] **any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional] **name** | **str** | | [optional]
**any string name** | **[bool, date, datetime, dict, float, int, list, str]** | any string name can be used but the value must be the correct type | [optional] **any string name** | **[bool, date, datetime, dict, float, int, list, str, none_type]** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -9,12 +9,13 @@ Name | Type | Description | Notes
**map_integer** | **{str: (int,)}** | | [optional] **map_integer** | **{str: (int,)}** | | [optional]
**map_boolean** | **{str: (bool,)}** | | [optional] **map_boolean** | **{str: (bool,)}** | | [optional]
**map_array_integer** | **{str: ([int],)}** | | [optional] **map_array_integer** | **{str: ([int],)}** | | [optional]
**map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str],)}** | | [optional] **map_array_anytype** | **{str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}** | | [optional]
**map_map_string** | **{str: ({str: (str,)},)}** | | [optional] **map_map_string** | **{str: ({str: (str,)},)}** | | [optional]
**map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}** | | [optional] **map_map_anytype** | **{str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}** | | [optional]
**anytype_1** | **bool, date, datetime, dict, float, int, list, str** | | [optional] **anytype_1** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**anytype_2** | **bool, date, datetime, dict, float, int, list, str** | | [optional] **anytype_2** | **bool, date, datetime, dict, float, int, list, str, none_type** | no type is set for this | [optional]
**anytype_3** | **bool, date, datetime, dict, float, int, list, str** | | [optional] **anytype_3** | **bool, date, datetime, dict, float, int, list, str, none_type** | because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378 | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,7 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional] **name** | **str** | | [optional]
**any string name** | **{str: (bool, date, datetime, dict, float, int, list, str,)}** | any string name can be used but the value must be the correct type | [optional] **any string name** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type,)}** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**class_name** | **str** | | **class_name** | **str** | |
**color** | **str** | | [optional] if omitted the server will use the default value of "red" **color** | **str** | | [optional] if omitted the server will use the default value of "red"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**value** | [**[Animal]**](Animal.md) | | **value** | [**[Animal]**](Animal.md) | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**code** | **int** | | [optional] **code** | **int** | | [optional]
**type** | **str** | | [optional] **type** | **str** | | [optional]
**message** | **str** | | [optional] **message** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**array_array_number** | **[[float]]** | | [optional] **array_array_number** | **[[float]]** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**array_number** | **[float]** | | [optional] **array_number** | **[float]** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**array_of_string** | **[str]** | | [optional] **array_of_string** | **[str]** | | [optional]
**array_array_of_integer** | **[[int]]** | | [optional] **array_array_of_integer** | **[[int]]** | | [optional]
**array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional] **array_array_of_model** | [**[[ReadOnlyFirst]]**](ReadOnlyFirst.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -10,6 +10,7 @@ Name | Type | Description | Notes
**capital_snake** | **str** | | [optional] **capital_snake** | **str** | | [optional]
**sca_eth_flow_points** | **str** | | [optional] **sca_eth_flow_points** | **str** | | [optional]
**att_name** | **str** | Name of the pet | [optional] **att_name** | **str** | Name of the pet | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**class_name** | **str** | | **class_name** | **str** | |
**declawed** | **bool** | | [optional] **declawed** | **bool** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of "red" **color** | **str** | | [optional] if omitted the server will use the default value of "red"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**declawed** | **bool** | | [optional] **declawed** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | defaults to "default-name" **name** | **str** | | defaults to "default-name"
**id** | **int** | | [optional] **id** | **int** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**radio_waves** | **bool** | | [optional] **radio_waves** | **bool** | | [optional]
**tele_vision** | **bool** | | [optional] **tele_vision** | **bool** | | [optional]
**inter_net** | **bool** | | [optional] **inter_net** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**inter_net** | **bool** | | [optional] **inter_net** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**pet_type** | **str** | | **pet_type** | **str** | |
**name** | **str** | | [optional] **name** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | [optional] **name** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**pet_type** | **str** | | **pet_type** | **str** | |
**bark** | **str** | | [optional] **bark** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**bark** | **str** | | [optional] **bark** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**pet_type** | **str** | | **pet_type** | **str** | |
**loves_rocks** | **bool** | | [optional] **loves_rocks** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**loves_rocks** | **bool** | | [optional] **loves_rocks** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Model for testing model with \"_class\" property
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**_class** | **str** | | [optional] **_class** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**client** | **str** | | [optional] **client** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**class_name** | **str** | | **class_name** | **str** | |
**breed** | **str** | | [optional] **breed** | **str** | | [optional]
**color** | **str** | | [optional] if omitted the server will use the default value of "red" **color** | **str** | | [optional] if omitted the server will use the default value of "red"
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**breed** | **str** | | [optional] **breed** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**just_symbol** | **str** | | [optional] **just_symbol** | **str** | | [optional]
**array_enum** | **[str]** | | [optional] **array_enum** | **[str]** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ] **value** | **str** | | defaults to "-efg", must be one of ["_abc", "-efg", "(xyz)", ]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -9,6 +9,7 @@ Name | Type | Description | Notes
**enum_integer** | **int** | | [optional] **enum_integer** | **int** | | [optional]
**enum_number** | **float** | | [optional] **enum_number** | **float** | | [optional]
**string_enum** | [**StringEnum**](StringEnum.md) | | [optional] **string_enum** | [**StringEnum**](StringEnum.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Must be named `File` for test.
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**source_uri** | **str** | Test capitalization | [optional] **source_uri** | **str** | Test capitalization | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**file** | [**File**](File.md) | | [optional] **file** | [**File**](File.md) | | [optional]
**files** | [**[File]**](File.md) | | [optional] **files** | [**[File]**](File.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -17,6 +17,7 @@ Name | Type | Description | Notes
**binary** | **file_type** | | [optional] **binary** | **file_type** | | [optional]
**date_time** | **datetime** | | [optional] **date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional] **uuid** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**radio_waves** | **bool** | | [optional] **radio_waves** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**pet_type** | **str** | | **pet_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**bar** | **str** | | [optional] [readonly] **bar** | **str** | | [optional] [readonly]
**foo** | **str** | | [optional] [readonly] **foo** | **str** | | [optional] [readonly]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**_123_list** | **str** | | [optional] **_123_list** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -8,6 +8,7 @@ Name | Type | Description | Notes
**map_of_enum_string** | **{str: (str,)}** | | [optional] **map_of_enum_string** | **{str: (str,)}** | | [optional]
**direct_map** | **{str: (bool,)}** | | [optional] **direct_map** | **{str: (bool,)}** | | [optional]
**indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional] **indirect_map** | [**StringBooleanMap**](StringBooleanMap.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**uuid** | **str** | | [optional] **uuid** | **str** | | [optional]
**date_time** | **datetime** | | [optional] **date_time** | **datetime** | | [optional]
**map** | [**{str: (Animal,)}**](Animal.md) | | [optional] **map** | [**{str: (Animal,)}**](Animal.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **int** | | [optional] **name** | **int** | | [optional]
**_class** | **str** | | [optional] **_class** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Model for testing reserved words
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**_return** | **int** | | [optional] **_return** | **int** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -9,6 +9,7 @@ Name | Type | Description | Notes
**snake_case** | **int** | | [optional] [readonly] **snake_case** | **int** | | [optional] [readonly]
**_property** | **str** | | [optional] **_property** | **str** | | [optional]
**_123_number** | **int** | | [optional] [readonly] **_123_number** | **int** | | [optional] [readonly]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**just_number** | **float** | | [optional] **just_number** | **float** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**value** | **float** | | **value** | **float** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -8,6 +8,7 @@ Name | Type | Description | Notes
**my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional] **my_number** | [**NumberWithValidations**](NumberWithValidations.md) | | [optional]
**my_string** | **str** | | [optional] **my_string** | **str** | | [optional]
**my_boolean** | **bool** | | [optional] **my_boolean** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -10,6 +10,7 @@ Name | Type | Description | Notes
**ship_date** | **datetime** | | [optional] **ship_date** | **datetime** | | [optional]
**status** | **str** | Order Status | [optional] **status** | **str** | Order Status | [optional]
**complete** | **bool** | | [optional] if omitted the server will use the default value of False **complete** | **bool** | | [optional] if omitted the server will use the default value of False
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**radio_waves** | **bool** | | [optional] **radio_waves** | **bool** | | [optional]
**tele_vision** | **bool** | | [optional] **tele_vision** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**tele_vision** | **bool** | | [optional] **tele_vision** | **bool** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**pet_type** | **str** | | **pet_type** | **str** | |
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -10,6 +10,7 @@ Name | Type | Description | Notes
**category** | [**Category**](Category.md) | | [optional] **category** | [**Category**](Category.md) | | [optional]
**tags** | [**[Tag]**](Tag.md) | | [optional] **tags** | [**[Tag]**](Tag.md) | | [optional]
**status** | **str** | pet status in the store | [optional] **status** | **str** | pet status in the store | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**name** | **str** | | **name** | **str** | |
**enemy_player** | [**Player**](Player.md) | | [optional] **enemy_player** | [**Player**](Player.md) | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -6,6 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**bar** | **str** | | [optional] [readonly] **bar** | **str** | | [optional] [readonly]
**baz** | **str** | | [optional] **baz** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**special_property_name** | **int** | | [optional] **special_property_name** | **int** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -5,6 +5,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**value** | **str** | | must be one of ["placed", "approved", "delivered", ] **value** | **str** | | must be one of ["placed", "approved", "delivered", ]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -7,6 +7,7 @@ Name | Type | Description | Notes
**id** | **int** | | [optional] **id** | **int** | | [optional]
**name** | **str** | | [optional] **name** | **str** | | [optional]
**full_name** | **str** | | [optional] **full_name** | **str** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -12,6 +12,7 @@ Name | Type | Description | Notes
**bool_item** | **bool** | | defaults to True **bool_item** | **bool** | | defaults to True
**date_item** | **date** | | [optional] **date_item** | **date** | | [optional]
**datetime_item** | **datetime** | | [optional] **datetime_item** | **datetime** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -10,6 +10,7 @@ Name | Type | Description | Notes
**string_item** | **str** | | defaults to "what" **string_item** | **str** | | defaults to "what"
**number_item** | **float** | | defaults to 1.234 **number_item** | **float** | | defaults to 1.234
**integer_item** | **int** | | defaults to -2 **integer_item** | **int** | | defaults to -2
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -12,6 +12,7 @@ Name | Type | Description | Notes
**password** | **str** | | [optional] **password** | **str** | | [optional]
**phone** | **str** | | [optional] **phone** | **str** | | [optional]
**user_status** | **int** | User Status | [optional] **user_status** | **int** | User Status | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -33,6 +33,7 @@ Name | Type | Description | Notes
**prefix_ns_boolean** | **bool** | | [optional] **prefix_ns_boolean** | **bool** | | [optional]
**prefix_ns_array** | **[int]** | | [optional] **prefix_ns_array** | **[int]** | | [optional]
**prefix_ns_wrapped_array** | **[int]** | | [optional] **prefix_ns_wrapped_array** | **[int]** | | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[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)

View File

@@ -63,7 +63,7 @@ class AdditionalPropertiesAnyType(ModelNormal):
This must be a method because a model may have properties that are This must be a method because a model may have properties that are
of type self, this must run after the class is loaded of type self, this must run after the class is loaded
""" """
return (bool, date, datetime, dict, float, int, list, str,) # noqa: E501 return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,7 @@ class AdditionalPropertiesArray(ModelNormal):
This must be a method because a model may have properties that are This must be a method because a model may have properties that are
of type self, this must run after the class is loaded of type self, this must run after the class is loaded
""" """
return ([bool, date, datetime, dict, float, int, list, str],) # noqa: E501 return ([bool, date, datetime, dict, float, int, list, str, none_type],) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class AdditionalPropertiesClass(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -77,12 +83,12 @@ class AdditionalPropertiesClass(ModelNormal):
'map_integer': ({str: (int,)},), # noqa: E501 'map_integer': ({str: (int,)},), # noqa: E501
'map_boolean': ({str: (bool,)},), # noqa: E501 'map_boolean': ({str: (bool,)},), # noqa: E501
'map_array_integer': ({str: ([int],)},), # noqa: E501 'map_array_integer': ({str: ([int],)},), # noqa: E501
'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str],)},), # noqa: E501 'map_array_anytype': ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)},), # noqa: E501
'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501 'map_map_string': ({str: ({str: (str,)},)},), # noqa: E501
'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)},), # noqa: E501 'map_map_anytype': ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)},), # noqa: E501
'anytype_1': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 'anytype_1': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
'anytype_2': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 'anytype_2': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
'anytype_3': (bool, date, datetime, dict, float, int, list, str,), # noqa: E501 'anytype_3': (bool, date, datetime, dict, float, int, list, str, none_type,), # noqa: E501
} }
@cached_property @cached_property
@@ -155,12 +161,12 @@ class AdditionalPropertiesClass(ModelNormal):
map_integer ({str: (int,)}): [optional] # noqa: E501 map_integer ({str: (int,)}): [optional] # noqa: E501
map_boolean ({str: (bool,)}): [optional] # noqa: E501 map_boolean ({str: (bool,)}): [optional] # noqa: E501
map_array_integer ({str: ([int],)}): [optional] # noqa: E501 map_array_integer ({str: ([int],)}): [optional] # noqa: E501
map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str],)}): [optional] # noqa: E501 map_array_anytype ({str: ([bool, date, datetime, dict, float, int, list, str, none_type],)}): [optional] # noqa: E501
map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501 map_map_string ({str: ({str: (str,)},)}): [optional] # noqa: E501
map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str,)},)}): [optional] # noqa: E501 map_map_anytype ({str: ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},)}): [optional] # noqa: E501
anytype_1 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 anytype_1 (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
anytype_2 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 anytype_2 (bool, date, datetime, dict, float, int, list, str, none_type): no type is set for this. [optional] # noqa: E501
anytype_3 (bool, date, datetime, dict, float, int, list, str): [optional] # noqa: E501 anytype_3 (bool, date, datetime, dict, float, int, list, str, none_type): because of a bug in swagger-parser, this should have values {str: (str, int, float...)} but instead we get any type. See https://github.com/swagger-api/swagger-parser/issues/1378. [optional] # noqa: E501
""" """
_check_type = kwargs.pop('_check_type', True) _check_type = kwargs.pop('_check_type', True)

View File

@@ -63,7 +63,7 @@ class AdditionalPropertiesObject(ModelNormal):
This must be a method because a model may have properties that are This must be a method because a model may have properties that are
of type self, this must run after the class is loaded of type self, this must run after the class is loaded
""" """
return ({str: (bool, date, datetime, dict, float, int, list, str,)},) # noqa: E501 return ({str: (bool, date, datetime, dict, float, int, list, str, none_type,)},) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class Animal(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,14 @@ class AnimalFarm(ModelSimple):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class ApiResponse(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class ArrayOfArrayOfNumberOnly(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class ArrayOfNumberOnly(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -61,7 +61,14 @@ class ArrayTest(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class Capitalization(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class Cat(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -111,13 +118,11 @@ class Cat(ModelComposed):
]) ])
@convert_js_args_to_python_args @convert_js_args_to_python_args
def __init__(self, class_name, *args, **kwargs): # noqa: E501 def __init__(self, *args, **kwargs): # noqa: E501
"""Cat - a model defined in OpenAPI """Cat - a model defined in OpenAPI
Args:
class_name (str):
Keyword Args: Keyword Args:
class_name (str):
_check_type (bool): if True, values for parameters in openapi_types _check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be will be type checked and a TypeError will be
raised if the wrong type is input. raised if the wrong type is input.
@@ -182,26 +187,18 @@ class Cat(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
'class_name': class_name,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -57,7 +57,13 @@ class CatAllOf(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class Category(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class Child(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -177,25 +184,18 @@ class Child(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -57,7 +57,13 @@ class ChildAllOf(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class ChildCat(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -109,13 +116,11 @@ class ChildCat(ModelComposed):
]) ])
@convert_js_args_to_python_args @convert_js_args_to_python_args
def __init__(self, pet_type, *args, **kwargs): # noqa: E501 def __init__(self, *args, **kwargs): # noqa: E501
"""ChildCat - a model defined in OpenAPI """ChildCat - a model defined in OpenAPI
Args:
pet_type (str):
Keyword Args: Keyword Args:
pet_type (str):
_check_type (bool): if True, values for parameters in openapi_types _check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be will be type checked and a TypeError will be
raised if the wrong type is input. raised if the wrong type is input.
@@ -179,26 +184,18 @@ class ChildCat(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
'pet_type': pet_type,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -57,7 +57,13 @@ class ChildCatAllOf(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class ChildDog(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -109,13 +116,11 @@ class ChildDog(ModelComposed):
]) ])
@convert_js_args_to_python_args @convert_js_args_to_python_args
def __init__(self, pet_type, *args, **kwargs): # noqa: E501 def __init__(self, *args, **kwargs): # noqa: E501
"""ChildDog - a model defined in OpenAPI """ChildDog - a model defined in OpenAPI
Args:
pet_type (str):
Keyword Args: Keyword Args:
pet_type (str):
_check_type (bool): if True, values for parameters in openapi_types _check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be will be type checked and a TypeError will be
raised if the wrong type is input. raised if the wrong type is input.
@@ -179,26 +184,18 @@ class ChildDog(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
'pet_type': pet_type,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -57,7 +57,13 @@ class ChildDogAllOf(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class ChildLizard(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -109,13 +116,11 @@ class ChildLizard(ModelComposed):
]) ])
@convert_js_args_to_python_args @convert_js_args_to_python_args
def __init__(self, pet_type, *args, **kwargs): # noqa: E501 def __init__(self, *args, **kwargs): # noqa: E501
"""ChildLizard - a model defined in OpenAPI """ChildLizard - a model defined in OpenAPI
Args:
pet_type (str):
Keyword Args: Keyword Args:
pet_type (str):
_check_type (bool): if True, values for parameters in openapi_types _check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be will be type checked and a TypeError will be
raised if the wrong type is input. raised if the wrong type is input.
@@ -179,26 +184,18 @@ class ChildLizard(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
'pet_type': pet_type,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

View File

@@ -57,7 +57,13 @@ class ChildLizardAllOf(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class ClassModel(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -57,7 +57,13 @@ class Client(ModelNormal):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False

View File

@@ -63,7 +63,14 @@ class Dog(ModelComposed):
validations = { validations = {
} }
additional_properties_type = None @cached_property
def additional_properties_type():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
"""
lazy_import()
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501
_nullable = False _nullable = False
@@ -111,13 +118,11 @@ class Dog(ModelComposed):
]) ])
@convert_js_args_to_python_args @convert_js_args_to_python_args
def __init__(self, class_name, *args, **kwargs): # noqa: E501 def __init__(self, *args, **kwargs): # noqa: E501
"""Dog - a model defined in OpenAPI """Dog - a model defined in OpenAPI
Args:
class_name (str):
Keyword Args: Keyword Args:
class_name (str):
_check_type (bool): if True, values for parameters in openapi_types _check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be will be type checked and a TypeError will be
raised if the wrong type is input. raised if the wrong type is input.
@@ -182,26 +187,18 @@ class Dog(ModelComposed):
'_configuration': _configuration, '_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes, '_visited_composed_classes': self._visited_composed_classes,
} }
required_args = {
'class_name': class_name,
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info( composed_info = validate_get_composed_info(
constant_args, model_args, self) constant_args, kwargs, self)
self._composed_instances = composed_info[0] self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1] self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2] self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3] discarded_args = composed_info[3]
for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items(): for var_name, var_value in kwargs.items():
if var_name in unused_args and \ if var_name in discarded_args and \
self._configuration is not None and \ self._configuration is not None and \
self._configuration.discard_unknown_keys and \ self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances: self._additional_properties_model_instances:
# discard variable. # discard variable.
continue continue
setattr(self, var_name, var_value) setattr(self, var_name, var_value)

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