Description
When a Swagger file includes fields named like common Python types (date, float etc), from_dict() will fail with:
TypeError: 'NoneType' object is not callable
Swagger-codegen version
2.3.1
Swagger declaration file content or url
https://gist.github.com/gs11/b314d66f10e1c795178b821cf46934e8
Command line used for generation
java -jar swagger-codegen-cli-2.3.1.jar generate -l python-flask -i swagger/petstore-minimal.yaml -o swagger
Steps to reproduce
In the controller, convert the Pet() object to a dict and then convert it back:
pet = Pet()
pet.id = 12345
pet.name = "ACME pet"
pet.tag = "generic"
pet.date = "2018-04-02"
pet.int = "test"
pet.str = "test"
pet.float = "test"
pet.datetime = datetime.datetime.now()
pet_as_dict = pet.to_dict()
new_pet = Pet.from_dict(pet_as_dict)
Related issues/PRs
#6111
Suggest a fix/enhancement
Extend the lists with the following keywords:
float, int, str, date, datetime
Description
When a Swagger file includes fields named like common Python types (date, float etc), from_dict() will fail with:
Swagger-codegen version
2.3.1
Swagger declaration file content or url
https://gist.github.com/gs11/b314d66f10e1c795178b821cf46934e8
Command line used for generation
Steps to reproduce
In the controller, convert the Pet() object to a dict and then convert it back:
Related issues/PRs
#6111
Suggest a fix/enhancement
Extend the lists with the following keywords:
float, int, str, date, datetime