forked from loafle/openapi-generator-original
Handle correctly the case of no default response (see comment in #1124)
This commit is contained in:
@@ -12,7 +12,7 @@ public class CodegenOperation {
|
||||
public final List<CodegenProperty> responseHeaders = new ArrayList<CodegenProperty>();
|
||||
public Boolean hasConsumes, hasProduces, hasParams, returnTypeIsPrimitive,
|
||||
returnSimpleType, subresourceOperation, isMapContainer, isListContainer,
|
||||
hasMore = Boolean.TRUE, isMultipart;
|
||||
hasMore = Boolean.TRUE, isMultipart, isResponseBinary = Boolean.FALSE;
|
||||
public String path, operationId, returnType, httpMethod, returnBaseType,
|
||||
returnContainer, summary, notes, baseName, defaultResponse;
|
||||
public List<Map<String, String>> consumes, produces;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CodegenResponse {
|
||||
public Boolean primitiveType;
|
||||
public Boolean isMapContainer;
|
||||
public Boolean isListContainer;
|
||||
public Boolean isBinary;
|
||||
public Boolean isBinary = Boolean.FALSE;
|
||||
public Object schema;
|
||||
public String jsonSchema;
|
||||
|
||||
|
||||
@@ -835,6 +835,9 @@ public class DefaultCodegen {
|
||||
}
|
||||
r.isDefault = response == methodResponse;
|
||||
op.responses.add(r);
|
||||
if (r.isBinary && r.isDefault){
|
||||
op.isResponseBinary = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
op.responses.get(op.responses.size() - 1).hasMore = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user