clarify documentation: keywords are not required

This commit is contained in:
Athou
2013-08-11 11:50:30 +02:00
parent 0d730128f7
commit e26950671c
2 changed files with 17 additions and 22 deletions

View File

@@ -95,17 +95,14 @@ public class CategoryREST extends AbstractREST {
notes = "Get a list of category entries", notes = "Get a list of category entries",
responseClass = "com.commafeed.frontend.model.Entries") responseClass = "com.commafeed.frontend.model.Entries")
public Response getCategoryEntries( public Response getCategoryEntries(
@ApiParam(value = "id of the category, 'all' or 'starred'", required = true) @QueryParam("id") String id, @ApiParam( @ApiParam(value = "id of the category, 'all' or 'starred'", required = true) @QueryParam("id") String id,
value = "all entries or only unread ones", @ApiParam(value = "all entries or only unread ones", allowableValues = "all,unread", required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType,
allowableValues = "all,unread", @ApiParam(value = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType, @ApiParam( @ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
value = "only entries newer than this") @QueryParam("newerThan") Long newerThan, @ApiParam(value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
@ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset, @ApiParam( @ApiParam(value = "date ordering", allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit, @ApiParam( @ApiParam(
value = "date ordering", value = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, @ApiParam(
value = "keywords separated by spaces, 3 characters minimum",
required = true) @QueryParam("keywords") String keywords,
@ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) { @ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) {
Preconditions.checkNotNull(readType); Preconditions.checkNotNull(readType);

View File

@@ -132,17 +132,15 @@ public class FeedREST extends AbstractREST {
@Path("/entries") @Path("/entries")
@GET @GET
@ApiOperation(value = "Get feed entries", notes = "Get a list of feed entries", responseClass = "com.commafeed.frontend.model.Entries") @ApiOperation(value = "Get feed entries", notes = "Get a list of feed entries", responseClass = "com.commafeed.frontend.model.Entries")
public Response getFeedEntries(@ApiParam(value = "id of the feed", required = true) @QueryParam("id") String id, @ApiParam( public Response getFeedEntries(
value = "all entries or only unread ones", @ApiParam(value = "id of the feed", required = true) @QueryParam("id") String id,
allowableValues = "all,unread", @ApiParam(value = "all entries or only unread ones", allowableValues = "all,unread", required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType,
required = true) @DefaultValue("unread") @QueryParam("readType") ReadingMode readType, @ApiParam( @ApiParam(value = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
value = "only entries newer than this") @QueryParam("newerThan") Long newerThan, @ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
@ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset, @ApiParam( @ApiParam(value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
value = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit, @ApiParam( @ApiParam(value = "date ordering", allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
value = "date ordering", @ApiParam(
allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, @ApiParam( value = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
value = "keywords separated by spaces, 3 characters minimum",
required = true) @QueryParam("keywords") String keywords,
@ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) { @ApiParam(value = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) {
Preconditions.checkNotNull(id); Preconditions.checkNotNull(id);