mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 14:56:08 +00:00
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:
@@ -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()
|
||||
Reference in New Issue
Block a user