Document return codes

This commit is contained in:
René Pfeuffer
2018-06-27 11:23:08 +02:00
parent e41c0323f3
commit 10e951c4b1
3 changed files with 6 additions and 1 deletions

View File

@@ -80,6 +80,7 @@ public class GroupCollectionResource {
@ResponseHeader(name = "Location", description = "uri to the created group")
}),
@ResponseCode(code = 403, condition = "forbidden, the current user has no admin privileges"),
@ResponseCode(code = 409, condition = "conflict, a group with this name already exists"),
@ResponseCode(code = 500, condition = "internal server error")
})
@TypeHint(TypeHint.NO_CONTENT.class)

View File

@@ -80,8 +80,11 @@ public class UserCollectionResource {
@POST
@Path("")
@StatusCodes({
@ResponseCode(code = 201, condition = "create success"),
@ResponseCode(code = 201, condition = "create success", additionalHeaders = {
@ResponseHeader(name = "Location", description = "uri to the created user")
}),
@ResponseCode(code = 403, condition = "forbidden, the current user does not have the \"user\" privilege"),
@ResponseCode(code = 409, condition = "conflict, a user with this name already exists"),
@ResponseCode(code = 500, condition = "internal server error")
})
@TypeHint(TypeHint.NO_CONTENT.class)

View File

@@ -70,6 +70,7 @@ public class UserResource {
@StatusCodes({
@ResponseCode(code = 204, condition = "update success"),
@ResponseCode(code = 403, condition = "forbidden, the current user does not have the \"user\" privilege"),
@ResponseCode(code = 404, condition = "not found, no user with the specified id/name available"),
@ResponseCode(code = 500, condition = "internal server error")
})
@TypeHint(TypeHint.NO_CONTENT.class)