Open eak24 opened 5 years ago
Have you checked if the attribute_map in your response-class in the models folder is correct? I had an issue where the case expected from the API was not the actual case being returned - i.e. the expected case was Camel but the returned was Snake.
Description
When referencing a model within 'definitions', the serialization protocol doesn't properly parse a list of objects.
More specifically, there is a problem with a model definition that looks like this when it is linked as the root definition of the response:
What happens is the deserializer doesn't recognize the list as a list of swagger type objects. When the definition is changed to:
And definitions would look like:
I'm not entirely sure why these two samples have different behavior - but it appears that inline response definitions are treated differently than linked definitions. When the inline version of the client recieves a response, it passes a klass of 'list[my_object]' (the correct behavior) and continues to parse the internal elements correctly within api_client.ApiClient.__deserialize(). However, if using the first definition of the object, the klass becomes 'my_object_array' and the corresponding swagger_types and attribute_map dictionaries are passed as empty and the data is returned without being deserialized, according to line 604 of apiClient.
Swagger-codegen version
2.3.1
Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement