Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform "void" response types #140

Merged
merged 2 commits into from
Dec 24, 2015
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