mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 02:47:05 +00:00
[Default] update isAdditionalPropertiesTrue tag to cover more types (#16227)
* enhance additional properties support * update samples * update tests * add more tests * update samples * fix samples
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
.gitlab-ci.yml
|
||||
.travis.yml
|
||||
README.md
|
||||
docs/AdditionalPropertiesAnyType.md
|
||||
docs/AdditionalPropertiesClass.md
|
||||
docs/AdditionalPropertiesObject.md
|
||||
docs/AdditionalPropertiesWithDescriptionOnly.md
|
||||
docs/AllOfWithSingleRef.md
|
||||
docs/Animal.md
|
||||
docs/AnotherFakeApi.md
|
||||
@@ -100,7 +103,10 @@ petstore_api/api_response.py
|
||||
petstore_api/configuration.py
|
||||
petstore_api/exceptions.py
|
||||
petstore_api/models/__init__.py
|
||||
petstore_api/models/additional_properties_any_type.py
|
||||
petstore_api/models/additional_properties_class.py
|
||||
petstore_api/models/additional_properties_object.py
|
||||
petstore_api/models/additional_properties_with_description_only.py
|
||||
petstore_api/models/all_of_with_single_ref.py
|
||||
petstore_api/models/animal.py
|
||||
petstore_api/models/any_of_color.py
|
||||
|
||||
@@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md)
|
||||
- [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||
- [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md)
|
||||
- [AdditionalPropertiesWithDescriptionOnly](docs/AdditionalPropertiesWithDescriptionOnly.md)
|
||||
- [AllOfWithSingleRef](docs/AllOfWithSingleRef.md)
|
||||
- [Animal](docs/Animal.md)
|
||||
- [AnyOfColor](docs/AnyOfColor.md)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# AdditionalPropertiesAnyType
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AdditionalPropertiesAnyType from a JSON string
|
||||
additional_properties_any_type_instance = AdditionalPropertiesAnyType.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print AdditionalPropertiesAnyType.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
additional_properties_any_type_dict = additional_properties_any_type_instance.to_dict()
|
||||
# create an instance of AdditionalPropertiesAnyType from a dict
|
||||
additional_properties_any_type_form_dict = additional_properties_any_type.from_dict(additional_properties_any_type_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# AdditionalPropertiesObject
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AdditionalPropertiesObject from a JSON string
|
||||
additional_properties_object_instance = AdditionalPropertiesObject.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print AdditionalPropertiesObject.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
additional_properties_object_dict = additional_properties_object_instance.to_dict()
|
||||
# create an instance of AdditionalPropertiesObject from a dict
|
||||
additional_properties_object_form_dict = additional_properties_object.from_dict(additional_properties_object_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# AdditionalPropertiesWithDescriptionOnly
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string
|
||||
additional_properties_with_description_only_instance = AdditionalPropertiesWithDescriptionOnly.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print AdditionalPropertiesWithDescriptionOnly.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
additional_properties_with_description_only_dict = additional_properties_with_description_only_instance.to_dict()
|
||||
# create an instance of AdditionalPropertiesWithDescriptionOnly from a dict
|
||||
additional_properties_with_description_only_form_dict = additional_properties_with_description_only.from_dict(additional_properties_with_description_only_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -38,7 +38,10 @@ from petstore_api.exceptions import ApiException
|
||||
from petstore_api.signing import HttpSigningConfiguration
|
||||
|
||||
# import models into sdk package
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
|
||||
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
|
||||
from petstore_api.models.animal import Animal
|
||||
from petstore_api.models.any_of_color import AnyOfColor
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
|
||||
|
||||
# import models into model package
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType
|
||||
from petstore_api.models.additional_properties_class import AdditionalPropertiesClass
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject
|
||||
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly
|
||||
from petstore_api.models.all_of_with_single_ref import AllOfWithSingleRef
|
||||
from petstore_api.models.animal import Animal
|
||||
from petstore_api.models.any_of_color import AnyOfColor
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, StrictStr
|
||||
|
||||
class AdditionalPropertiesAnyType(BaseModel):
|
||||
"""
|
||||
AdditionalPropertiesAnyType
|
||||
"""
|
||||
name: Optional[StrictStr] = None
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties = ["name"]
|
||||
|
||||
class Config:
|
||||
"""Pydantic configuration"""
|
||||
allow_population_by_field_name = True
|
||||
validate_assignment = True
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.dict(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> AdditionalPropertiesAnyType:
|
||||
"""Create an instance of AdditionalPropertiesAnyType from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the dictionary representation of the model using alias"""
|
||||
_dict = self.dict(by_alias=True,
|
||||
exclude={
|
||||
"additional_properties"
|
||||
},
|
||||
exclude_none=True)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: dict) -> AdditionalPropertiesAnyType:
|
||||
"""Create an instance of AdditionalPropertiesAnyType from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return AdditionalPropertiesAnyType.parse_obj(obj)
|
||||
|
||||
_obj = AdditionalPropertiesAnyType.parse_obj({
|
||||
"name": obj.get("name")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, StrictStr
|
||||
|
||||
class AdditionalPropertiesObject(BaseModel):
|
||||
"""
|
||||
AdditionalPropertiesObject
|
||||
"""
|
||||
name: Optional[StrictStr] = None
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties = ["name"]
|
||||
|
||||
class Config:
|
||||
"""Pydantic configuration"""
|
||||
allow_population_by_field_name = True
|
||||
validate_assignment = True
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.dict(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> AdditionalPropertiesObject:
|
||||
"""Create an instance of AdditionalPropertiesObject from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the dictionary representation of the model using alias"""
|
||||
_dict = self.dict(by_alias=True,
|
||||
exclude={
|
||||
"additional_properties"
|
||||
},
|
||||
exclude_none=True)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: dict) -> AdditionalPropertiesObject:
|
||||
"""Create an instance of AdditionalPropertiesObject from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return AdditionalPropertiesObject.parse_obj(obj)
|
||||
|
||||
_obj = AdditionalPropertiesObject.parse_obj({
|
||||
"name": obj.get("name")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, StrictStr
|
||||
|
||||
class AdditionalPropertiesWithDescriptionOnly(BaseModel):
|
||||
"""
|
||||
AdditionalPropertiesWithDescriptionOnly
|
||||
"""
|
||||
name: Optional[StrictStr] = None
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties = ["name"]
|
||||
|
||||
class Config:
|
||||
"""Pydantic configuration"""
|
||||
allow_population_by_field_name = True
|
||||
validate_assignment = True
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.dict(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> AdditionalPropertiesWithDescriptionOnly:
|
||||
"""Create an instance of AdditionalPropertiesWithDescriptionOnly from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the dictionary representation of the model using alias"""
|
||||
_dict = self.dict(by_alias=True,
|
||||
exclude={
|
||||
"additional_properties"
|
||||
},
|
||||
exclude_none=True)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: dict) -> AdditionalPropertiesWithDescriptionOnly:
|
||||
"""Create an instance of AdditionalPropertiesWithDescriptionOnly from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return AdditionalPropertiesWithDescriptionOnly.parse_obj(obj)
|
||||
|
||||
_obj = AdditionalPropertiesWithDescriptionOnly.parse_obj({
|
||||
"name": obj.get("name")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ class NullableClass(BaseModel):
|
||||
object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
|
||||
object_and_items_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
|
||||
object_items_nullable: Optional[Dict[str, Dict[str, Any]]] = None
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties = ["required_integer_prop", "integer_prop", "number_prop", "boolean_prop", "string_prop", "date_prop", "datetime_prop", "array_nullable_prop", "array_and_items_nullable_prop", "array_items_nullable", "object_nullable_prop", "object_and_items_nullable_prop", "object_items_nullable"]
|
||||
|
||||
class Config:
|
||||
@@ -62,8 +63,14 @@ class NullableClass(BaseModel):
|
||||
"""Returns the dictionary representation of the model using alias"""
|
||||
_dict = self.dict(by_alias=True,
|
||||
exclude={
|
||||
"additional_properties"
|
||||
},
|
||||
exclude_none=True)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
# set to None if required_integer_prop (nullable) is None
|
||||
# and __fields_set__ contains the field
|
||||
if self.required_integer_prop is None and "required_integer_prop" in self.__fields_set__:
|
||||
@@ -145,6 +152,11 @@ class NullableClass(BaseModel):
|
||||
"object_and_items_nullable_prop": obj.get("object_and_items_nullable_prop"),
|
||||
"object_items_nullable": obj.get("object_items_nullable")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.models.additional_properties_any_type import AdditionalPropertiesAnyType # noqa: E501
|
||||
from petstore_api.rest import ApiException
|
||||
|
||||
class TestAdditionalPropertiesAnyType(unittest.TestCase):
|
||||
"""AdditionalPropertiesAnyType unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional):
|
||||
"""Test AdditionalPropertiesAnyType
|
||||
include_option is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `AdditionalPropertiesAnyType`
|
||||
"""
|
||||
model = petstore_api.models.additional_properties_any_type.AdditionalPropertiesAnyType() # noqa: E501
|
||||
if include_optional :
|
||||
return AdditionalPropertiesAnyType(
|
||||
name = ''
|
||||
)
|
||||
else :
|
||||
return AdditionalPropertiesAnyType(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAdditionalPropertiesAnyType(self):
|
||||
"""Test AdditionalPropertiesAnyType"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -6,12 +6,12 @@
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by: https://openapi-generator.tech
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
@@ -33,7 +33,9 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
||||
include_option is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
|
||||
# uncomment below to create an instance of `AdditionalPropertiesClass`
|
||||
"""
|
||||
model = petstore_api.models.additional_properties_class.AdditionalPropertiesClass() # noqa: E501
|
||||
if include_optional :
|
||||
return AdditionalPropertiesClass(
|
||||
map_property = {
|
||||
@@ -48,6 +50,7 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
||||
else :
|
||||
return AdditionalPropertiesClass(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAdditionalPropertiesClass(self):
|
||||
"""Test AdditionalPropertiesClass"""
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.models.additional_properties_object import AdditionalPropertiesObject # noqa: E501
|
||||
from petstore_api.rest import ApiException
|
||||
|
||||
class TestAdditionalPropertiesObject(unittest.TestCase):
|
||||
"""AdditionalPropertiesObject unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional):
|
||||
"""Test AdditionalPropertiesObject
|
||||
include_option is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `AdditionalPropertiesObject`
|
||||
"""
|
||||
model = petstore_api.models.additional_properties_object.AdditionalPropertiesObject() # noqa: E501
|
||||
if include_optional :
|
||||
return AdditionalPropertiesObject(
|
||||
name = ''
|
||||
)
|
||||
else :
|
||||
return AdditionalPropertiesObject(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAdditionalPropertiesObject(self):
|
||||
"""Test AdditionalPropertiesObject"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,54 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
OpenAPI Petstore
|
||||
|
||||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
import petstore_api
|
||||
from petstore_api.models.additional_properties_with_description_only import AdditionalPropertiesWithDescriptionOnly # noqa: E501
|
||||
from petstore_api.rest import ApiException
|
||||
|
||||
class TestAdditionalPropertiesWithDescriptionOnly(unittest.TestCase):
|
||||
"""AdditionalPropertiesWithDescriptionOnly unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional):
|
||||
"""Test AdditionalPropertiesWithDescriptionOnly
|
||||
include_option is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `AdditionalPropertiesWithDescriptionOnly`
|
||||
"""
|
||||
model = petstore_api.models.additional_properties_with_description_only.AdditionalPropertiesWithDescriptionOnly() # noqa: E501
|
||||
if include_optional :
|
||||
return AdditionalPropertiesWithDescriptionOnly(
|
||||
name = ''
|
||||
)
|
||||
else :
|
||||
return AdditionalPropertiesWithDescriptionOnly(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAdditionalPropertiesWithDescriptionOnly(self):
|
||||
"""Test AdditionalPropertiesWithDescriptionOnly"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user