add support for union of strictfloat and strictint (#15124)

This commit is contained in:
William Cheng
2023-04-06 11:51:12 +08:00
committed by GitHub
parent b409ceb3a0
commit 07227d4650
38 changed files with 1530 additions and 34 deletions

View File

@@ -59,6 +59,17 @@ class TestManual(unittest.TestCase):
api_response = api_instance.test_binary_gif()
self.assertEqual((base64.b64encode(api_response)).decode("utf-8"), "R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")
def testNumberPropertiesOnly(self):
n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123, "float": 456, "double": 34}')
self.assertEqual(n.number, 123)
self.assertEqual(n.float, 456)
self.assertEqual(n.double, 34)
n = openapi_client.NumberPropertiesOnly.from_json('{"number": 123.1, "float": 456.2, "double": 34.3}')
self.assertEqual(n.number, 123.1)
self.assertEqual(n.float, 456.2)
self.assertEqual(n.double, 34.3)
class EchoServerResponseParser():
def __init__(self, http_response):
if http_response is None: