Merge pull request #1169 from boazsapir/master

Handle correctly the case of no default response (see comment in #1124)
This commit is contained in:
wing328
2015-09-02 18:03:02 +08:00
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

@@ -932,6 +932,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;