python-experimental adds DecimalSchema (#11282)

* Fixes test

* Adds decimal examples to the pythonExp generator

* Adds isDecimal to CodegenModel, updates python-exp samples

* Fixes decimal types in ObjectModelWIthDecimalProperties and DecimalPayload

* Updates tests

* Decimal feature added to python-exp docs

* Samples and docs regenerated
This commit is contained in:
Justin Black
2022-01-11 21:51:50 -08:00
committed by GitHub
parent ce04e9b6a2
commit 95a1154c20
314 changed files with 1379 additions and 680 deletions

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,7 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

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

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

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

View File

@@ -9,7 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,7 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import unittest
import petstore_api
@@ -25,8 +24,8 @@ class TestFakeClassnameTags123Api(unittest.TestCase):
def tearDown(self):
pass
def test_test_classname(self):
"""Test case for test_classname
def test_classname(self):
"""Test case for classname
To test class name in snake case # noqa: E501
"""

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

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

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

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

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api
@@ -28,27 +26,9 @@ class TestObjectWithDifficultlyNamedProps(unittest.TestCase):
def test_ObjectWithDifficultlyNamedProps(self):
"""Test ObjectWithDifficultlyNamedProps"""
kwargs = {
'$special[property.name]': 1,
'123-list': '',
'123Number': 2,
}
model = ObjectWithDifficultlyNamedProps(**kwargs)
self.assertEqual(model['$special[property.name]'], 1)
self.assertEqual(model['123-list'], '')
self.assertEqual(model['123Number'], 2)
self.assertEqual(model, kwargs)
# without the required argument, an exception is raised
optional_kwargs = {
'$special[property.name]': 1,
'123Number': 2,
}
with self.assertRaisesRegex(
petstore_api.ApiTypeError,
r"ObjectWithDifficultlyNamedProps is missing 1 required argument: ['123-list']"
):
ObjectWithDifficultlyNamedProps(**optional_kwargs)
# FIXME: construct object with mandatory attributes with example values
# model = ObjectWithDifficultlyNamedProps() # noqa: E501
pass
if __name__ == '__main__':

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,7 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import unittest
import petstore_api
@@ -74,13 +73,6 @@ class TestPetApi(unittest.TestCase):
"""
pass
def test_upload_file(self):
"""Test case for upload_file
uploads an image # noqa: E501
"""
pass
def test_upload_file_with_required_file(self):
"""Test case for upload_file_with_required_file
@@ -88,6 +80,13 @@ class TestPetApi(unittest.TestCase):
"""
pass
def test_upload_image(self):
"""Test case for upload_image
uploads an image # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

View File

@@ -9,8 +9,6 @@
Generated by: https://openapi-generator.tech
"""
import sys
import unittest
import petstore_api

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