Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,13 @@ public Operation convertOperation(String tag, io.swagger.models.apideclaration.O

// default response type
Property responseProperty = propertyFromTypedObject(operation);
if (responseProperty != null) {
Response response = new Response()
.description("success")
.schema(responseProperty);
if (output.getResponses() == null) {
output.defaultResponse(response);
} else {
output.response(200, response);
}
Response response = new Response()
.description("success")
.schema(responseProperty);
if (output.getResponses() == null) {
output.defaultResponse(response);
} else if (responseProperty != null) {
output.response(200, response);
}

Map<String, List<AuthorizationScope>> auths = operation.getAuthorizations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ public void testFixedProperties() throws IOException {
for (Response item : path.getPost().getResponses().values()) {
assertNull(item.getSchema());
}
assertNull(path.getDelete().getResponses());
assertEquals(path.getDelete().getResponses().size(), 1);
assertEquals(path.getDelete().getResponses().containsKey("default"), true);
assertEquals(path.getDelete().getResponses().get("default").getDescription(), "success");

final PathParameter id = (PathParameter) Iterables.find(path.getPatch().getParameters(),
new Predicate<Parameter>() {

Expand Down