Skip to content

Commit

Permalink
Fix annotation errors. #5431
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwallen authored and fxprunayre committed Feb 26, 2021
1 parent adadde4 commit da4fe67
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 25 deletions.
16 changes: 10 additions & 6 deletions services/src/main/java/org/fao/geonet/api/links/LinksApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jeeves.server.UserSession;
import jeeves.server.context.ServiceContext;
Expand Down Expand Up @@ -125,13 +127,14 @@ public void iniMBeansSlidingWindowWithEmptySlot() {
description = "")
@Parameters({
@Parameter(name = "page",
//dataType = "integer", paramType = "query",
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32"),
description = "Results page you want to retrieve (0..N)"),
@Parameter(name = "size",
//dataType = "integer", paramType = "query",
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32"),
description = "Number of records per page."),
@Parameter(name = "sort",
//allowMultiple = false, dataType = "string", paramType = "query",
//allowMultiple = false
in = ParameterIn.QUERY, schema = @Schema(type = "string"),
description = "Sorting criteria in the format: property(,asc|desc). " +
"Default sort order is ascending. ")
})
Expand Down Expand Up @@ -208,13 +211,14 @@ private Page<Link> getLinks(
description = "Get record links as CSV")
@Parameters({
@Parameter(name = "page",
//dataType = "integer", paramType = "query",
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32"),
description = "Results page you want to retrieve (0..N)"),
@Parameter(name = "size",
//dataType = "integer", paramType = "query",
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32"),
description = "Number of records per page."),
@Parameter(name = "sort",
//allowMultiple = false, dataType = "string", paramType = "query",
//allowMultiple = false
in = ParameterIn.QUERY, schema = @Schema(type = "string"),
description = "Sorting criteria in the format: property(,asc|desc). " +
"Default sort order is ascending. ")
})
Expand Down
34 changes: 18 additions & 16 deletions services/src/main/java/org/fao/geonet/api/records/CatalogApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import com.google.common.collect.ImmutableSet;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
Expand Down Expand Up @@ -531,23 +533,23 @@ public void exportAsCsv(
"application/rdf+xml", "*"
})
@Parameters({
@Parameter(name = "from", description = "Indicates the start position in a sorted list of matches that the client wants to use as the beginning of a page result.", required = false),
//, defaultValue = "1", dataType = "int", paramType = "query"
@Parameter(name = "hitsPerPage", description = "Indicates the number of hits per page.", required = false),
//dataType = "int", paramType = "query"),
@Parameter(name = "from", description = "Indicates the start position in a sorted list of matches that the client wants to use as the beginning of a page result.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32", defaultValue = "1")),
@Parameter(name = "hitsPerPage", description = "Indicates the number of hits per page.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "integer", format = "int32")),
//@Parameter(name="to", value = "Indicates the end position in a sorted list of matches that the client wants to use as the ending of a page result", required = false, defaultValue ="10", dataType = "int", paramType = "query"),
@Parameter(name = "any", description = "Search key", required = false),
//dataType = "string", paramType = "query"),
@Parameter(name = "title", description = "A search key for the title.", required = false),
//dataType = "string", paramType = "query"),
@Parameter(name = "facet.q", description = "A search facet in the Lucene index. Use the GeoNetwork GUI search to generate the suitable filter values. Example: standard/dcat-ap&createDateYear/2018&sourceCatalog/6d93613e-2b76-4e26-94af-4b4c420a1758 (filter by creation year and source catalog).", required = false),
//, dataType = "string", paramType = "query"),
@Parameter(name = "sortBy", description = "Lucene sortBy criteria. Relevant values: relevance, title, changeDate.", required = false), //, , dataType = "string", paramType = "query"),
@Parameter(name = "sortOrder", description = "Sort order. Possible values: reverse.", required = false),
//, dataType = "string", paramType = "query"),
@Parameter(name = "similarity", description = "Use the Lucene FuzzyQuery. Values range from 0.0 to 1.0 and defaults to 0.8.", required = false)
//, defaultValue = "0.8", dataType = "float", paramType = "query")

@Parameter(name = "any", description = "Search key", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "title", description = "A search key for the title.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "facet.q", description = "A search facet in the Lucene index. Use the GeoNetwork GUI search to generate the suitable filter values. Example: standard/dcat-ap&createDateYear/2018&sourceCatalog/6d93613e-2b76-4e26-94af-4b4c420a1758 (filter by creation year and source catalog).", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "sortBy", description = "Lucene sortBy criteria. Relevant values: relevance, title, changeDate.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "sortOrder", description = "Sort order. Possible values: reverse.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "string")),
@Parameter(name = "similarity", description = "Use the Lucene FuzzyQuery. Values range from 0.0 to 1.0 and defaults to 0.8.", required = false,
in = ParameterIn.QUERY, schema = @Schema(type = "number", format = "float", defaultValue = "0.8"))
})
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Return the catalog content as RDF."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
*/
package org.fao.geonet.api.records.editing;

import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_OPS;
import static org.fao.geonet.api.ApiParams.API_CLASS_RECORD_TAG;

import com.google.common.collect.Sets;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
Expand Down Expand Up @@ -66,9 +69,9 @@
@RequestMapping(value = {
"/{portal}/api/records"
})
@Tag(name = "records",
description = "Metadata record editing operations")
@Controller("records/edit")
@Tag(name = API_CLASS_RECORD_TAG,
description = API_CLASS_RECORD_OPS)
@Controller("recordsBatchEdit")
@ReadWriteController
public class BatchEditsApi implements ApplicationContextAware {
@Autowired
Expand Down

0 comments on commit da4fe67

Please sign in to comment.