Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java and Android codegen-ed API sources don't list the nested model classes in the imports #290

Closed
maneeshsahu opened this issue Oct 1, 2014 · 5 comments

Comments

@maneeshsahu
Copy link

The Java and Android API Codegen only imports the outermost model classes. Other model classes that are nested within these classes are not imported.

Quick fix - Do a * style import in . Depend on IDE to optimize the imports.

@fehguy
Copy link
Contributor

fehguy commented Oct 1, 2014

I believe this was pushed to develop_2.0 yesterday. Can you please pull and confirm?

@maneeshsahu
Copy link
Author

The imports are not complete. On closer examination of the generated code, the HTTP request model classes are not imported, only the response classes for the API are imported.

@maneeshsahu
Copy link
Author

Same issue with Objc generated code. Only imports for the Response classes, none for the Requests.

@fehguy fehguy added this to the v2.1 milestone Oct 17, 2014
@xhh
Copy link
Contributor

xhh commented Apr 15, 2015

This has been fixed as there is a wildcard import (*) now (I checked the develop_2.0 branch).
For example in PetApi.java from the Petstore Java sample:

package io.swagger.client.api;

import io.swagger.client.ApiException;
import io.swagger.client.ApiInvoker;

import io.swagger.client.model.*;

import java.util.*;

import io.swagger.client.model.Pet;
import java.io.File;

There is redundant import though, i.e. the "io.swagger.client.model.Pet" import is no longer needed.

@fehguy
Copy link
Contributor

fehguy commented Apr 15, 2015

yes, we may have redundant imports. I'll close this and we can reopen as needed.

@fehguy fehguy closed this as completed Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants