forked from loafle/openapi-generator-original
Don't include read-only properties in Python examples. (#9252)
* Don't include read-only properties in Python examples. When using a schema with read-only fields as API inputs, Python generates examples for those: this excludes them. * Fix tests
This commit is contained in:
@@ -20,6 +20,7 @@ except ImportError:
|
||||
number_with_validations = sys.modules[
|
||||
'petstore_api.model.number_with_validations']
|
||||
from petstore_api.model.object_model_with_ref_props import ObjectModelWithRefProps
|
||||
from petstore_api.model.readonly import Readonly
|
||||
|
||||
|
||||
class TestObjectModelWithRefProps(unittest.TestCase):
|
||||
@@ -38,6 +39,7 @@ class TestObjectModelWithRefProps(unittest.TestCase):
|
||||
ObjectModelWithRefProps.openapi_types,
|
||||
{
|
||||
'my_number': (NumberWithValidations,),
|
||||
'my_readonly': (Readonly,),
|
||||
'my_string': (str,),
|
||||
'my_boolean': (bool,),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user