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:
Thomas Hervé
2021-04-14 20:43:28 +02:00
committed by GitHub
parent 9edf70e980
commit 60dcf8613f
11 changed files with 249 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
"""
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: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api
from petstore_api.model.readonly import Readonly
class TestReadonly(unittest.TestCase):
"""Readonly unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testReadonly(self):
"""Test Readonly"""
# FIXME: construct object with mandatory attributes with example values
# model = Readonly() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()