mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 07:47:07 +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:
@@ -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,11 +50,12 @@ class TestAdditionalPropertiesClass(unittest.TestCase):
|
||||
else :
|
||||
return AdditionalPropertiesClass(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAdditionalPropertiesClass(self):
|
||||
"""Test AdditionalPropertiesClass"""
|
||||
inst_req_only = self.make_instance(include_optional=False)
|
||||
inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
# 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_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