Handle correctly the case of no default response (see comment in #1124)

This commit is contained in:
b_sapir
2015-09-01 18:26:15 +03:00
parent d746894ecb
commit 31e8aca357
4 changed files with 10 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;