Hi!
I faced up with a problem in kubernetes python client kubernetes-client/python#2196.
This client use openapi-generator. For str responses that looks like a good json we have a bad transformation:
{"a": "a"} \\ valid json string
comes to
{'a': 'a'} \\ not valid
The reason for this in this line:
|
data = json.loads(response.data) |
There we have
response_type == 'str'
response.data == '{"a": "a"}'
This is a valid json, so after L340:
data == {'a': 'a'} # this is a dict object in python (no more string)
Then self.__deserialize_primitive transforms this dict to string:
return klass(data) # where klass == str, data = {'a': 'a'}
In python str(dict(a="a")) == {'a': 'a'}
So, after this transformations double quotes replaced by ordinary quotes.
Hi!
I faced up with a problem in kubernetes python client kubernetes-client/python#2196.
This client use openapi-generator. For
strresponses that looks like a good json we have a bad transformation:The reason for this in this line:
openapi-generator/modules/openapi-generator/src/main/resources/python-pydantic-v1/api_client.mustache
Line 340 in 1fbf722
There we have
This is a valid
json, so after L340:Then
self.__deserialize_primitivetransforms thisdictto string:In python
str(dict(a="a")) == {'a': 'a'}So, after this transformations double quotes replaced by ordinary quotes.