From 613f27fd7eb510a517f1b54f045d99c962fc78b1 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Wed, 27 Dec 2023 13:36:42 +0100 Subject: [PATCH] #537 fixed dataset search parameters documentation --- .../ws/resources/DatasetResource.java | 113 +++++++++++------- 1 file changed, 68 insertions(+), 45 deletions(-) diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java index 707317e9f..978cf2d6f 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java @@ -45,13 +45,7 @@ import org.gbif.api.service.registry.DatasetSearchService; import org.gbif.api.service.registry.DatasetService; import org.gbif.api.util.iterables.Iterables; -import org.gbif.api.vocabulary.Continent; -import org.gbif.api.vocabulary.Country; -import org.gbif.api.vocabulary.DatasetSubtype; -import org.gbif.api.vocabulary.DatasetType; -import org.gbif.api.vocabulary.IdentifierType; -import org.gbif.api.vocabulary.License; -import org.gbif.api.vocabulary.MetadataType; +import org.gbif.api.vocabulary.*; import org.gbif.common.messaging.api.MessagePublisher; import org.gbif.common.messaging.api.messages.Platform; import org.gbif.common.messaging.api.messages.StartCrawlMessage; @@ -237,13 +231,6 @@ public DatasetResource( @Retention(RetentionPolicy.RUNTIME) @Parameters( value = { - @Parameter( - name = "country", - description = - "The 2-letter country code (as per ISO-3166-1) of the country publishing the dataset.", - schema = @Schema(implementation = Country.class), - in = ParameterIn.QUERY, - explode = Explode.FALSE), @Parameter( name = "type", description = "The primary type of the dataset.", @@ -256,24 +243,6 @@ public DatasetResource( schema = @Schema(implementation = DatasetSubtype.class), in = ParameterIn.QUERY, explode = Explode.TRUE), - @Parameter( - name = "license", - description = "The dataset's licence.", - schema = @Schema(implementation = License.class), - in = ParameterIn.QUERY, - explode = Explode.TRUE), - @Parameter( - name = "identifier", - description = "An identifier such as a DOI or UUID.", - schema = @Schema(implementation = String.class), - in = ParameterIn.QUERY), - @Parameter( - name = "keyword", - description = - "Filters datasets by a case insensitive plain text keyword. The search is done on the merged " - + "collection of tags, the dataset keywordCollections and temporalCoverages.", - schema = @Schema(implementation = String.class), - in = ParameterIn.QUERY), @Parameter( name = "publishingOrg", description = "Filters datasets by their publishing organization UUID key", @@ -285,9 +254,11 @@ public DatasetResource( schema = @Schema(implementation = UUID.class), in = ParameterIn.QUERY), @Parameter( - name = "endorsingNodeKey", - description = "Node key that endorsed this dataset's publisher", - schema = @Schema(implementation = UUID.class), + name = "keyword", + description = + "Filters datasets by a case insensitive plain text keyword. The search is done on the merged " + + "collection of tags, the dataset keywordCollections and temporalCoverages.", + schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( name = "decade", @@ -305,17 +276,16 @@ public DatasetResource( in = ParameterIn.QUERY, explode = Explode.FALSE), @Parameter( - name = "projectId", + name = "hostingCountry", description = - "Filter or facet based on the project ID of a given dataset. A dataset can have a project id if " - + "it is the result of a project. multiple datasets can have the same project id.", - schema = @Schema(implementation = String.class), + "Filters datasets by their hosting organization's country given as a ISO 639-1 (2 letter) country code", + schema = @Schema(implementation = Country.class), in = ParameterIn.QUERY, - example = "AA003-AA003311F"), + explode = Explode.FALSE), @Parameter( - name = "hostingCountry", + name = "country", description = - "Filters datasets by their hosting organization's country given as a ISO 639-1 (2 letter) country code", + "The 2-letter country code (as per ISO-3166-1) of the country publishing the dataset.", schema = @Schema(implementation = Country.class), in = ParameterIn.QUERY, explode = Explode.FALSE), @@ -326,11 +296,64 @@ public DatasetResource( in = ParameterIn.QUERY, deprecated = true, explode = Explode.FALSE), + @Parameter( + name = "license", + description = "The dataset's licence.", + schema = @Schema(implementation = License.class), + in = ParameterIn.QUERY, + explode = Explode.TRUE), + @Parameter( + name = "projectId", + description = + "Filter or facet based on the project ID of a given dataset. A dataset can have a project id if " + + "it is the result of a project. multiple datasets can have the same project id.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "AA003-AA003311F"), + @Parameter( + name = "taxonKey", + description = "A taxon key from the GBIF backbone.", + schema = @Schema(implementation = Integer.class), + in = ParameterIn.QUERY), + @Parameter( + name = "recordCount", + description = + "Number of records of the dataset. Accepts ranges and a '*' can be used as a wildcard.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "100,*"), + @Parameter( + name = "modifiedDate", + description = + "Date when the dataset was modified the last time. Accepts ranges and a '*' can be used as a wildcard.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "2022-05-01,*"), + @Parameter( + name = "doi", + description = "A DOI identifier.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY), @Parameter( name = "networkKey", description = "Network associated to a dataset", schema = @Schema(implementation = UUID.class), in = ParameterIn.QUERY), + @Parameter( + name = "endorsingNodeKey", + description = "Node key that endorsed this dataset's publisher", + schema = @Schema(implementation = UUID.class), + in = ParameterIn.QUERY), + @Parameter( + name = "installationKey", + description = "Key of the installation that hosts the dataset.", + schema = @Schema(implementation = UUID.class), + in = ParameterIn.QUERY), + @Parameter( + name = "endpointType", + description = "Type of the endpoint of the dataset.", + schema = @Schema(implementation = EndpointType.class), + in = ParameterIn.QUERY), @Parameter(name = "request", hidden = true), @Parameter(name = "searchRequest", hidden = true), @Parameter(name = "suggestRequest", hidden = true) @@ -340,9 +363,9 @@ public DatasetResource( @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Parameter( - name = "metadataKey", - description = "Key for the *metadata document* (not a dataset UUID).", - in = ParameterIn.PATH) + name = "metadataKey", + description = "Key for the *metadata document* (not a dataset UUID).", + in = ParameterIn.PATH) @interface MetadataDocumentKeyParameter {} @Operation(