Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Generated SDKs contains duplicate models which refers the same object in the API definition #11

Open
stevben opened this issue Mar 30, 2016 · 2 comments

Comments

@stevben
Copy link

stevben commented Mar 30, 2016

Hi,

I don't think this is related to api-gateway-secure-pet-store itself, but the problem we face can be reproduced easily with this repository.

It appears that the SDK generation of Api Gateway (iOS, Androïd) is not very smart when dealing with array of objects (Pets in this case). Instead of using the 'Pet' model as the item of the array, the SDK generates a third model called 'Pets_Item' which is exactly the same than 'Pet'.

This is very annoying for Client developers because they have to handle two different classes for the same domain depending of the services they call (GET /pets or GET/pets/{id}).

In result, they have to write patch to have something useable...and the magic suddenly disappears.

Do you think is there any way to avoid the third model by fixing something in the Swagger file ? We tried several changes but without any success.
capture d ecran 2016-03-30 a 23 09 16

@sapessi
Copy link
Contributor

sapessi commented Apr 1, 2016

Thanks for the feedback. We are looking into this.

@stevben
Copy link
Author

stevben commented Apr 2, 2016

Thanks.

Note that I discuss about that also here with @balakataws. Please tell me where is the best place to speak about that (since the code generation tool is not an opensource project).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants