swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
Currently the generated Java files reference imports that are not used, resulting in compiler warnings.
e.g. for Java jaxrs-cxf Models:
import java.io.File; // Warning e.g. in Models
import io.swagger.model.HelloModel;
import java.io.InputStream; // Warning e.g. in Models
import java.io.OutputStream; // Warning e.g. in Models
import java.util.List; // Warning e.g. in Models
import java.util.Map; // Warning e.g. in Models
import javax.ws.rs.*;
import javax.ws.rs.core.Response; // Warning e.g. in Models
Swagger-codegen version
master
Suggest a fix/enhancement
The quick fix would be to use more generalized imports like :
Description
Currently the generated Java files reference imports that are not used, resulting in compiler warnings.
e.g. for Java jaxrs-cxf Models:
Swagger-codegen version
master
Suggest a fix/enhancement
The quick fix would be to use more generalized imports like :
Alternatively or supplementing this, we could use a routine to automatically cleanup the unused imports after generating the code?