mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-02 05:30:51 +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) {
|
private Response findMethodResponse(Map<String, Response> responses) {
|
||||||
|
|
||||||
String code = null;
|
String code = null;
|
||||||
for(String responseCode : responses.keySet()) {
|
for(String responseCode : responses.keySet()) {
|
||||||
if (responseCode.startsWith("2") || responseCode.equals("default")) {
|
if (responseCode.startsWith("2") || responseCode.equals("default")) {
|
||||||
@ -627,6 +628,11 @@ public class DefaultCodegen {
|
|||||||
Response response = entry.getValue();
|
Response response = entry.getValue();
|
||||||
CodegenResponse r = fromResponse(entry.getKey(), response);
|
CodegenResponse r = fromResponse(entry.getKey(), response);
|
||||||
r.hasMore = true;
|
r.hasMore = true;
|
||||||
|
if(r.baseType != null &&
|
||||||
|
!defaultIncludes.contains(r.baseType) &&
|
||||||
|
!languageSpecificPrimitives.contains(r.baseType))
|
||||||
|
imports.add(r.baseType);
|
||||||
|
|
||||||
if (response == methodResponse)
|
if (response == methodResponse)
|
||||||
methodCodegenResponse = r;
|
methodCodegenResponse = r;
|
||||||
op.responses.add(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();
|
List<Parameter> parameters = operation.getParameters();
|
||||||
CodegenParameter bodyParam = null;
|
CodegenParameter bodyParam = null;
|
||||||
List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
|
List<CodegenParameter> allParams = new ArrayList<CodegenParameter>();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user