Use the DefaultValue
annotation parameter (accepts strings) the place you set the default worth alongside the QueryParam
annotation
@GET
@Path("/bookmarks")
@Produces(MediaType.APPLICATION_JSON)
@Operation(
abstract = "Return bookmarks from repository",
description = "Return bookmarks from repository")
@ApiResponses({
@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "403", description = "Forbidden")
})
@RolesAllowed(ADMIN_ROLE)
public void getAllBookmarks(
@Parameter(description = "max variety of returned bookmarks")
@DefaultValue(Integer.MAX_VALUE + "")
@QueryParam("maxResult") Integer maxResult) {
bookmarksService.getBookmarks(maxResult);
}
Shared with ❤️ from Codever. Use 👉 copy to mine performance so as to add it to your private snippets assortment.