mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-01 21:20:55 +00:00
Each type used by any response is now added to the imports list
This commit is contained in:
parent
f9a16d856c
commit
c15ac0b6d4
@ -541,6 +541,7 @@ public class DefaultCodegen {
|
||||
}
|
||||
|
||||
private Response findMethodResponse(Map<String, Response> responses) {
|
||||
|
||||
String code = null;
|
||||
for(String responseCode : responses.keySet()) {
|
||||
if (responseCode.startsWith("2") || responseCode.equals("default")) {
|
||||
@ -627,6 +628,11 @@ public class DefaultCodegen {
|
||||
Response response = entry.getValue();
|
||||
CodegenResponse r = fromResponse(entry.getKey(), response);
|
||||
r.hasMore = true;
|
||||
if(r.baseType != null &&
|
||||
!defaultIncludes.contains(r.baseType) &&
|
||||
!languageSpecificPrimitives.contains(r.baseType))
|
||||
imports.add(r.baseType);
|
||||
|
||||
if (response == methodResponse)
|
||||
methodCodegenResponse = r;
|
||||
op.responses.add(r);
|
||||
@ -653,11 +659,6 @@ public class DefaultCodegen {
|
||||
}
|
||||
}
|
||||
|
||||
if(op.returnBaseType != null &&
|
||||
!defaultIncludes.contains(op.returnBaseType) &&
|
||||
!languageSpecificPrimitives.contains(op.returnBaseType))
|
||||
imports.add(op.returnBaseType);
|
||||
|
||||
List<Parameter> parameters = operation.getParameters();
|
||||
CodegenParameter bodyParam = null;
|
||||
List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user