Skip to content

Commit df292be

Browse files
fix: add response documentation
1 parent 1b8334e commit df292be

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/swagger-generator/src/main/java/io/swagger/generator/resource/SwaggerResource.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import io.swagger.annotations.Api;
44
import io.swagger.annotations.ApiOperation;
55
import io.swagger.annotations.ApiParam;
6+
import io.swagger.annotations.ApiResponse;
7+
import io.swagger.annotations.ApiResponses;
68
import io.swagger.codegen.CliOption;
79
import io.swagger.codegen.Codegen;
810
import io.swagger.codegen.CodegenConfig;
@@ -69,6 +71,11 @@ public class SwaggerResource {
6971
notes = "A valid `fileId` is generated by the `/clients/{language}` or `/servers/{language}` POST "
7072
+ "operations. The fileId code can be used just once, after which a new `fileId` will need to "
7173
+ "be requested.", response = String.class, tags = {"clients", "servers"})
74+
@ApiResponses(value = {
75+
@ApiResponse(code = 200, message = "File successfully downloaded. Response contains ZIP file bytes."),
76+
@ApiResponse(code = 404, message = "File with the given fileId not found or already downloaded."),
77+
@ApiResponse(code = 500, message = "Server error while reading or returning the file.")
78+
})
7279
public Response downloadFile(@PathParam("fileId") String fileId) {
7380
Generated g = fileMap.get(fileId);
7481
LOGGER.info("Looking for fileId: {}", fileId);

0 commit comments

Comments
 (0)