Bug - python client deserialization when attribute named self (#9006)

* fix by mapping outside of class

* tests

* regeneration and tests

* server

* INDENT

* a

* enable mapping

* Revert "server"

This reverts commit 6fc9712fb5.

* Samples regenerated

Co-authored-by: Justin Black <justin.a.black@gmail.com>
This commit is contained in:
gbmarc1
2021-04-10 22:00:32 -04:00
committed by GitHub
parent 14c7f39c2b
commit 8e0955fd3c
12 changed files with 262 additions and 16 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.some_object_with_self_attr import SomeObjectWithSelfAttr
class TestSomeObjectWithSelfAttr(unittest.TestCase):
"""SomeObjectWithSelfAttr unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testSomeObjectWithSelfAttr(self):
"""Test SomeObjectWithSelfAttr"""
kwargs = {"self": "this is a string", "_spec_property_naming": True}
model = SomeObjectWithSelfAttr(**kwargs)
assert model._self == "this is a string"
if __name__ == '__main__':
unittest.main()