From dbff459c9d9fc42340ad46ee8ee1368ea493881a Mon Sep 17 00:00:00 2001 From: alainbodiguel Date: Thu, 28 Mar 2024 09:29:28 +0100 Subject: [PATCH] Upgrade to swagger2 / DW4 --- .github/workflows/.trivyignore | 2 - .github/workflows/tests.yaml | 8 +- arlas-commons/pom.xml | 88 +- .../config/ArlasAuthConfiguration.java | 2 +- .../commons/config/ArlasConfiguration.java | 2 +- .../commons/exceptions/ArlasException.java | 5 +- .../exceptions/ArlasExceptionMapper.java | 6 +- .../exceptions/BadRequestException.java | 2 +- .../ConstraintViolationExceptionMapper.java | 6 +- .../IllegalArgumentExceptionMapper.java | 4 +- .../exceptions/InvalidParameterException.java | 2 +- .../JsonProcessingExceptionMapper.java | 4 +- .../exceptions/NotAllowedException.java | 2 +- .../commons/exceptions/NotFoundException.java | 2 +- .../exceptions/NotImplementedException.java | 2 +- .../commons/exceptions/ParseException.java | 2 +- .../rest/utils/InsensitiveCaseFilter.java | 11 +- .../commons/rest/utils/PrettyPrintFilter.java | 11 +- .../rest/utils/PrettyWriterModifier.java | 6 +- .../commons/rest/utils/ResponseFormatter.java | 5 +- .../commons/utils/MapAwareConverter.java | 59 + .../io/arlas/filter/core/ArlasClaims.java | 2 +- .../io/arlas/filter/core/IdentityParam.java | 2 +- .../io/arlas/filter/core/PolicyEnforcer.java | 3 +- .../filter/impl/AbstractPolicyEnforcer.java | 20 +- .../filter/impl/Auth0PolicyEnforcer.java | 6 +- .../arlas/filter/impl/HTTPPolicyEnforcer.java | 20 +- .../filter/impl/KeycloakPolicyEnforcer.java | 6 +- .../arlas/filter/impl/NoPolicyEnforcer.java | 8 +- arlas-commons/src/main/java/module-info.java | 18 +- arlas-core/pom.xml | 18 +- .../CollectionUnavailableException.java | 3 +- .../ColumnUnavailableException.java | 2 +- .../ElasticsearchExceptionMapper.java | 5 +- .../services/ElasticExploreService.java | 2 +- .../model/CollectionReferenceParameters.java | 2 +- .../core/model/request/Aggregation.java | 4 +- .../server/core/model/request/Metric.java | 4 +- ...ollectionReferenceDescriptionProperty.java | 2 + .../core/services/ArlasRESTServices.java | 44 + .../server/core/services/ExploreService.java | 6 +- .../core/utils/ResponseCacheManager.java | 4 +- .../server/core/utils/UriInfoWrapper.java | 3 +- .../explore/AtomHitsMessageBodyWriter.java | 16 +- .../explore/OpenSearchDescriptorService.java | 44 +- .../opensearch/rest/explore/model/Image.java | 2 +- .../explore/model/OpenSearchDescription.java | 5 +- .../opensearch/rest/explore/model/Url.java | 2 +- .../collections/CollectionRESTServices.java | 13 +- .../rest/collections/CollectionService.java | 236 +- .../rest/explore/ExploreRESTServices.java | 22 +- .../aggregate/AggregateRESTService.java | 113 +- .../aggregate/GeoAggregateRESTService.java | 379 +- .../explore/compute/ComputeRESTService.java | 121 +- .../rest/explore/count/CountRESTService.java | 103 +- .../DescribeCollectionRESTService.java | 49 +- .../explore/describe/DescribeRESTService.java | 46 +- .../rest/explore/raw/RawRESTService.java | 61 +- .../explore/search/GeoSearchRESTService.java | 433 +- .../explore/search/SearchRESTService.java | 163 +- .../explore/suggest/SuggestRESTService.java | 70 +- .../rest/plugins/eo/TileRESTService.java | 120 +- arlas-server/pom.xml | 89 +- .../java/io/arlas/server/app/ArlasServer.java | 49 +- .../impl/ElasticDatabaseToolsFactory.java | 2 +- .../server/tests/auth/AuthServiceIT.java | 3 +- .../tests/rest/plugins/eo/TileServiceIT.java | 3 +- conf/configuration.yaml | 14 +- conf/doc/widdershins.json | 7 + conf/maven/pom.xml | 10 +- conf/npm/package-build.json | 7 +- conf/npm/package-doc.json | 2 +- conf/npm/package-publish.json | 4 +- conf/swagger/java-config.json | 5 +- docker-compose-network.yml | 6 - docs/api/definitions.md | 665 -- docs/api/overview.md | 35 - docs/api/paths.md | 1296 --- docs/api/reference.md | 6966 +++++++++++++++++ docs/api/security.md | 2 - mkDocs.sh | 9 +- ogc-common/pom.xml | 21 +- .../server/ogc/common/OGCRESTService.java | 3 +- .../INSPIRE/INSPIREExceptionCode.java | 3 +- .../common/exceptions/OGC/OGCException.java | 6 +- .../exceptions/OGC/OGCExceptionCode.java | 2 +- .../requestfilter/InsensitiveCaseFilter.java | 12 +- .../src/main/resources/csw/atom/common.xsd | 9 +- .../src/main/resources/csw/atom/gmlgeorss.xsd | 12 +- .../src/main/resources/csw/atom/network.xsd | 9 +- .../main/resources/csw/atom/opensearch.xsd | 2 +- ogc-common/src/main/resources/global.xjb | 16 +- .../arlas/server/ogc/csw/CSWRESTService.java | 184 +- .../GetCapabilitiesHandler.java | 12 +- .../getrecordbyid/GetRecordByIdResponse.java | 7 +- .../getrecords/GetRecordsHandler.java | 4 +- .../opensearch/OpenSearchHandler.java | 2 +- .../server/ogc/csw/utils/AtomBuilder.java | 4 +- .../server/ogc/csw/utils/RecordBuilder.java | 4 +- .../AtomGetRecordsMessageBodyWriter.java | 20 +- .../XmlGetRecordsMessageBodyWriter.java | 14 +- .../record/AtomRecordMessageBodyWriter.java | 10 +- .../XmlMDMetadataMessageBodyWriter.java | 16 +- .../record/XmlRecordMessageBodyBuilder.java | 15 +- .../arlas/server/ogc/wfs/WFSRESTService.java | 126 +- .../DescribeFeatureTypeHandler.java | 6 +- .../GetCapabilitiesHandler.java | 13 +- .../getfeature/GetFeatureHandler.java | 8 +- .../storedquery/ListStoredQueriesHandler.java | 2 +- .../utils/ExtendedWFSCapabilitiesType.java | 7 +- openapi/{swagger.json => openapi.json} | 5050 +++++++----- openapi/{swagger.yaml => openapi.yaml} | 5401 +++++++------ pom.xml | 81 +- release.sh | 35 +- stac-api/pom.xml | 6 +- .../stac/api/StacCollectionsRESTService.java | 159 +- .../stac/api/StacConformanceRESTService.java | 40 +- .../server/stac/api/StacCoreRESTService.java | 85 +- .../server/stac/api/StacRESTService.java | 63 +- .../stac/api/StacSearchRESTService.java | 118 +- .../io/arlas/server/stac/model/Catalog.java | 20 +- .../arlas/server/stac/model/Collection.java | 34 +- .../server/stac/model/CollectionList.java | 10 +- .../server/stac/model/ConformanceClasses.java | 9 +- .../io/arlas/server/stac/model/Extent.java | 10 +- .../server/stac/model/ExtentSpatial.java | 12 +- .../server/stac/model/ExtentTemporal.java | 12 +- .../java/io/arlas/server/stac/model/Item.java | 18 +- .../arlas/server/stac/model/LandingPage.java | 8 +- .../io/arlas/server/stac/model/Provider.java | 14 +- .../arlas/server/stac/model/SearchBody.java | 24 +- .../stac/model/StacFeatureCollection.java | 24 +- 132 files changed, 14714 insertions(+), 8655 deletions(-) create mode 100644 arlas-commons/src/main/java/io/arlas/commons/utils/MapAwareConverter.java create mode 100644 arlas-core/src/main/java/io/arlas/server/core/services/ArlasRESTServices.java create mode 100644 conf/doc/widdershins.json delete mode 100644 docker-compose-network.yml delete mode 100644 docs/api/definitions.md delete mode 100644 docs/api/overview.md delete mode 100644 docs/api/paths.md create mode 100644 docs/api/reference.md delete mode 100644 docs/api/security.md rename openapi/{swagger.json => openapi.json} (65%) rename openapi/{swagger.yaml => openapi.yaml} (59%) diff --git a/.github/workflows/.trivyignore b/.github/workflows/.trivyignore index 1e4bdc495..e69de29bb 100644 --- a/.github/workflows/.trivyignore +++ b/.github/workflows/.trivyignore @@ -1,2 +0,0 @@ -CVE-2023-6378 -CVE-2023-6481 \ No newline at end of file diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f284c866d..b8b378cef 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -70,18 +70,18 @@ jobs: DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} run: scripts/ci/tests-integration-stage.sh --stage=CSW_ALIASED - - name: Run tests [STAC] + - name: Run tests [STAC_ALIASED] env: # secrets are defined here : https://github.com/organizations/gisaia/settings/secrets/actions DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} - run: scripts/ci/tests-integration-stage.sh --stage=STAC - - name: Run tests [STAC_ALIASED] + run: scripts/ci/tests-integration-stage.sh --stage=STAC_ALIASED + - name: Run tests [STAC] env: # secrets are defined here : https://github.com/organizations/gisaia/settings/secrets/actions DOCKER_USERNAME: ${{ secrets.DOCKER_HUB_USER }} DOCKER_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} - run: scripts/ci/tests-integration-stage.sh --stage=STAC_ALIASED + run: scripts/ci/tests-integration-stage.sh --stage=STAC - name: Run tests [DOC] env: # secrets are defined here : https://github.com/organizations/gisaia/settings/secrets/actions diff --git a/arlas-commons/pom.xml b/arlas-commons/pom.xml index 1f4df2bac..f4dfa6455 100644 --- a/arlas-commons/pom.xml +++ b/arlas-commons/pom.xml @@ -22,82 +22,6 @@ com.smoketurner dropwizard-swagger ${dropwizard.swagger.version} - - - com.github.ben-manes.caffeine - caffeine - - - io.dropwizard - dropwizard-core - - - io.dropwizard - dropwizard-jackson - - - io.dropwizard - dropwizard-jersey - - - io.dropwizard - dropwizard-jetty - - - io.dropwizard - dropwizard-logging - - - io.dropwizard - dropwizard-servlets - - - io.dropwizard - dropwizard-util - - - io.dropwizard.metrics - metrics-core - - - jakarta.activation - jakarta.activation-api - - - com.fasterxml.jackson.core - jackson-annotations - - - org.apache.commons - commons-lang3 - - - org.glassfish.jersey.core - jersey-common - - - org.glassfish.jersey.core - jersey-server - - - org.glassfish.jersey.containers - jersey-container-servlet-core - - - com.google.guava - guava - - - org.slf4j - slf4j-api - - - - - - jakarta.activation - jakarta.activation-api - ${activation.version} @@ -106,6 +30,12 @@ ${hazelcast.version} + + com.fasterxml.jackson.jakarta.rs + jackson-jakarta-rs-base + ${jackson-version} + + com.auth0 java-jwt @@ -116,12 +46,6 @@ org.keycloak keycloak-authz-client ${keycloak.version} - - - com.sun.activation - jakarta.activation - - diff --git a/arlas-commons/src/main/java/io/arlas/commons/config/ArlasAuthConfiguration.java b/arlas-commons/src/main/java/io/arlas/commons/config/ArlasAuthConfiguration.java index ad8b6de8c..b924f261e 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/config/ArlasAuthConfiguration.java +++ b/arlas-commons/src/main/java/io/arlas/commons/config/ArlasAuthConfiguration.java @@ -22,9 +22,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.arlas.commons.exceptions.ArlasConfigurationException; import io.arlas.filter.config.InitConfiguration; +import jakarta.ws.rs.HttpMethod; import org.keycloak.representations.adapters.config.AdapterConfig; -import javax.ws.rs.HttpMethod; import java.util.*; import java.util.stream.Collectors; diff --git a/arlas-commons/src/main/java/io/arlas/commons/config/ArlasConfiguration.java b/arlas-commons/src/main/java/io/arlas/commons/config/ArlasConfiguration.java index b6ac5f5c7..043637023 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/config/ArlasConfiguration.java +++ b/arlas-commons/src/main/java/io/arlas/commons/config/ArlasConfiguration.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.arlas.commons.exceptions.ArlasConfigurationException; -import io.dropwizard.Configuration; +import io.dropwizard.core.Configuration; import io.federecio.dropwizard.swagger.SwaggerBundleConfiguration; public class ArlasConfiguration extends Configuration { diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasException.java index db2ec5831..1eb554bc5 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasException.java @@ -20,9 +20,8 @@ package io.arlas.commons.exceptions; import io.arlas.commons.rest.response.Error; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; public class ArlasException extends Exception { private static final long serialVersionUID = 1L; diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasExceptionMapper.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasExceptionMapper.java index 10415fef6..834b95052 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasExceptionMapper.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ArlasExceptionMapper.java @@ -19,12 +19,12 @@ package io.arlas.commons.exceptions; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; import java.util.Arrays; @Provider diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/BadRequestException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/BadRequestException.java index 8f19d2da4..9feaadc10 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/BadRequestException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/BadRequestException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class BadRequestException extends ArlasException { private static final long serialVersionUID = 1L; diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ConstraintViolationExceptionMapper.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ConstraintViolationExceptionMapper.java index 45ff68fb2..45a28f8e8 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ConstraintViolationExceptionMapper.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ConstraintViolationExceptionMapper.java @@ -19,12 +19,12 @@ package io.arlas.commons.exceptions; +import jakarta.validation.ConstraintViolationException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.validation.ConstraintViolationException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; import java.util.Arrays; public class ConstraintViolationExceptionMapper implements ExceptionMapper { diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/IllegalArgumentExceptionMapper.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/IllegalArgumentExceptionMapper.java index e4002be69..cc6a9cdcd 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/IllegalArgumentExceptionMapper.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/IllegalArgumentExceptionMapper.java @@ -19,11 +19,11 @@ package io.arlas.commons.exceptions; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; import java.util.Arrays; public class IllegalArgumentExceptionMapper implements ExceptionMapper { diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/InvalidParameterException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/InvalidParameterException.java index 566bfcf88..7ef0262ef 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/InvalidParameterException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/InvalidParameterException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class InvalidParameterException extends ArlasException { private static final long serialVersionUID = 1L; diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/JsonProcessingExceptionMapper.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/JsonProcessingExceptionMapper.java index 24c494beb..9b3dfd8cf 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/JsonProcessingExceptionMapper.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/JsonProcessingExceptionMapper.java @@ -20,11 +20,11 @@ package io.arlas.commons.exceptions; import com.fasterxml.jackson.core.JsonProcessingException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; import java.util.Arrays; public class JsonProcessingExceptionMapper implements ExceptionMapper { diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotAllowedException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotAllowedException.java index cc9d6c3e6..07003d8e6 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotAllowedException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotAllowedException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class NotAllowedException extends ArlasException { private static final long serialVersionUID = 1L; diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotFoundException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotFoundException.java index 90a953d46..eda738fa4 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotFoundException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotFoundException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class NotFoundException extends ArlasException { diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotImplementedException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotImplementedException.java index 098af2ce1..a5a73adce 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotImplementedException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/NotImplementedException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class NotImplementedException extends ArlasException { private static final long serialVersionUID = 1L; diff --git a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ParseException.java b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ParseException.java index c136650b9..adcd0675d 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/exceptions/ParseException.java +++ b/arlas-commons/src/main/java/io/arlas/commons/exceptions/ParseException.java @@ -19,7 +19,7 @@ package io.arlas.commons.exceptions; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class ParseException extends ArlasException { diff --git a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/InsensitiveCaseFilter.java b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/InsensitiveCaseFilter.java index d50244438..dc6541ef1 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/InsensitiveCaseFilter.java +++ b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/InsensitiveCaseFilter.java @@ -19,15 +19,14 @@ package io.arlas.commons.rest.utils; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.PreMatching; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.ext.Provider; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyPrintFilter.java b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyPrintFilter.java index f738c33c0..9c1e73f1e 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyPrintFilter.java +++ b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyPrintFilter.java @@ -19,16 +19,17 @@ package io.arlas.commons.rest.utils; -import com.fasterxml.jackson.jaxrs.cfg.ObjectWriterInjector; +import com.fasterxml.jackson.jakarta.rs.cfg.ObjectWriterInjector; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.core.MultivaluedMap; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.core.MultivaluedMap; import java.io.IOException; import java.util.List; import java.util.Map.Entry; -public class PrettyPrintFilter implements javax.ws.rs.container.ContainerResponseFilter { +public class PrettyPrintFilter implements ContainerResponseFilter { private static final String QUERY_PARAM_PRETTY = "pretty"; private static final String QUERY_PARAM_TRUE = "true"; diff --git a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyWriterModifier.java b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyWriterModifier.java index d9b248c8d..c7cf5dfa1 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyWriterModifier.java +++ b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/PrettyWriterModifier.java @@ -21,10 +21,10 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.jaxrs.cfg.EndpointConfigBase; -import com.fasterxml.jackson.jaxrs.cfg.ObjectWriterModifier; +import com.fasterxml.jackson.jakarta.rs.cfg.EndpointConfigBase; +import com.fasterxml.jackson.jakarta.rs.cfg.ObjectWriterModifier; +import jakarta.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.MultivaluedMap; import java.io.IOException; public class PrettyWriterModifier extends ObjectWriterModifier { diff --git a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/ResponseFormatter.java b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/ResponseFormatter.java index 94c86aef2..6c75bc1c4 100644 --- a/arlas-commons/src/main/java/io/arlas/commons/rest/utils/ResponseFormatter.java +++ b/arlas-commons/src/main/java/io/arlas/commons/rest/utils/ResponseFormatter.java @@ -21,9 +21,8 @@ import io.arlas.commons.rest.response.Success; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; public class ResponseFormatter { diff --git a/arlas-commons/src/main/java/io/arlas/commons/utils/MapAwareConverter.java b/arlas-commons/src/main/java/io/arlas/commons/utils/MapAwareConverter.java new file mode 100644 index 000000000..66b852c35 --- /dev/null +++ b/arlas-commons/src/main/java/io/arlas/commons/utils/MapAwareConverter.java @@ -0,0 +1,59 @@ +/* + * Licensed to Gisaïa under one or more contributor + * license agreements. See the NOTICE.txt file distributed with + * this work for additional information regarding copyright + * ownership. Gisaïa licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package io.arlas.commons.utils; + +import com.fasterxml.jackson.databind.JavaType; +import io.swagger.v3.core.converter.AnnotatedType; +import io.swagger.v3.core.converter.ModelConverter; +import io.swagger.v3.core.converter.ModelConverterContext; +import io.swagger.v3.core.util.Json; +import io.swagger.v3.oas.models.media.Schema; + +import java.util.HashMap; +import java.util.Iterator; + +@SuppressWarnings({"unchecked", "rawtypes"}) +public class MapAwareConverter implements ModelConverter { + + @Override + public Schema resolve(AnnotatedType type, ModelConverterContext context, Iterator chain) { + if (chain.hasNext()) { + Schema schema = chain.next().resolve(type, context, chain); + JavaType _type = Json.mapper().constructType(type.getType()); + if (_type != null) { + Class cls = _type.getRawClass(); + if (HashMap.class.isAssignableFrom(cls)) { + if (schema != null && schema.getProperties() != null) { + schema.getProperties().remove("empty"); + if (schema.getProperties().isEmpty()) { + schema.setProperties(null); + if (schema.getAdditionalProperties() != null) { + schema.setAdditionalProperties(null); + } + } + } + } + } + return schema; + } else { + return null; + } + } +} \ No newline at end of file diff --git a/arlas-commons/src/main/java/io/arlas/filter/core/ArlasClaims.java b/arlas-commons/src/main/java/io/arlas/filter/core/ArlasClaims.java index d63634379..4ab54a870 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/core/ArlasClaims.java +++ b/arlas-commons/src/main/java/io/arlas/filter/core/ArlasClaims.java @@ -20,10 +20,10 @@ package io.arlas.filter.core; import co.elastic.apm.api.Transaction; +import jakarta.ws.rs.core.MultivaluedMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.MultivaluedMap; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/arlas-commons/src/main/java/io/arlas/filter/core/IdentityParam.java b/arlas-commons/src/main/java/io/arlas/filter/core/IdentityParam.java index 19ffb0497..fa409afba 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/core/IdentityParam.java +++ b/arlas-commons/src/main/java/io/arlas/filter/core/IdentityParam.java @@ -21,8 +21,8 @@ import io.arlas.commons.config.ArlasAuthConfiguration; import io.arlas.filter.config.TechnicalRoles; +import jakarta.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.HttpHeaders; import java.util.Arrays; import java.util.List; import java.util.Optional; diff --git a/arlas-commons/src/main/java/io/arlas/filter/core/PolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/core/PolicyEnforcer.java index 5d630e5db..62f19f0da 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/core/PolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/core/PolicyEnforcer.java @@ -21,10 +21,9 @@ import io.arlas.commons.cache.BaseCacheManager; import io.arlas.commons.config.ArlasAuthConfiguration; +import jakarta.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.ContainerRequestFilter; import java.util.ServiceLoader; -import java.util.stream.Collectors; public interface PolicyEnforcer extends ContainerRequestFilter { diff --git a/arlas-commons/src/main/java/io/arlas/filter/impl/AbstractPolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/impl/AbstractPolicyEnforcer.java index 1e0d043f7..74580c409 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/impl/AbstractPolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/impl/AbstractPolicyEnforcer.java @@ -29,18 +29,18 @@ import io.arlas.filter.config.TechnicalRoles; import io.arlas.filter.core.ArlasClaims; import io.arlas.filter.core.PolicyEnforcer; +import jakarta.annotation.Priority; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.MDC; -import javax.annotation.Priority; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Priorities; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; import java.io.IOException; import java.util.*; import java.util.function.Consumer; @@ -48,8 +48,8 @@ import static io.arlas.commons.rest.utils.ServerConstants.*; import static io.arlas.filter.config.TechnicalRoles.VAR_ORG; -import static javax.ws.rs.core.Response.Status.FORBIDDEN; -import static javax.ws.rs.core.Response.Status.UNAUTHORIZED; +import static jakarta.ws.rs.core.Response.Status.FORBIDDEN; +import static jakarta.ws.rs.core.Response.Status.UNAUTHORIZED; @Provider @Priority(Priorities.AUTHORIZATION) diff --git a/arlas-commons/src/main/java/io/arlas/filter/impl/Auth0PolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/impl/Auth0PolicyEnforcer.java index 550b172d1..ff3a8aa52 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/impl/Auth0PolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/impl/Auth0PolicyEnforcer.java @@ -25,12 +25,12 @@ import io.arlas.commons.config.ArlasAuthConfiguration; import io.arlas.commons.utils.StringUtil; import io.arlas.filter.core.PolicyEnforcer; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.ext.Provider; import java.io.FileInputStream; import java.io.InputStream; import java.net.URL; diff --git a/arlas-commons/src/main/java/io/arlas/filter/impl/HTTPPolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/impl/HTTPPolicyEnforcer.java index 26fcd2f23..ae6edeff5 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/impl/HTTPPolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/impl/HTTPPolicyEnforcer.java @@ -25,19 +25,19 @@ import io.arlas.commons.config.ArlasAuthConfiguration; import io.arlas.commons.exceptions.ArlasException; import io.arlas.filter.core.PolicyEnforcer; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.Provider; import java.util.Collections; import java.util.Map; import java.util.Optional; diff --git a/arlas-commons/src/main/java/io/arlas/filter/impl/KeycloakPolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/impl/KeycloakPolicyEnforcer.java index ef33a721a..87d20917e 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/impl/KeycloakPolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/impl/KeycloakPolicyEnforcer.java @@ -21,6 +21,9 @@ import io.arlas.commons.config.ArlasAuthConfiguration; import io.arlas.filter.core.PolicyEnforcer; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.ext.Provider; import org.keycloak.TokenVerifier; import org.keycloak.authorization.client.AuthzClient; import org.keycloak.authorization.client.Configuration; @@ -30,9 +33,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.ext.Provider; import java.util.*; @Provider diff --git a/arlas-commons/src/main/java/io/arlas/filter/impl/NoPolicyEnforcer.java b/arlas-commons/src/main/java/io/arlas/filter/impl/NoPolicyEnforcer.java index b0085aff7..512444c89 100644 --- a/arlas-commons/src/main/java/io/arlas/filter/impl/NoPolicyEnforcer.java +++ b/arlas-commons/src/main/java/io/arlas/filter/impl/NoPolicyEnforcer.java @@ -21,11 +21,11 @@ import io.arlas.commons.cache.BaseCacheManager; import io.arlas.commons.config.ArlasAuthConfiguration; import io.arlas.filter.core.PolicyEnforcer; +import jakarta.annotation.Priority; +import jakarta.ws.rs.Priorities; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.ext.Provider; -import javax.annotation.Priority; -import javax.ws.rs.Priorities; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.ext.Provider; import java.io.IOException; @Provider diff --git a/arlas-commons/src/main/java/module-info.java b/arlas-commons/src/main/java/module-info.java index 16eaa5b70..7592c27f4 100644 --- a/arlas-commons/src/main/java/module-info.java +++ b/arlas-commons/src/main/java/module-info.java @@ -40,19 +40,21 @@ requires co.elastic.apm.api; requires com.auth0.jwt; requires com.fasterxml.jackson.annotation; + requires com.fasterxml.jackson.core; requires com.fasterxml.jackson.databind; requires com.fasterxml.jackson.dataformat.yaml; - requires com.fasterxml.jackson.core; - requires com.fasterxml.jackson.jaxrs.base; + requires com.fasterxml.jackson.jakarta.rs.base; requires com.hazelcast.core; - requires dropwizard.core; - requires dropwizard.jackson; + requires io.dropwizard.core; + requires io.dropwizard.jackson; + requires io.swagger.v3.core; + requires io.swagger.v3.oas.models; requires dropwizard.swagger; - requires java.annotation; - requires java.validation; - requires java.ws.rs; + requires jakarta.annotation; + requires jakarta.servlet; + requires jakarta.ws.rs; + requires jakarta.validation; requires keycloak.authz.client; requires keycloak.core; requires org.slf4j; - requires java.servlet; } \ No newline at end of file diff --git a/arlas-core/pom.xml b/arlas-core/pom.xml index ed5312b18..6490f3f30 100644 --- a/arlas-core/pom.xml +++ b/arlas-core/pom.xml @@ -40,6 +40,11 @@ cyclops ${cyclops.version} + + joda-time + joda-time + 2.12.5 + @@ -67,16 +72,6 @@ co.elastic.clients elasticsearch-java ${elastic.version} - - - jackson-core - com.fasterxml.jackson.core - - - snakeyaml - org.yaml - - @@ -116,16 +111,19 @@ gt-shapefile ${geotools.version} + org.geotools.xsd gt-xsd-fes ${geotools.version} + com.google.protobuf protobuf-java ${protobuf.version} + de.grundid.opendatalab geojson-jackson diff --git a/arlas-core/src/main/java/io/arlas/server/core/exceptions/CollectionUnavailableException.java b/arlas-core/src/main/java/io/arlas/server/core/exceptions/CollectionUnavailableException.java index 68238f840..91b61f14d 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/exceptions/CollectionUnavailableException.java +++ b/arlas-core/src/main/java/io/arlas/server/core/exceptions/CollectionUnavailableException.java @@ -21,8 +21,7 @@ import io.arlas.commons.exceptions.ArlasException; import io.arlas.server.core.model.CollectionReference; - -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; public class CollectionUnavailableException extends ArlasException { diff --git a/arlas-core/src/main/java/io/arlas/server/core/exceptions/ColumnUnavailableException.java b/arlas-core/src/main/java/io/arlas/server/core/exceptions/ColumnUnavailableException.java index d15ef30fa..952ca833b 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/exceptions/ColumnUnavailableException.java +++ b/arlas-core/src/main/java/io/arlas/server/core/exceptions/ColumnUnavailableException.java @@ -20,8 +20,8 @@ package io.arlas.server.core.exceptions; import io.arlas.commons.exceptions.ArlasException; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.core.Response; import java.util.Set; /** diff --git a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/exceptions/ElasticsearchExceptionMapper.java b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/exceptions/ElasticsearchExceptionMapper.java index ec806be42..ba625759e 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/exceptions/ElasticsearchExceptionMapper.java +++ b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/exceptions/ElasticsearchExceptionMapper.java @@ -22,12 +22,11 @@ import co.elastic.clients.elasticsearch._types.ElasticsearchException; import io.arlas.commons.exceptions.ArlasException; import io.arlas.commons.exceptions.ArlasExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; - public class ElasticsearchExceptionMapper implements ExceptionMapper { Logger logger = LoggerFactory.getLogger(ArlasExceptionMapper.class); diff --git a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticExploreService.java b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticExploreService.java index 2e42560ba..a8a7bd81b 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticExploreService.java +++ b/arlas-core/src/main/java/io/arlas/server/core/impl/elastic/services/ElasticExploreService.java @@ -54,7 +54,7 @@ import org.locationtech.spatial4j.io.GeohashUtils; import org.locationtech.spatial4j.shape.Rectangle; -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.core.UriInfo; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; diff --git a/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReferenceParameters.java b/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReferenceParameters.java index 1ce22231b..d712b7dbf 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReferenceParameters.java +++ b/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReferenceParameters.java @@ -26,7 +26,7 @@ import io.arlas.server.core.model.enumerations.GeoTypeEnum; import io.arlas.server.core.model.request.Filter; -import javax.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.List; import java.util.Map; diff --git a/arlas-core/src/main/java/io/arlas/server/core/model/request/Aggregation.java b/arlas-core/src/main/java/io/arlas/server/core/model/request/Aggregation.java index c3f5c0dcd..b0fa6af02 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/model/request/Aggregation.java +++ b/arlas-core/src/main/java/io/arlas/server/core/model/request/Aggregation.java @@ -20,7 +20,7 @@ package io.arlas.server.core.model.request; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import io.arlas.server.core.model.enumerations.AggregatedGeometryEnum; import io.arlas.server.core.model.enumerations.AggregationTypeEnum; @@ -29,7 +29,7 @@ import java.util.List; -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class Aggregation { public AggregationTypeEnum type; public String field; diff --git a/arlas-core/src/main/java/io/arlas/server/core/model/request/Metric.java b/arlas-core/src/main/java/io/arlas/server/core/model/request/Metric.java index 4a8597d10..bafc08d07 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/model/request/Metric.java +++ b/arlas-core/src/main/java/io/arlas/server/core/model/request/Metric.java @@ -20,11 +20,11 @@ package io.arlas.server.core.model.request; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.databind.PropertyNamingStrategy; +import com.fasterxml.jackson.databind.PropertyNamingStrategies; import com.fasterxml.jackson.databind.annotation.JsonNaming; import io.arlas.server.core.model.enumerations.CollectionFunction; -@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class) +@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class) public class Metric { public String collectField; public CollectionFunction collectFct; diff --git a/arlas-core/src/main/java/io/arlas/server/core/model/response/CollectionReferenceDescriptionProperty.java b/arlas-core/src/main/java/io/arlas/server/core/model/response/CollectionReferenceDescriptionProperty.java index 1e866df55..94263da9e 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/model/response/CollectionReferenceDescriptionProperty.java +++ b/arlas-core/src/main/java/io/arlas/server/core/model/response/CollectionReferenceDescriptionProperty.java @@ -20,6 +20,7 @@ package io.arlas.server.core.model.response; +import com.fasterxml.jackson.annotation.JsonManagedReference; import io.dropwizard.jackson.JsonSnakeCase; import java.util.Map; @@ -30,6 +31,7 @@ public class CollectionReferenceDescriptionProperty { public FieldType type; public String format; public String hashField; + @JsonManagedReference public Map properties; public boolean taggable=false; public boolean indexed=true; diff --git a/arlas-core/src/main/java/io/arlas/server/core/services/ArlasRESTServices.java b/arlas-core/src/main/java/io/arlas/server/core/services/ArlasRESTServices.java new file mode 100644 index 000000000..d06e1d065 --- /dev/null +++ b/arlas-core/src/main/java/io/arlas/server/core/services/ArlasRESTServices.java @@ -0,0 +1,44 @@ +/* + * Licensed to Gisaïa under one or more contributor + * license agreements. See the NOTICE.txt file distributed with + * this work for additional information regarding copyright + * ownership. Gisaïa licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package io.arlas.server.core.services; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.info.Contact; +import io.swagger.v3.oas.annotations.info.Info; +import io.swagger.v3.oas.annotations.info.License; +import io.swagger.v3.oas.annotations.servers.Server; + +@OpenAPIDefinition( + info = @Info( + title = "ARLAS Server APIs", + description = "Explore the content of ARLAS collections", + license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"), + contact = @Contact(email = "contact@gisaia.com", name = "Gisaia", url = "http://www.gisaia.com/"), + version = "API_VERSION"), + externalDocs = @ExternalDocumentation( + description = "API documentation", + url="https://docs.arlas.io/arlas-api/"), + servers = { + @Server(url = "/arlas", description = "default server") + } +) +public abstract class ArlasRESTServices { +} diff --git a/arlas-core/src/main/java/io/arlas/server/core/services/ExploreService.java b/arlas-core/src/main/java/io/arlas/server/core/services/ExploreService.java index bda8f6e40..10fb2a137 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/services/ExploreService.java +++ b/arlas-core/src/main/java/io/arlas/server/core/services/ExploreService.java @@ -19,10 +19,10 @@ package io.arlas.server.core.services; import co.elastic.clients.json.JsonData; -import io.arlas.commons.utils.StringUtil; -import io.arlas.server.core.app.ArlasServerConfiguration; import io.arlas.commons.exceptions.ArlasException; import io.arlas.commons.exceptions.BadRequestException; +import io.arlas.commons.utils.StringUtil; +import io.arlas.server.core.app.ArlasServerConfiguration; import io.arlas.server.core.exceptions.CollectionUnavailableException; import io.arlas.server.core.model.CollectionReference; import io.arlas.server.core.model.enumerations.ComputationEnum; @@ -30,6 +30,7 @@ import io.arlas.server.core.model.request.*; import io.arlas.server.core.model.response.*; import io.arlas.server.core.utils.*; +import jakarta.ws.rs.core.UriInfo; import org.apache.commons.lang3.tuple.Pair; import org.geojson.*; import org.locationtech.spatial4j.context.SpatialContext; @@ -38,7 +39,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.core.UriInfo; import java.util.*; import java.util.function.Function; import java.util.function.Predicate; diff --git a/arlas-core/src/main/java/io/arlas/server/core/utils/ResponseCacheManager.java b/arlas-core/src/main/java/io/arlas/server/core/utils/ResponseCacheManager.java index 84118c6c2..b537750b7 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/utils/ResponseCacheManager.java +++ b/arlas-core/src/main/java/io/arlas/server/core/utils/ResponseCacheManager.java @@ -19,8 +19,8 @@ package io.arlas.server.core.utils; -import javax.ws.rs.core.CacheControl; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.CacheControl; +import jakarta.ws.rs.core.Response; public class ResponseCacheManager { diff --git a/arlas-core/src/main/java/io/arlas/server/core/utils/UriInfoWrapper.java b/arlas-core/src/main/java/io/arlas/server/core/utils/UriInfoWrapper.java index 0ebad49b5..3ac72feba 100644 --- a/arlas-core/src/main/java/io/arlas/server/core/utils/UriInfoWrapper.java +++ b/arlas-core/src/main/java/io/arlas/server/core/utils/UriInfoWrapper.java @@ -20,8 +20,7 @@ package io.arlas.server.core.utils; import io.arlas.commons.utils.StringUtil; - -import javax.ws.rs.core.UriInfo; +import jakarta.ws.rs.core.UriInfo; public class UriInfoWrapper { private UriInfo uriInfo; diff --git a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/AtomHitsMessageBodyWriter.java b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/AtomHitsMessageBodyWriter.java index b9e58dfa9..c3e204bb3 100644 --- a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/AtomHitsMessageBodyWriter.java +++ b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/AtomHitsMessageBodyWriter.java @@ -20,6 +20,7 @@ package io.arlas.server.opensearch.rest.explore; import io.arlas.commons.exceptions.ArlasException; +import io.arlas.commons.utils.StringUtil; import io.arlas.server.core.model.CollectionReference; import io.arlas.server.core.model.Feed; import io.arlas.server.core.model.response.*; @@ -27,17 +28,16 @@ import io.arlas.server.core.ns.GEORSS; import io.arlas.server.core.ns.GML; import io.arlas.server.core.ns.OPENSEARCH; -import io.arlas.server.ogc.common.utils.GeoFormat; import io.arlas.server.core.services.ExploreService; import io.arlas.server.core.utils.MapExplorer; -import io.arlas.commons.utils.StringUtil; +import io.arlas.server.ogc.common.utils.GeoFormat; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; diff --git a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/OpenSearchDescriptorService.java b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/OpenSearchDescriptorService.java index f172ba0ce..b0dfcb6dc 100644 --- a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/OpenSearchDescriptorService.java +++ b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/OpenSearchDescriptorService.java @@ -35,15 +35,17 @@ import io.arlas.server.opensearch.rest.explore.model.OpenSearchDescription; import io.arlas.server.opensearch.rest.explore.model.Url; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; + import java.io.IOException; import java.util.*; @@ -62,32 +64,40 @@ public OpenSearchDescriptorService(ExploreService exploreService) { @Path("/ogc/opensearch/{collection}") @GET @Produces({MIME_TYPE_XML}) - @ApiOperation(value = "OpenSearch Description Document", produces = MIME_TYPE_XML, notes = Documentation.OPENSEARCH_OPERATION) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "OpenSearch Description Document", + description = Documentation.OPENSEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response opensearch(@Context UriInfo uri, // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FILTERS- ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws IOException, NotFoundException, ArlasException { CollectionReference cr = exploreService.getCollectionReferenceService() diff --git a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Image.java b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Image.java index abc0d14eb..9128d7b5e 100644 --- a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Image.java +++ b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Image.java @@ -19,7 +19,7 @@ package io.arlas.server.opensearch.rest.explore.model; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAttribute; public class Image { @XmlAttribute(name = "height") diff --git a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/OpenSearchDescription.java b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/OpenSearchDescription.java index 07a4ceab4..eee008ed8 100644 --- a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/OpenSearchDescription.java +++ b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/OpenSearchDescription.java @@ -19,8 +19,9 @@ package io.arlas.server.opensearch.rest.explore.model; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; + import java.util.ArrayList; import java.util.List; diff --git a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Url.java b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Url.java index 8cebc01fa..622520247 100644 --- a/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Url.java +++ b/arlas-opensearch/src/main/java/io/arlas/server/opensearch/rest/explore/model/Url.java @@ -19,7 +19,7 @@ package io.arlas.server.opensearch.rest.explore.model; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAttribute; public class Url { diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionRESTServices.java b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionRESTServices.java index 67950f28c..485f23caa 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionRESTServices.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionRESTServices.java @@ -19,17 +19,16 @@ package io.arlas.server.rest.collections; -import io.swagger.annotations.Api; +import io.arlas.server.core.services.ArlasRESTServices; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.MediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; - @Path("/collections") -@Api(value = "/collections") - -public abstract class CollectionRESTServices { +@Tag(name="collections", description="Collections API") +public abstract class CollectionRESTServices extends ArlasRESTServices { public Logger LOGGER = LoggerFactory.getLogger(CollectionRESTServices.class); public static final String UTF8JSON = MediaType.APPLICATION_JSON + ";charset=utf-8"; } diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java index e19316e0e..598c9151a 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java @@ -34,20 +34,23 @@ import io.arlas.server.core.services.CollectionReferenceService; import io.arlas.server.core.utils.CheckParams; import io.arlas.server.core.utils.ColumnFilterUtil; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.FormDataParam; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.time.LocalDate; @@ -74,27 +77,29 @@ public CollectionService(ArlasServerConfiguration configuration, CollectionRefer @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Get all collection references", - produces = UTF8JSON, - notes = "Get all collection references in ARLAS", - consumes = UTF8JSON + @Operation( + summary = "Get all collection references", + description = "Get all collection references in ARLAS" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReference.class, responseContainer = "List"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = CollectionReference.class)))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getAll( - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty ) throws ArlasException { List collections = collectionReferenceService @@ -107,20 +112,22 @@ public Response getAll( @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Get all collection references as a json file", - produces = UTF8JSON, - notes = "Get all collection references in ARLAS as json file", - consumes = UTF8JSON + @Operation( + summary = "Get all collection references as a json file", + description = "Get all collection references in ARLAS as json file" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReference.class, responseContainer = "List"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = CollectionReference.class)))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response exportCollections( - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { List collections = collectionReferenceService @@ -136,19 +143,21 @@ public Response exportCollections( @POST @Produces(UTF8JSON) @Consumes(MediaType.MULTIPART_FORM_DATA) - @ApiOperation( - value = "Add collection references from a json file", - produces = UTF8JSON, - notes = "Add collection references in ARLAS from a json file", - consumes = MediaType.MULTIPART_FORM_DATA + @Operation( + summary = "Add collection references from a json file", + description = "Add collection references in ARLAS from a json file" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = String.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response importCollections( - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, @FormDataParam("file") InputStream inputStream, @@ -191,36 +200,37 @@ private static List getCollectionsFromInputStream(InputStre @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Get a collection reference", - produces = UTF8JSON, - notes = "Get a collection reference in ARLAS", - consumes = UTF8JSON, - response = CollectionReference.class - + @Operation( + summary = "Get a collection reference", + description = "Get a collection reference in ARLAS" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReference.class), - @ApiResponse(code = 404, message = "Collection not found.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = CollectionReference.class))), + @ApiResponse(responseCode = "404", description = "Collection not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response get( - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty ) throws ArlasException { CollectionReference cr = collectionReferenceService.getCollectionReference(collection, Optional.ofNullable(organisations)); @@ -233,40 +243,42 @@ public Response get( @PUT @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Add a collection reference", - produces = UTF8JSON, - notes = "Add a collection reference in ARLAS", - consumes = UTF8JSON, - response = CollectionReference.class + @Operation( + summary = "Add a collection reference", + description = "Add a collection reference in ARLAS" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReference.class), - @ApiResponse(code = 400, message = "JSON parameter malformed.", response = Error.class), - @ApiResponse(code = 404, message = "Not Found Error.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = CollectionReference.class))), + @ApiResponse(responseCode = "400", description = "JSON parameter malformed.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "404", description = "Not Found Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response put( - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - - @ApiParam(name = "collectionParams", - value = "collectionParams", + @Parameter(name = "collectionParams", + description = "collectionParams", required = true) @NotNull @Valid CollectionReferenceParameters collectionReferenceParameters, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "checkfields", defaultValue = "true") + @Parameter(name = "checkfields", schema = @Schema(defaultValue = "true")) @QueryParam(value = "checkfields") Boolean checkFields ) throws ArlasException { @@ -282,40 +294,43 @@ public Response put( @PATCH @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Update a collection reference's organisations attribute.", - produces = UTF8JSON, - notes = "Update a collection reference's organisations attribute.", - consumes = UTF8JSON, - response = CollectionReference.class + @Operation( + summary = "Update a collection reference's organisations attribute.", + description = "Update a collection reference's organisations attribute." ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReference.class), - @ApiResponse(code = 400, message = "JSON parameter malformed.", response = Error.class), - @ApiResponse(code = 404, message = "Not Found Error.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = CollectionReference.class))), + @ApiResponse(responseCode = "400", description = "JSON parameter malformed.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "404", description = "Collection not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response patch( @Context HttpHeaders headers, - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "collectionParamsUpdate", - value = "collectionParamsUpdate", + @Parameter(name = "collectionParamsUpdate", + description = "collectionParamsUpdate", required = true) @NotNull CollectionReferenceUpdate cru, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty ) throws ArlasException { @@ -343,28 +358,31 @@ public CollectionReference save(String collection, CollectionReferenceParameters @DELETE @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation( - value = "Delete a collection reference", - produces = UTF8JSON, - notes = "Delete a collection reference in ARLAS", - consumes = UTF8JSON + @Operation( + summary = "Delete a collection reference", + description = "Delete a collection reference in ARLAS" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = Success.class), - @ApiResponse(code = 404, message = "Collection not found.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Success.class))), + @ApiResponse(responseCode = "404", description = "Collection not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response delete( - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty ) throws ArlasException { if (collection != null && collection.equals(META_COLLECTION_NAME)) { diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/ExploreRESTServices.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/ExploreRESTServices.java index 696c42173..511a2d100 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/ExploreRESTServices.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/ExploreRESTServices.java @@ -21,9 +21,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.arlas.commons.exceptions.ArlasException; +import io.arlas.server.core.services.ArlasRESTServices; import io.arlas.server.core.services.ExploreService; import io.arlas.server.core.utils.IOUtils; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.apache.commons.io.FileUtils; import org.geojson.FeatureCollection; import org.geotools.data.collection.ListFeatureCollection; @@ -44,9 +48,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import java.io.*; import java.nio.file.Files; import java.nio.file.Paths; @@ -57,16 +58,9 @@ import java.util.zip.ZipOutputStream; @Path("/explore") -@Api(value = "/explore") -@SwaggerDefinition( - info = @Info(contact = @Contact(email = "contact@gisaia.com", name = "Gisaia", url = "http://www.gisaia.com/"), - title = "ARLAS Exploration API", - description = "Explore the content of ARLAS collections", - license = @License(name = "Apache 2.0", url = "https://www.apache.org/licenses/LICENSE-2.0.html"), - version = "23.0.1"), - schemes = { SwaggerDefinition.Scheme.HTTP, SwaggerDefinition.Scheme.HTTPS }) - -public abstract class ExploreRESTServices { +@Tag(name="explore", description="Explore API") + +public abstract class ExploreRESTServices extends ArlasRESTServices { protected static final Logger LOGGER = LoggerFactory.getLogger(ExploreRESTServices.class); public static final String UTF8JSON = MediaType.APPLICATION_JSON + ";charset=utf-8"; diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/AggregateRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/AggregateRESTService.java index 9a01fb313..18df4b7e9 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/AggregateRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/AggregateRESTService.java @@ -33,13 +33,18 @@ import io.arlas.server.core.utils.MapExplorer; import io.arlas.server.core.utils.ParamsParser; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.HashMap; import java.util.List; import java.util.Optional; @@ -58,74 +63,84 @@ public AggregateRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Aggregate", produces = UTF8JSON, notes = Documentation.AGGREGATION_OPERATION, consumes = UTF8JSON, response = AggregationResponse.class - + @Operation( + summary = "Aggregate", + description = Documentation.AGGREGATION_OPERATION ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = AggregationResponse.class, responseContainer = "ArlasAggregation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = AggregationResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response aggregate( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- AGGREGATION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "agg", - value = Documentation.AGGREGATION_PARAM_AGG, + @Parameter(name = "agg", + description = Documentation.AGGREGATION_PARAM_AGG, required = true) @QueryParam(value = "agg") List agg, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", value = Documentation.FORM_FLAT, - defaultValue = "false") + + @Parameter(name = "flat", description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws ArlasException { long startArlasTime = System.nanoTime(); @@ -158,17 +173,25 @@ public Response aggregate( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Aggregate", produces = UTF8JSON, notes = Documentation.AGGREGATION_OPERATION, consumes = UTF8JSON, response = AggregationResponse.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = AggregationResponse.class, responseContainer = "ArlasAggregation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Aggregate", + description = Documentation.AGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = AggregationResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response aggregatePost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -180,27 +203,27 @@ public Response aggregatePost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { long startArlasTime = System.nanoTime(); @@ -241,7 +264,7 @@ public AggregationResponse getArlasAggregation(MixedRequest request, CollectionR private AggregationResponse flatten(AggregationResponse aggregationResponse) { List elements = aggregationResponse.elements; - if (elements != null && elements.size() > 0) { + if (elements != null && !elements.isEmpty()) { for (AggregationResponse element : elements) { element.flattenedElements = new HashMap<>(); element.flattenedElements.putAll(exploreService.flat( diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/GeoAggregateRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/GeoAggregateRESTService.java index 60f443c55..72e6b3d16 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/GeoAggregateRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/aggregate/GeoAggregateRESTService.java @@ -34,18 +34,22 @@ import io.arlas.server.core.services.ExploreService; import io.arlas.server.core.utils.*; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.FileUtils; import org.geojson.Feature; import org.geojson.FeatureCollection; import org.geojson.GeoJsonObject; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.util.*; @@ -72,74 +76,86 @@ public GeoAggregateRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoAggregate", produces = UTF8JSON, notes = Documentation.GEOAGGREGATION_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "GeoAggregate", + description = Documentation.GEOAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geoaggregate( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- AGGREGATION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "agg", - value = Documentation.GEOAGGREGATION_PARAM_AGG, + @Parameter(name = "agg", + description = Documentation.GEOAGGREGATION_PARAM_AGG, required = true) @QueryParam(value = "agg") List agg, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", - value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", + description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -159,71 +175,82 @@ public Response geoaggregate( @GET @Produces(ZIPFILE) @Consumes(UTF8JSON) - @ApiOperation(value = "ShapeAggregate", produces = ZIPFILE, notes = Documentation.SHAPEAGGREGATION_OPERATION, consumes = UTF8JSON) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "ShapeAggregate", + description = Documentation.SHAPEAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response shapeaggregate( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- AGGREGATION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "agg", - value = Documentation.GEOAGGREGATION_PARAM_AGG, + @Parameter(name = "agg", + description = Documentation.GEOAGGREGATION_PARAM_AGG, required = true) @QueryParam(value = "agg") List agg, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", - value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", + description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - value = Documentation.FILTER_RIGHT_HAND, - defaultValue = "true") + @Parameter(name = "righthand", + description = Documentation.FILTER_RIGHT_HAND, + schema = @Schema(defaultValue = "true")) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -243,78 +270,90 @@ public Response shapeaggregate( @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoAggregate on a geohash", produces = UTF8JSON, notes = Documentation.GEOHASH_GEOAGGREGATION_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "GeoAggregate on a geohash", + description = Documentation.GEOHASH_GEOAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geohashgeoaggregate( // -------------------------------------------------------- // ----------------------- PATH --------------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "geohash", - value = "geohash", + @Parameter(name = "geohash", + description = "geohash", required = true) @PathParam(value = "geohash") String geohash, // -------------------------------------------------------- // ----------------------- AGGREGATION -------------------- // -------------------------------------------------------- - @ApiParam(name = "agg", - value = Documentation.GEOAGGREGATION_PARAM_AGG) + @Parameter(name = "agg", + description = Documentation.GEOAGGREGATION_PARAM_AGG) @QueryParam(value = "agg") List agg, // -------------------------------------------------------- // ----------------------- FILTER ------------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM --------------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- EXTRA -------------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -326,7 +365,7 @@ public Response geohashgeoaggregate( if (geohash.startsWith("#")) { geohash = geohash.substring(1); } - if (agg == null || agg.size() == 0) { + if (agg == null || agg.isEmpty()) { agg = Collections.singletonList("geohash:" + collectionReference.params.centroidPath + ":interval-" + geohash.length()); } @@ -368,86 +407,98 @@ public Response geohashgeoaggregate( @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoAggregate on a geotile", produces = UTF8JSON, notes = Documentation.GEOTILE_GEOAGGREGATION_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "GeoAggregate on a geotile", + description = Documentation.GEOTILE_GEOAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geotilegeoaggregate( // -------------------------------------------------------- // ----------------------- PATH --------------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "z", - value = "z", + @Parameter(name = "z", + description = "z", required = true) @PathParam(value = "z") Integer z, - @ApiParam(name = "x", - value = "x", + @Parameter(name = "x", + description = "x", required = true) @PathParam(value = "x") Integer x, - @ApiParam(name = "y", - value = "y", + @Parameter(name = "y", + description = "y", required = true) @PathParam(value = "y") Integer y, // -------------------------------------------------------- // ----------------------- AGGREGATION -------------------- // -------------------------------------------------------- - @ApiParam(name = "agg", - value = Documentation.GEOAGGREGATION_PARAM_AGG) + @Parameter(name = "agg", + description = Documentation.GEOAGGREGATION_PARAM_AGG) @QueryParam(value = "agg") List agg, // -------------------------------------------------------- // ----------------------- FILTER ------------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM --------------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- EXTRA -------------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -456,7 +507,7 @@ public Response geotilegeoaggregate( throw new NotFoundException(collection); } - if (agg == null || agg.size() == 0) { + if (agg == null || agg.isEmpty()) { agg = Collections.singletonList("geotile:" + collectionReference.params.centroidPath + ":interval-" + (z+3)); } @@ -500,7 +551,7 @@ private List getBoundingBoxes(String geohash, List agg, Col .filter(a -> a.type.equals(AggregationTypeEnum.geohash)) .map(a -> a.interval) .toList(); - if (intervals.size() > 0) { + if (!intervals.isEmpty()) { interval = intervals.get(0).value.intValue(); } BoundingBox bbox = GeoTileUtil.getBoundingBox(geohash); @@ -527,7 +578,7 @@ private List getBoundingBoxes(Integer z, Integer x, Integer y, List .filter(a -> a.type.equals(AggregationTypeEnum.geotile)) .map(a -> a.interval) .toList(); - if (intervals.size() > 0) { + if (!intervals.isEmpty()) { interval = intervals.get(0).value.intValue(); if (interval - z > 7 || interval - z < 0) { throw new InvalidParameterException("(interval - z) must be > 0 and <= 7"); @@ -571,17 +622,26 @@ private AggregationResponse merge(List aggResponses) { @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoAggregate", produces = UTF8JSON, notes = Documentation.GEOAGGREGATION_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "GeoAggregate", + description = Documentation.GEOAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geoaggregatePost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -593,27 +653,27 @@ public Response geoaggregatePost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -645,16 +705,25 @@ public Response geoaggregatePost( @POST @Produces(ZIPFILE) @Consumes(UTF8JSON) - @ApiOperation(value = "ShapeAggregate", produces = ZIPFILE, notes = Documentation.SHAPEAGGREGATION_OPERATION, consumes = UTF8JSON) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 501, message = "Not implemented functionality.", response = Error.class)}) + @Operation( + summary = "ShapeAggregate", + description = Documentation.SHAPEAGGREGATION_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "501", description = "Not implemented functionality.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response shapeaggregatePost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -666,27 +735,27 @@ public Response shapeaggregatePost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/compute/ComputeRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/compute/ComputeRESTService.java index 9faf2d1b5..b1895d900 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/compute/ComputeRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/compute/ComputeRESTService.java @@ -32,13 +32,18 @@ import io.arlas.server.core.utils.ColumnFilterUtil; import io.arlas.server.core.utils.ParamsParser; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.List; import java.util.Optional; @@ -55,79 +60,88 @@ public ComputeRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Compute", produces = UTF8JSON, notes = Documentation.COMPUTE_OPERATION, consumes = UTF8JSON, response = ComputationResponse.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = ComputationResponse.class, responseContainer = "ArlasComputation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Compute", + description = Documentation.COMPUTE_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = ComputationResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response compute( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- COMPUTE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "field", - value = Documentation.COMPUTE_FIELD, + @Parameter(name = "field", + description = Documentation.COMPUTE_FIELD, required = true) @QueryParam(value = "field") String field, - @ApiParam(name = "metric", - value = Documentation.COMPUTE_METRIC, + @Parameter(name = "metric", + description = Documentation.COMPUTE_METRIC, required = true) @QueryParam(value = "metric") String metric, - /*@ApiParam(name = "precision", - value = Documentation.COMPUTE_PRECISON, - defaultValue = "3000", - required = false) + /*@Parameter(name = "precision", + description = Documentation.COMPUTE_PRECISON, + schema = @Schema(defaultValue = "3000")) @DefaultValue("3000") @QueryParam(value = "precision") int precision,*/ // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -161,17 +175,24 @@ public Response compute( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Compute", produces = UTF8JSON, notes = Documentation.COMPUTE_OPERATION, consumes = UTF8JSON, response = ComputationResponse.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = ComputationResponse.class, responseContainer = "ArlasComputation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Compute", description = Documentation.COMPUTE_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = ComputationResponse.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response computePost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -183,27 +204,27 @@ public Response computePost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/count/CountRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/count/CountRESTService.java index fadfe4b5f..b863a93fe 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/count/CountRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/count/CountRESTService.java @@ -31,13 +31,18 @@ import io.arlas.server.core.utils.ColumnFilterUtil; import io.arlas.server.core.utils.ParamsParser; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.List; import java.util.Optional; @@ -54,60 +59,71 @@ public CountRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Count", produces = UTF8JSON, notes = "Count the number of elements found in the collection(s), given the filters", consumes = UTF8JSON, response = Hits.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = Hits.class, responseContainer = "ArlasHits"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Count", + description = "Count the number of elements found in the collection(s), given the filters" + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Hits.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response count( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collections", + @Parameter(name = "collection", + description = "collections", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionfilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService().getCollectionReference(collection, Optional.ofNullable(organisations)); @@ -138,15 +154,24 @@ public Response count( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Count", produces = UTF8JSON, notes = "Count the number of elements found in the collection(s), given the filters", consumes = UTF8JSON, response = Hits.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = Hits.class, responseContainer = "ArlasHits"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Count", + description = "Count the number of elements found in the collection(s), given the filters" + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Hits.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response countPost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collections", + @Parameter(name = "collection", + description = "collections", required = true) @PathParam(value = "collection") String collection, @@ -154,21 +179,21 @@ public Response countPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionfilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeCollectionRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeCollectionRESTService.java index b2b6637ee..fc4860223 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeCollectionRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeCollectionRESTService.java @@ -27,13 +27,15 @@ import io.arlas.server.core.services.ExploreService; import io.arlas.server.core.utils.ColumnFilterUtil; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.Collections; import java.util.Optional; @@ -51,39 +53,48 @@ public DescribeCollectionRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Describe", produces = UTF8JSON, notes = "Describe the structure and the content of the given collection. ", consumes = UTF8JSON, response = CollectionReferenceDescription.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReferenceDescription.class, responseContainer = "CollectionReferenceDescription"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 403, message = "Collection not authorized.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Describe", + description = "Describe the structure and the content of the given collection." + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = CollectionReferenceDescription.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "403", description = "Collection not authorized.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response describe( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = "Pretty print", - defaultValue = "false") + @Parameter(name = "pretty", + description = "Pretty print", + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws ArlasException { diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeRESTService.java index c858e2c77..29236cf05 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/describe/DescribeRESTService.java @@ -27,13 +27,16 @@ import io.arlas.server.core.model.response.CollectionReferenceDescription; import io.arlas.server.core.services.ExploreService; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.List; import java.util.Optional; @@ -51,31 +54,40 @@ public DescribeRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "List", produces = UTF8JSON, notes = "List the collections configured in ARLAS. ", consumes = UTF8JSON, response = CollectionReferenceDescription.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = CollectionReferenceDescription.class, responseContainer = "List"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 403, message = "Collection not authorized.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "List", + description = "List the collections configured in ARLAS." + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(array = @ArraySchema(schema = @Schema(implementation = CollectionReferenceDescription.class)))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "403", description = "Collection not authorized.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response list( - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws ArlasException { List collectionReferences = exploreService.getCollectionReferenceService() diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/raw/RawRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/raw/RawRESTService.java index 3dd0913d0..e34974a28 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/raw/RawRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/raw/RawRESTService.java @@ -20,8 +20,6 @@ package io.arlas.server.rest.explore.raw; import com.codahale.metrics.annotation.Timed; -import com.fasterxml.jackson.databind.node.ObjectNode; -import io.arlas.server.core.app.Documentation; import io.arlas.commons.exceptions.ArlasException; import io.arlas.commons.exceptions.NotFoundException; import io.arlas.commons.rest.response.Error; @@ -31,13 +29,15 @@ import io.arlas.server.core.services.ExploreService; import io.arlas.server.core.utils.ColumnFilterUtil; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.Collections; import java.util.Map; import java.util.Optional; @@ -56,52 +56,61 @@ public RawRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Get an Arlas document", produces = UTF8JSON, notes = "Returns a raw indexed document.", consumes = UTF8JSON, response = ArlasHit.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = ArlasHit.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), - @ApiResponse(code = 400, message = "Bad request.", response = Error.class), - @ApiResponse(code = 404, message = "Not Found Error.", response = Error.class)}) + @Operation( + summary = "Get an Arlas document", + description = "Returns a raw indexed document." + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = ArlasHit.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "404", description = "Not Found Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getArlasHit( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "identifier", - value = "identifier", + @Parameter(name = "identifier", + description = "identifier", required = true) @PathParam(value = "identifier") String identifier, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = "Pretty print", - defaultValue = "false") + @Parameter(name = "pretty", + description = "Pretty print", + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/GeoSearchRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/GeoSearchRESTService.java index 8e206be8e..e1ce560e7 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/GeoSearchRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/GeoSearchRESTService.java @@ -34,15 +34,19 @@ import io.arlas.server.core.utils.*; import io.arlas.server.rest.explore.ExploreRESTServices; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; import org.apache.commons.io.FileUtils; import org.geojson.FeatureCollection; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.util.List; @@ -61,117 +65,127 @@ public GeoSearchRESTService(ExploreService exploreService) { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoSearch", produces = UTF8JSON, notes = Documentation.GEOSEARCH_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "GeoSearch", + description = Documentation.GEOSEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geosearch( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- PROJECTION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "include", - value = Documentation.PROJECTION_PARAM_INCLUDE, - allowMultiple = true, - defaultValue = "*") + @Parameter(name = "include", + description = Documentation.PROJECTION_PARAM_INCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "*")) @QueryParam(value = "include") String include, - @ApiParam(name = "exclude", - value = Documentation.PROJECTION_PARAM_EXCLUDE, - allowMultiple = true, - defaultValue = "") + @Parameter(name = "exclude", + description = Documentation.PROJECTION_PARAM_EXCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "")) @QueryParam(value = "exclude") String exclude, - @ApiParam(name = "returned_geometries", - value = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, - defaultValue = "") + @Parameter(name = "returned_geometries", + description = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, + schema = @Schema(defaultValue = "")) @QueryParam(value = "returned_geometries") String returned_geometries, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", - value = Documentation.PAGE_PARAM_SIZE, - defaultValue = "10", - allowableValues = "range[1, infinity]", - type = "integer") + @Parameter(name = "size", + description = Documentation.PAGE_PARAM_SIZE, + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") IntParam size, - @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "1", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "sort", - value = Documentation.PAGE_PARAM_SORT, - allowMultiple = true) + @Parameter(name = "sort", + description = Documentation.PAGE_PARAM_SORT, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "sort") String sort, - @ApiParam(name = "after", - value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", + description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", - value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", + description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { @@ -191,112 +205,121 @@ public Response geosearch( @GET @Produces(ZIPFILE) @Consumes(UTF8JSON) - @ApiOperation(value = "ShapeSearch", produces = ZIPFILE, notes = Documentation.SHAPESEARCH_OPERATION, consumes = UTF8JSON) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "ShapeSearch", + description = Documentation.SHAPESEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response shapesearch( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- PROJECTION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "include", - value = Documentation.PROJECTION_PARAM_INCLUDE, - allowMultiple = true, - defaultValue = "*") + @Parameter(name = "include", + description = Documentation.PROJECTION_PARAM_INCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "*")) @QueryParam(value = "include") String include, - @ApiParam(name = "exclude", - value = Documentation.PROJECTION_PARAM_EXCLUDE, - allowMultiple = true, - defaultValue = "") + @Parameter(name = "exclude", + description = Documentation.PROJECTION_PARAM_EXCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "")) @QueryParam(value = "exclude") String exclude, - @ApiParam(name = "returned_geometries", - value = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, - defaultValue = "") + @Parameter(name = "returned_geometries", + description = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, + schema = @Schema(defaultValue = "")) @QueryParam(value = "returned_geometries") String returned_geometries, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", - value = Documentation.PAGE_PARAM_SIZE, - defaultValue = "10", - allowableValues = "range[1, infinity]", - type = "integer") + @Parameter(name = "size", + description = Documentation.PAGE_PARAM_SIZE, + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") IntParam size, - @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "1", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "sort", - value = Documentation.PAGE_PARAM_SORT, - allowMultiple = true) + @Parameter(name = "sort", + description = Documentation.PAGE_PARAM_SORT, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "sort") String sort, - @ApiParam(name = "after", - value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", + description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", - value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", + description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { @@ -316,130 +339,140 @@ public Response shapesearch( @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Tiled GeoSearch", produces = UTF8JSON, notes = Documentation.TILED_GEOSEARCH_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Tiled GeoSearch", + description = Documentation.TILED_GEOSEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response tiledgeosearch( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "x", - value = "x", + @Parameter(name = "x", + description = "x", required = true) @PathParam(value = "x") Integer x, - @ApiParam(name = "y", - value = "y", + @Parameter(name = "y", + description = "y", required = true) @PathParam(value = "y") Integer y, - @ApiParam(name = "z", - value = "z", + @Parameter(name = "z", + description = "z", required = true) @PathParam(value = "z") Integer z, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", - value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", + description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- PROJECTION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "include", - value = Documentation.PROJECTION_PARAM_INCLUDE, - allowMultiple = true, - defaultValue = "*") + @Parameter(name = "include", + description = Documentation.PROJECTION_PARAM_INCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "*")) @QueryParam(value = "include") String include, - @ApiParam(name = "exclude", value = Documentation.PROJECTION_PARAM_EXCLUDE, - allowMultiple = true, - defaultValue = "") + @Parameter(name = "exclude", description = Documentation.PROJECTION_PARAM_EXCLUDE, + style = ParameterStyle.FORM, + explode = Explode.TRUE, + schema = @Schema(defaultValue = "")) @QueryParam(value = "exclude") String exclude, - @ApiParam(name = "returned_geometries", - value = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, - defaultValue = "") + @Parameter(name = "returned_geometries", + description = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, + schema = @Schema(defaultValue = "")) @QueryParam(value = "returned_geometries") String returned_geometries, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", - value = Documentation.PAGE_PARAM_SIZE, - defaultValue = "10", - allowableValues = "range[1, infinity]", - type = "integer") + @Parameter(name = "size", + description = Documentation.PAGE_PARAM_SIZE, + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") IntParam size, - @ApiParam(name = "from", - value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", + description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "1", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "sort", - value = Documentation.PAGE_PARAM_SORT, - allowMultiple = true) + @Parameter(name = "sort", + description = Documentation.PAGE_PARAM_SORT, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "sort") String sort, - @ApiParam(name = "after", - value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", + description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", - value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", + description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -459,21 +492,29 @@ public Response tiledgeosearch( partitionFilter, Optional.ofNullable(columnFilter), flat, include, exclude, size, from, sort, after, before, maxagecache, returned_geometries, false); } - @Timed @Path("{collection}/_geosearch") @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "GeoSearch", produces = UTF8JSON, notes = Documentation.GEOSEARCH_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = FeatureCollection.class, responseContainer = "FeatureCollection"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "GeoSearch", + description = Documentation.GEOSEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = FeatureCollection.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response geosearchPost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, @@ -486,26 +527,26 @@ public Response geosearchPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -541,15 +582,23 @@ public Response geosearchPost( @POST @Produces(ZIPFILE) @Consumes(UTF8JSON) - @ApiOperation(value = "ShapeSearch", produces = ZIPFILE, notes = Documentation.SHAPESEARCH_OPERATION, consumes = UTF8JSON) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "ShapeSearch", + description = Documentation.SHAPESEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response shapesearchPost( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, @@ -562,26 +611,26 @@ public Response shapesearchPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -618,7 +667,7 @@ public Response shapesearchPost( } finally { try { FileUtils.forceDeleteOnExit(result); - } catch (IOException e) { + } catch (IOException ignored) { } } } diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/SearchRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/SearchRESTService.java index aa5253bbd..83b4e0118 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/SearchRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/search/SearchRESTService.java @@ -34,15 +34,20 @@ import io.arlas.server.core.utils.ParamsParser; import io.arlas.server.rest.explore.ExploreRESTServices; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; + import java.util.List; import java.util.Optional; @@ -59,121 +64,126 @@ public SearchRESTService(ExploreService exploreService) { @GET @Produces({UTF8JSON, ATOM.APPLICATION_ATOM_XML}) @Consumes(UTF8JSON) - @ApiOperation(value = "Search", produces = UTF8JSON + "," + ATOM.APPLICATION_ATOM_XML, notes = Documentation.SEARCH_OPERATION, consumes = UTF8JSON, response = Hits.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = Hits.class, responseContainer = "ArlasHits"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Search", + description = Documentation.SEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Hits.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response search( @Context UriInfo uriInfo, // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collection", - value = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", - value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", + description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - defaultValue = "true", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + schema = @Schema(defaultValue = "true"), + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @DefaultValue("false") @QueryParam(value = "pretty") Boolean pretty, - @ApiParam(name = "flat", - value = Documentation.FORM_FLAT, - defaultValue = "false") + @Parameter(name = "flat", + description = Documentation.FORM_FLAT, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "flat") Boolean flat, // -------------------------------------------------------- // ----------------------- PROJECTION ----------------------- // -------------------------------------------------------- - @ApiParam(name = "include", - value = Documentation.PROJECTION_PARAM_INCLUDE, - allowMultiple = true, - defaultValue = "*") + @Parameter(name = "include", + description = Documentation.PROJECTION_PARAM_INCLUDE, + schema = @Schema(defaultValue = "*")) @QueryParam(value = "include") String include, - @ApiParam(name = "exclude", - value = Documentation.PROJECTION_PARAM_EXCLUDE, - allowMultiple = true, - defaultValue = "") + @Parameter(name = "exclude", + description = Documentation.PROJECTION_PARAM_EXCLUDE, + schema = @Schema()) @QueryParam(value = "exclude") String exclude, - @ApiParam(name = "returned_geometries", - value = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, - defaultValue = "") + @Parameter(name = "returned_geometries", + description = Documentation.PROJECTION_PARAM_RETURNED_GEOMETRIES, + schema = @Schema()) @QueryParam(value = "returned_geometries") String returned_geometries, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", value = Documentation.PAGE_PARAM_SIZE, - defaultValue = "10", - allowableValues = "range[1, infinity]", - type = "integer") + @Parameter(name = "size", description = Documentation.PAGE_PARAM_SIZE, + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") IntParam size, - @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "0", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "sort", - value = Documentation.PAGE_PARAM_SORT) + @Parameter(name = "sort", + description = Documentation.PAGE_PARAM_SORT) @QueryParam(value = "sort") String sort, - @ApiParam(name = "after", - value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", + description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", - value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", + description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -209,16 +219,25 @@ public Response search( @POST @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Search", produces = UTF8JSON, notes = Documentation.SEARCH_OPERATION, consumes = UTF8JSON, response = Hits.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation", response = Hits.class, responseContainer = "ArlasHits"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Search", + description = Documentation.SEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = Hits.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response searchPost( @Context UriInfo uriInfo, // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- @@ -230,27 +249,27 @@ public Response searchPost( // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", - value = Documentation.FORM_PRETTY, - defaultValue = "false") + @Parameter(name = "pretty", + description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/explore/suggest/SuggestRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/explore/suggest/SuggestRESTService.java index 808936bdf..59ba0ada9 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/explore/suggest/SuggestRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/explore/suggest/SuggestRESTService.java @@ -22,15 +22,17 @@ import com.codahale.metrics.annotation.Timed; import io.arlas.server.core.services.ExploreService; import io.arlas.server.rest.explore.ExploreRESTServices; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.util.List; -import java.util.Optional; import static io.arlas.commons.rest.utils.ServerConstants.COLUMN_FILTER; import static io.arlas.commons.rest.utils.ServerConstants.PARTITION_FILTER; @@ -44,23 +46,28 @@ public class SuggestRESTService extends ExploreRESTServices { @GET @Produces(UTF8JSON) @Consumes(UTF8JSON) - @ApiOperation(value = "Suggest", produces = UTF8JSON, notes = "Suggest the the n (n=size) most relevant terms given the filters", consumes = UTF8JSON) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation")}) + @Operation( + summary = "Suggest", + description = "Suggest the the n (n=size) most relevant terms given the filters" + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation") + }) public Response suggest( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "collections", - value = "collections, comma separated", + description = "collections, comma separated", required = true) @PathParam(value = "collections") String collections, // -------------------------------------------------------- // ----------------------- SEARCH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = """ + @Parameter(name = "f", + description = """ - A triplet for filtering the result. Multiple filter can be provided. The order does not matter.\s \s - A triplet is composed of a field name, a comparison operator and a value.\s @@ -92,45 +99,44 @@ public Response suggest( For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md\s""" , - allowMultiple = true) + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", - value = "A full text search") + @Parameter(name = "q", + description = "A full text search") @QueryParam(value = "q") String q, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", value = "Pretty print", - defaultValue = "false") + @Parameter(name = "pretty", description = "Pretty print", + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, // -------------------------------------------------------- // ----------------------- SIZE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", - value = "The maximum number of entries or sub-entries to be returned. The default value is 10", - defaultValue = "10", - allowableValues = "range[1, infinity]") + @Parameter(name = "size", + description = "The maximum number of entries or sub-entries to be returned. The default value is 10", + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") Integer size, - @ApiParam(name = "from", - value = "From index to start the search from. Defaults to 0.", - defaultValue = "0", - allowableValues = "range[1, infinity]") + @Parameter(name = "from", + description = "From index to start the search from. Defaults to 0.", + schema = @Schema(type="integer", minimum = "1", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "size") Integer from, @@ -138,15 +144,15 @@ public Response suggest( // ----------------------- SUGGEST ----------------------- // -------------------------------------------------------- - @ApiParam(name = "field", - value = "Name of the field to be used for retrieving the most relevant terms", - defaultValue = "_all") + @Parameter(name = "field", + description = "Name of the field to be used for retrieving the most relevant terms", + schema = @Schema(defaultValue = "_all")) @QueryParam(value = "field") String field, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) { return cache(Response.ok("suggest"), maxagecache); // TODO : right response diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/plugins/eo/TileRESTService.java b/arlas-rest/src/main/java/io/arlas/server/rest/plugins/eo/TileRESTService.java index ea438557f..68ef7fc73 100644 --- a/arlas-rest/src/main/java/io/arlas/server/rest/plugins/eo/TileRESTService.java +++ b/arlas-rest/src/main/java/io/arlas/server/rest/plugins/eo/TileRESTService.java @@ -35,17 +35,20 @@ import io.arlas.server.core.utils.*; import io.arlas.server.rest.explore.ExploreRESTServices; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import org.geojson.FeatureCollection; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.enums.Explode; +import io.swagger.v3.oas.annotations.enums.ParameterStyle; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Response; import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.io.ParseException; import javax.imageio.ImageIO; -import javax.ws.rs.*; -import javax.ws.rs.core.Response; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.LinkedList; @@ -69,107 +72,114 @@ public TileRESTService(ExploreService exploreService) { @GET @Produces({TileRESTService.PRODUCES_PNG}) @Consumes(UTF8JSON) - @ApiOperation(value = "Tiled GeoSearch", produces = TileRESTService.PRODUCES_PNG, notes = Documentation.TILED_GEOSEARCH_OPERATION, consumes = UTF8JSON, response = FeatureCollection.class) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "Tiled GeoSearch", + description = Documentation.TILED_GEOSEARCH_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response tiledgeosearch( // -------------------------------------------------------- // ----------------------- PATH ----------------------- // -------------------------------------------------------- - @ApiParam(name = "collection", - value = "collection", + @Parameter(name = "collection", + description = "collection", required = true) @PathParam(value = "collection") String collection, - @ApiParam(name = "x", - value = "x", + @Parameter(name = "x", + description = "x", required = true) @PathParam(value = "x") Integer x, - @ApiParam(name = "y", - value = "y", + @Parameter(name = "y", + description = "y", required = true) @PathParam(value = "y") Integer y, - @ApiParam(name = "z", - value = "z", + @Parameter(name = "z", + description = "z", required = true) @PathParam(value = "z") Integer z, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(name = "f", - value = Documentation.FILTER_PARAM_F, - allowMultiple = true) + @Parameter(name = "f", + description = Documentation.FILTER_PARAM_F, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "f") List f, - @ApiParam(name = "q", value = Documentation.FILTER_PARAM_Q, - allowMultiple = true) + @Parameter(name = "q", description = Documentation.FILTER_PARAM_Q, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "q") List q, - @ApiParam(name = "dateformat", - value = Documentation.FILTER_DATE_FORMAT) + @Parameter(name = "dateformat", + description = Documentation.FILTER_DATE_FORMAT) @QueryParam(value = "dateformat") String dateformat, - @ApiParam(name = "righthand", - value = Documentation.FILTER_RIGHT_HAND) + @Parameter(name = "righthand", + description = Documentation.FILTER_RIGHT_HAND) @QueryParam(value = "righthand") Boolean righthand, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "size", - value = Documentation.PAGE_PARAM_SIZE, - defaultValue = "10", - allowableValues = "range[1, infinity]", - type = "integer") + @Parameter(name = "size", + description = Documentation.PAGE_PARAM_SIZE, + schema = @Schema(type="integer", minimum = "1", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "size") IntParam size, - @ApiParam(name = "from", - value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", + description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "1", defaultValue = "00")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "sort", - value = Documentation.PAGE_PARAM_SORT, - allowMultiple = true) + @Parameter(name = "sort", + description = Documentation.PAGE_PARAM_SORT, + style = ParameterStyle.FORM, + explode = Explode.TRUE) @QueryParam(value = "sort") String sort, - @ApiParam(name = "after", - value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", + description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", - value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", + description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, // -------------------------------------------------------- // ----------------------- RENDERING ----------------------- // -------------------------------------------------------- - @ApiParam(name = "sampling", - value = TileDocumentation.TILE_SAMPLING, - defaultValue = "10") + @Parameter(name = "sampling", + description = TileDocumentation.TILE_SAMPLING, + schema = @Schema(defaultValue = "10")) @QueryParam(value = "sampling") Integer sampling, - @ApiParam(name = "coverage", - value = TileDocumentation.TILE_COVERAGE, - defaultValue = "70") + @Parameter(name = "coverage", + description = TileDocumentation.TILE_COVERAGE, + schema = @Schema(defaultValue = "70")) @QueryParam(value = "coverage") Integer coverage, // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache") + @Parameter(description = "max-age-cache") @QueryParam(value = "max-age-cache") Integer maxagecache ) throws NotFoundException, ArlasException { CollectionReference collectionReference = exploreService.getCollectionReferenceService() @@ -214,7 +224,7 @@ public Response tiledgeosearch( collectionReference.params.rasterTileURL.checkGeometry), collectionReference.params.rasterTileWidth, collectionReference.params.rasterTileHeight)).collect(Collectors.toCollection(LinkedList::new)); - if(providers.size()==0){ + if (providers.isEmpty()){ return Response.noContent().build(); } Try,ArlasException> stacked = new RasterTileStacker() diff --git a/arlas-server/pom.xml b/arlas-server/pom.xml index 909d63ab0..b5190e16e 100644 --- a/arlas-server/pom.xml +++ b/arlas-server/pom.xml @@ -19,117 +19,38 @@ io.arlas arlas-rest 24.1.2-SNAPSHOT - - - jackson-dataformat-yaml - com.fasterxml.jackson.dataformat - - - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${jackson.dataformat.version} + io.arlas arlas-opensearch 24.1.2-SNAPSHOT - - - jakarta.xml.bind-api - jakarta.xml.bind - - + io.arlas ogc-csw 24.1.2-SNAPSHOT + io.arlas ogc-wfs 24.1.2-SNAPSHOT + io.arlas stac-api 24.1.2-SNAPSHOT + io.arlas arlas-admin 24.1.2-SNAPSHOT - - io.swagger.core.v3 - swagger-core - ${swaggerv3.version} - - - commons-lang3 - org.apache.commons - - - jakarta.activation-api - jakarta.activation - - - jakarta.xml.bind-api - jakarta.xml.bind - - - jackson-annotations - com.fasterxml.jackson.core - - - jackson-databind - com.fasterxml.jackson.core - - - jackson-core - com.fasterxml.jackson.core - - - jackson-dataformat-yaml - com.fasterxml.jackson.dataformat - - - - - io.swagger.core.v3 - swagger-jaxrs2 - ${swaggerv3.version} - - - javassist - org.javassist - - - jakarta.activation-api - jakarta.activation - - - jakarta.xml.bind-api - jakarta.xml.bind - - - jackson-jaxrs-json-provider - com.fasterxml.jackson.jaxrs - - - jackson-databind - com.fasterxml.jackson.core - - - - - io.swagger.core.v3 - swagger-integration - ${swaggerv3.version} - diff --git a/arlas-server/src/main/java/io/arlas/server/app/ArlasServer.java b/arlas-server/src/main/java/io/arlas/server/app/ArlasServer.java index c73392112..01ed1495c 100644 --- a/arlas-server/src/main/java/io/arlas/server/app/ArlasServer.java +++ b/arlas-server/src/main/java/io/arlas/server/app/ArlasServer.java @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; import io.arlas.commons.cache.CacheFactory; import io.arlas.commons.config.ArlasConfiguration; import io.arlas.commons.config.ArlasCorsConfiguration; @@ -30,6 +30,7 @@ import io.arlas.commons.exceptions.IllegalArgumentExceptionMapper; import io.arlas.commons.exceptions.JsonProcessingExceptionMapper; import io.arlas.commons.rest.utils.PrettyPrintFilter; +import io.arlas.commons.utils.MapAwareConverter; import io.arlas.filter.core.PolicyEnforcer; import io.arlas.server.admin.task.CollectionAutoDiscover; import io.arlas.server.core.app.ArlasServerConfiguration; @@ -64,28 +65,28 @@ import io.arlas.server.stac.api.StacCoreRESTService; import io.arlas.server.stac.api.StacSearchRESTService; import io.arlas.server.wfs.requestfilter.InsensitiveCaseFilter; -import io.dropwizard.Application; import io.dropwizard.assets.AssetsBundle; import io.dropwizard.configuration.EnvironmentVariableSubstitutor; import io.dropwizard.configuration.SubstitutingSourceProvider; +import io.dropwizard.core.Application; +import io.dropwizard.core.setup.Bootstrap; +import io.dropwizard.core.setup.Environment; import io.dropwizard.lifecycle.setup.ScheduledExecutorServiceBuilder; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; import io.federecio.dropwizard.swagger.SwaggerBundle; import io.federecio.dropwizard.swagger.SwaggerBundleConfiguration; -import io.swagger.v3.jaxrs2.integration.resources.OpenApiResource; -import io.swagger.v3.oas.integration.SwaggerConfiguration; +import io.swagger.v3.core.converter.ModelConverters; +import io.swagger.v3.jaxrs2.Reader; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.servers.Server; +import jakarta.servlet.DispatcherType; +import jakarta.servlet.FilterRegistration; +import jakarta.ws.rs.core.HttpHeaders; import org.eclipse.jetty.servlets.CrossOriginFilter; import org.glassfish.jersey.media.multipart.MultiPartFeature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.servlet.DispatcherType; -import javax.servlet.FilterRegistration; -import javax.ws.rs.core.HttpHeaders; import java.util.Collections; import java.util.EnumSet; import java.util.concurrent.ScheduledExecutorService; @@ -119,8 +120,8 @@ protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(ArlasServerCo public void run(ArlasServerConfiguration configuration, Environment environment) throws Exception { configuration.check(); - LOGGER.info("Checked configuration: " + (new ObjectMapper()).writer().writeValueAsString(configuration)); - + LOGGER.info("Checked configuration: " + environment.getObjectMapper().writer().writeValueAsString(configuration)); + ModelConverters.getInstance().addConverter(new MapAwareConverter()); CacheFactory cacheFactory = (CacheFactory) Class .forName(configuration.arlasCacheFactoryClass) .getConstructor(ArlasConfiguration.class) @@ -136,6 +137,7 @@ public void run(ArlasServerConfiguration configuration, Environment environment) ExploreService exploration = dbToolFactory.getExploreService(); environment.getObjectMapper().setSerializationInclusion(Include.NON_NULL); + environment.jersey().register(MultiPartFeature.class); environment.jersey().register(new ArlasExceptionMapper()); environment.jersey().register(new IllegalArgumentExceptionMapper()); @@ -210,26 +212,23 @@ public void run(ArlasServerConfiguration configuration, Environment environment) if (configuration.arlasServiceSTACEnabled) { LOGGER.info("STAC Service enabled"); - - // Add OpenAPI v3 endpoint String baseUri = configuration.arlasBaseUri; if (baseUri.endsWith("/")) { baseUri = baseUri.substring(0, baseUri.length()-1); } Info info = new Info().title("ARLAS STAC API").version("1.0.0"); - SwaggerConfiguration oasConfig = new SwaggerConfiguration() - .openAPI(new OpenAPI().info(info).servers(Collections.singletonList(new Server().url(baseUri)))) - .prettyPrint(true) - .resourceClasses(Stream.of("io.arlas.server.stac.api.StacCoreRESTService", - "io.arlas.server.stac.api.StacCollectionsRESTService", - "io.arlas.server.stac.api.StacConformanceRESTService", - "io.arlas.server.stac.api.StacSearchRESTService") - .collect(Collectors.toSet())); - environment.jersey().register(new OpenApiResource().openApiConfiguration(oasConfig)); - // - + Reader reader = new Reader(new OpenAPI().info(info).servers(Collections.singletonList(new Server().url(baseUri)))); + OpenAPI openAPI = reader.read(Stream.of( + StacCoreRESTService.class, + StacCollectionsRESTService.class, + StacConformanceRESTService.class, + StacSearchRESTService.class) + .collect(Collectors.toSet())); + environment.getObjectMapper().configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true); + String openAPIjson = environment.getObjectMapper().writeValueAsString(openAPI); + environment.getObjectMapper().configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, false); environment.jersey().register(new StacCoreRESTService(configuration.stacConfiguration, configuration.arlasRestCacheTimeout, - dbToolFactory.getCollectionReferenceService(), dbToolFactory.getExploreService(), configuration.arlasBaseUri)); + dbToolFactory.getCollectionReferenceService(), dbToolFactory.getExploreService(), configuration.arlasBaseUri, openAPIjson)); environment.jersey().register(new StacCollectionsRESTService(configuration.stacConfiguration, configuration.arlasRestCacheTimeout, dbToolFactory.getCollectionReferenceService(), dbToolFactory.getExploreService(), configuration.arlasBaseUri)); environment.jersey().register(new StacConformanceRESTService(configuration.stacConfiguration, configuration.arlasRestCacheTimeout, diff --git a/arlas-server/src/main/java/io/arlas/server/impl/ElasticDatabaseToolsFactory.java b/arlas-server/src/main/java/io/arlas/server/impl/ElasticDatabaseToolsFactory.java index 10f7d6ceb..a37da656c 100644 --- a/arlas-server/src/main/java/io/arlas/server/impl/ElasticDatabaseToolsFactory.java +++ b/arlas-server/src/main/java/io/arlas/server/impl/ElasticDatabaseToolsFactory.java @@ -35,7 +35,7 @@ import io.arlas.server.ogc.wfs.services.ElasticWFSToolService; import io.arlas.server.ogc.wfs.services.WFSToolService; import io.arlas.server.core.services.ExploreService; -import io.dropwizard.setup.Environment; +import io.dropwizard.core.setup.Environment; import java.util.HashMap; import java.util.Map; diff --git a/arlas-tests/src/test/java/io/arlas/server/tests/auth/AuthServiceIT.java b/arlas-tests/src/test/java/io/arlas/server/tests/auth/AuthServiceIT.java index 7e0b2ae5d..ce6bc882f 100644 --- a/arlas-tests/src/test/java/io/arlas/server/tests/auth/AuthServiceIT.java +++ b/arlas-tests/src/test/java/io/arlas/server/tests/auth/AuthServiceIT.java @@ -20,10 +20,9 @@ package io.arlas.server.tests.auth; import io.arlas.server.tests.AbstractTestContext; +import jakarta.ws.rs.core.HttpHeaders; import org.junit.Test; -import javax.ws.rs.core.HttpHeaders; - import static io.restassured.RestAssured.given; import static io.restassured.RestAssured.when; diff --git a/arlas-tests/src/test/java/io/arlas/server/tests/rest/plugins/eo/TileServiceIT.java b/arlas-tests/src/test/java/io/arlas/server/tests/rest/plugins/eo/TileServiceIT.java index 451803b7e..dda4f1bef 100644 --- a/arlas-tests/src/test/java/io/arlas/server/tests/rest/plugins/eo/TileServiceIT.java +++ b/arlas-tests/src/test/java/io/arlas/server/tests/rest/plugins/eo/TileServiceIT.java @@ -19,11 +19,11 @@ package io.arlas.server.tests.rest.plugins.eo; -import com.fasterxml.jackson.databind.ObjectMapper; import io.arlas.commons.exceptions.ArlasException; import io.arlas.server.core.utils.ImageUtil; import io.arlas.server.tests.*; import io.restassured.response.ValidatableResponse; +import jakarta.ws.rs.core.Response; import org.geojson.LngLatAlt; import org.geojson.Polygon; import org.hamcrest.Matchers; @@ -33,7 +33,6 @@ import org.junit.Test; import javax.imageio.ImageIO; -import javax.ws.rs.core.Response; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.ArrayList; diff --git a/conf/configuration.yaml b/conf/configuration.yaml index f64124ae4..a93aa1016 100644 --- a/conf/configuration.yaml +++ b/conf/configuration.yaml @@ -3,11 +3,13 @@ ######################################################## # swagger: # Configuration of SWAGGER for generating documentation and APIs - resourcePackage: ${ARLAS_SWAGGER_RESOURCE_PKG:-io.arlas.server.rest} # The java package to process for extracting the APIs (,io.arlas.server.stac) - # temporary patch for bug https://github.com/smoketurner/dropwizard-swagger/issues/206 - # to be removed when version of dropwizard.swagger.version is upgraded - customJavascript: ${ARLAS_CUSTOM_JS:-/arlas/swagger-static/custom-request-interceptor.js} - + resourcePackage: ${ARLAS_SWAGGER_RESOURCE_PKG:-io.arlas.server.rest,io.arlas.server.stac} + # not supported in 3.0.0-1 but PR existing and merged + servers: + - url: ${ARLAS_PREFIX:-/arlas} + description: "Backend server from client browser" + - url: http://arlas-server{ARLAS_PREFIX:-/arlas} + description: "Backend server from docker network" ######################################################## ############ ENABLED SERVICES ############### @@ -180,7 +182,7 @@ arlas_auth_policy_class: ${ARLAS_AUTH_POLICY_CLASS:-io.arlas.filter.impl.NoPolic arlas_auth: permission_url: ${ARLAS_AUTH_PERMISSION_URL:-http://arlas-iam-server/arlas_iam_server/auth/permissions} - public_uris: [${ARLAS_AUTH_PUBLIC_URIS:-swagger.*:*}] + public_uris: [${ARLAS_AUTH_PUBLIC_URIS:-swagger.*:*,openapi.*}] # deprecated, use it only for Integration tests certificate_file: ${ARLAS_AUTH_CERT_FILE:-/opt/app/arlas.pem} certificate_url: ${ARLAS_AUTH_CERT_URL:-} diff --git a/conf/doc/widdershins.json b/conf/doc/widdershins.json new file mode 100644 index 000000000..5a46028ae --- /dev/null +++ b/conf/doc/widdershins.json @@ -0,0 +1,7 @@ +{ + "language_tabs": [], + "omitHeader": true, + "tocSummary": true, + "codeSamples": false + +} \ No newline at end of file diff --git a/conf/maven/pom.xml b/conf/maven/pom.xml index 413c11277..0f05f6f4d 100644 --- a/conf/maven/pom.xml +++ b/conf/maven/pom.xml @@ -49,6 +49,7 @@ pertest + maven-dependency-plugin @@ -110,6 +111,7 @@ + org.apache.maven.plugins maven-compiler-plugin @@ -119,6 +121,7 @@ 17 + org.apache.maven.plugins maven-javadoc-plugin @@ -132,6 +135,7 @@ + org.apache.maven.plugins maven-source-plugin @@ -237,9 +241,9 @@ - 2.2.8 - 2.39 - 2.14.2 + 2.2.20 + 3.0.12 + 2.16.1 4.13.2 diff --git a/conf/npm/package-build.json b/conf/npm/package-build.json index a7e5d26c1..1c6d674ab 100644 --- a/conf/npm/package-build.json +++ b/conf/npm/package-build.json @@ -8,10 +8,15 @@ }, "private": true, "dependencies": { - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "devDependencies": { "typescript": "~2.3.3" + }, + "overrides": { + "isomorphic-fetch": { + "node-fetch": "3.3.0" + } } } \ No newline at end of file diff --git a/conf/npm/package-doc.json b/conf/npm/package-doc.json index 29425a90e..e73de6636 100644 --- a/conf/npm/package-doc.json +++ b/conf/npm/package-doc.json @@ -9,7 +9,7 @@ "private": true, "dependencies": { "es6-promise": "4.2.4", - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "devDependencies": { diff --git a/conf/npm/package-publish.json b/conf/npm/package-publish.json index 262a894d7..459cc44f2 100644 --- a/conf/npm/package-publish.json +++ b/conf/npm/package-publish.json @@ -9,11 +9,11 @@ "arlas" ], "dependencies": { - "portable-fetch": "3.0.0", + "isomorphic-fetch": "3.0.0", "url": "0.11.0" }, "overrides": { - "portable-fetch": { + "isomorphic-fetch": { "node-fetch": "3.3.0" } } diff --git a/conf/swagger/java-config.json b/conf/swagger/java-config.json index c85163952..82a4980ee 100644 --- a/conf/swagger/java-config.json +++ b/conf/swagger/java-config.json @@ -9,10 +9,11 @@ "developerEmail" : "contact@gisaia.com", "developerOrganization" : "Gisaïa", "developerOrganizationUrl": "https://gisaia.com", - "dateLibrary" : "java8", "licenseName": " Apache License Version 2.0", "scmConnection": "scm:git:https://github.com/gisaia/ARLAS-server", "scmDeveloperConnection": "scm:git:https://github.com/gisaia/ARLAS-server", "scmUrl": "https://github.com/gisaia/ARLAS-server", - "library": "jersey2" + "dateLibrary" : "java11", + "library": "jersey3", + "jakarta": true } \ No newline at end of file diff --git a/docker-compose-network.yml b/docker-compose-network.yml deleted file mode 100644 index f52cbf7d4..000000000 --- a/docker-compose-network.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3' - -networks: - default: - external: - name: cloudbuild diff --git a/docs/api/definitions.md b/docs/api/definitions.md deleted file mode 100644 index 2e0ab064b..000000000 --- a/docs/api/definitions.md +++ /dev/null @@ -1,665 +0,0 @@ - - -## Definitions - - -### Aggregation - -|Name|Schema| -|---|---| -|**aggregated_geometries**
*optional*|< enum (BBOX, CENTROID, CELL, CELLCENTER, GEOHASH, GEOHASH_CENTER) > array| -|**fetch_hits**
*optional*|[HitsFetcher](#hitsfetcher)| -|**field**
*optional*|string| -|**format**
*optional*|string| -|**include**
*optional*|string| -|**interval**
*optional*|[Interval](#interval)| -|**metrics**
*optional*|< [Metric](#metric) > array| -|**on**
*optional*|enum (field, count, result)| -|**order**
*optional*|enum (asc, desc)| -|**raw_geometries**
*optional*|< [RawGeometry](#rawgeometry) > array| -|**size**
*optional*|string| -|**type**
*optional*|enum (datehistogram, geohash, geotile, histogram, term, geohex)| - - - -### AggregationMetric - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**type**
*optional*|string| -|**value**
*optional*|object| - - - -### AggregationResponse - -|Name|Schema| -|---|---| -|**count**
*optional*|integer (int64)| -|**elements**
*optional*|< [AggregationResponse](#aggregationresponse) > array| -|**flattened_elements**
*optional*|< string, object > map| -|**geometries**
*optional*|< [ReturnedGeometry](#returnedgeometry) > array| -|**hits**
*optional*|< object > array| -|**key**
*optional*|object| -|**key_as_string**
*optional*|object| -|**metrics**
*optional*|< [AggregationMetric](#aggregationmetric) > array| -|**name**
*optional*|string| -|**query_time**
*optional*|integer (int64)| -|**sumotherdoccounts**
*optional*|integer (int64)| -|**total_time**
*optional*|integer (int64)| -|**totalnb**
*optional*|integer (int64)| - - - -### AggregationsRequest - -|Name|Schema| -|---|---| -|**aggregations**
*optional*|< [Aggregation](#aggregation) > array| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| - - - -### ArlasHit - -|Name|Schema| -|---|---| -|**data**
*optional*|object| -|**md**
*optional*|[MD](#md)| - - - -### Bbox - -|Name|Schema| -|---|---| -|**east**
*required*|number (double)| -|**north**
*required*|number (double)| -|**south**
*required*|number (double)| -|**west**
*required*|number (double)| - - - -### CollectionDisplayNames - -|Name|Schema| -|---|---| -|**collection**
*optional*|string| -|**fields**
*optional*|< string, string > map| -|**shape_columns**
*optional*|< string, string > map| - - - -### CollectionOrganisations - -|Name|Schema| -|---|---| -|**owner**
*optional*|string| -|**public**
*optional*|boolean| -|**shared**
*optional*|< string > array| - - - -### CollectionReference - -|Name|Schema| -|---|---| -|**collection_name**
*required*|string| -|**params**
*required*|[CollectionReferenceParameters](#collectionreferenceparameters)| - - - -### CollectionReferenceDescription - -|Name|Schema| -|---|---| -|**collection_name**
*required*|string| -|**params**
*required*|[CollectionReferenceParameters](#collectionreferenceparameters)| -|**properties**
*optional*|< string, [CollectionReferenceDescriptionProperty](#collectionreferencedescriptionproperty) > map| - - - -### CollectionReferenceDescriptionProperty - -|Name|Schema| -|---|---| -|**format**
*optional*|string| -|**hash_field**
*optional*|string| -|**indexed**
*optional*|boolean| -|**properties**
*optional*|< string, [CollectionReferenceDescriptionProperty](#collectionreferencedescriptionproperty) > map| -|**taggable**
*optional*|boolean| -|**type**
*optional*|enum (TEXT, KEYWORD, LONG, INTEGER, SHORT, BYTE, DOUBLE, FLOAT, DATE, BOOLEAN, BINARY, INT_RANGE, FLOAT_RANGE, LONG_RANGE, DOUBLE_RANGE, DATE_RANGE, OBJECT, NESTED, GEO_POINT, GEO_SHAPE, IP, COMPLETION, TOKEN_COUNT, MAPPER_MURMUR3, UNKNOWN, VARCHAR, CHAR, CHARACTER, BIT, TINYINT, SMALLINT, INT, BIGINT, DECIMAL, NUMERIC, REAL, DOUBLEPRECISION, TIMESTAMP, TIME, INTERVAL, GEOMETRY, GEOGRAPHY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION, MURMUR3)| - - - -### CollectionReferenceParameters - -|Name|Schema| -|---|---| -|**atom_feed**
*optional*|[Feed](#feed)| -|**centroid_path**
*required*|string| -|**custom_params**
*optional*|< string, string > map| -|**display_names**
*optional*|[CollectionDisplayNames](#collectiondisplaynames)| -|**dublin_core_element_name**
*optional*|[DublinCoreElementName](#dublincoreelementname)| -|**exclude_fields**
*optional*|string| -|**exclude_wfs_fields**
*optional*|string| -|**filter**
*optional*|[Filter](#filter)| -|**geometry_path**
*required*|string| -|**h3_path**
*optional*|string| -|**id_path**
*required*|string| -|**index_name**
*required*|string| -|**inspire**
*optional*|[Inspire](#inspire)| -|**license_name**
*optional*|string| -|**license_urls**
*optional*|< string > array| -|**open_search**
*optional*|[OpenSearch](#opensearch)| -|**organisations**
*optional*|[CollectionOrganisations](#collectionorganisations)| -|**raster_tile_height**
*optional*|integer (int32)| -|**raster_tile_url**
*optional*|[RasterTileURL](#rastertileurl)| -|**raster_tile_width**
*optional*|integer (int32)| -|**taggable_fields**
*optional*|string| -|**timestamp_path**
*required*|string| -|**update_max_hits**
*optional*|integer (int32)| - - - -### ComputationRequest - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| -|**metric**
*optional*|enum (AVG, MAX, MIN, SUM, CARDINALITY, SPANNING, GEOBBOX, GEOCENTROID)| - - - -### ComputationResponse - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**geometry**
*optional*|[GeoJsonObject](#geojsonobject)| -|**metric**
*optional*|enum (AVG, MAX, MIN, SUM, CARDINALITY, SPANNING, GEOBBOX, GEOCENTROID)| -|**query_time**
*optional*|integer (int64)| -|**total_time**
*optional*|integer (int64)| -|**totalnb**
*optional*|integer (int64)| -|**value**
*optional*|number (double)| - - - -### Count - -|Name|Schema| -|---|---| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| - - - -### Crs - -|Name|Schema| -|---|---| -|**properties**
*optional*|< string, object > map| -|**type**
*optional*|enum (name, link)| - - - -### DublinCoreElementName - -|Name|Schema| -|---|---| -|**bbox**
*optional*|[Bbox](#bbox)| -|**contributor**
*optional*|string| -|**coverage**
*optional*|< string, object > map| -|**coverage_centroid**
*optional*|string| -|**creator**
*optional*|string| -|**date**
*optional*|string| -|**description**
*optional*|string| -|**format**
*optional*|string| -|**identifier**
*optional*|string| -|**language**
*optional*|string| -|**publisher**
*optional*|string| -|**source**
*optional*|string| -|**subject**
*optional*|string| -|**title**
*optional*|string| -|**type**
*optional*|string| - - - -### Error - -|Name|Schema| -|---|---| -|**error**
*optional*|string| -|**message**
*optional*|string| -|**status**
*optional*|integer (int32)| - - - -### Expression - -|Name|Schema| -|---|---| -|**field**
*optional*|string| -|**op**
*optional*|enum (eq, gte, gt, lte, lt, like, ne, range, within, notwithin, intersects, notintersects)| -|**value**
*optional*|string| - - - -### Feature - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**crs**
*optional*|[Crs](#crs)| -|**geometry**
*optional*|[GeoJsonObject](#geojsonobject)| -|**id**
*optional*|string| -|**properties**
*optional*|< string, object > map| - - - -### FeatureCollection - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**crs**
*optional*|[Crs](#crs)| -|**features**
*optional*|< [Feature](#feature) > array| - - - -### Feed - -|Name|Schema| -|---|---| -|**author**
*optional*|[Person](#person)| -|**contributor**
*optional*|[Person](#person)| -|**generator**
*optional*|[Generator](#generator)| -|**icon**
*optional*|string| -|**logo**
*optional*|string| -|**rights**
*optional*|string| -|**subtitle**
*optional*|string| - - - -### Filter - -|Name|Schema| -|---|---| -|**dateformat**
*optional*|string| -|**f**
*optional*|< < [Expression](#expression) > array > array| -|**q**
*optional*|< < string > array > array| -|**righthand**
*optional*|boolean| - - - -### Form - -|Name|Schema| -|---|---| -|**flat**
*optional*|boolean| -|**pretty**
*optional*|boolean| - - - -### Generator - -|Name|Schema| -|---|---| -|**name**
*optional*|string| -|**uri**
*optional*|string| -|**version**
*optional*|string| - - - -### Geo - -|Name|Schema| -|---|---| -|**geometry**
*optional*|[GeoJsonObject](#geojsonobject)| -|**path**
*optional*|string| - - - -### GeoJsonObject - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### GeometryCollection -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**crs**
*optional*|[Crs](#crs)| -|**geometries**
*optional*|< [GeoJsonObject](#geojsonobject) > array| - - - -### Hits - -|Name|Schema| -|---|---| -|**collection**
*optional*|string| -|**hits**
*optional*|< [ArlasHit](#arlashit) > array| -|**links**
*optional*|< string, [Link](#link) > map| -|**nbhits**
*optional*|integer (int64)| -|**totalnb**
*optional*|integer (int64)| - - - -### HitsFetcher - -|Name|Schema| -|---|---| -|**include**
*optional*|< string > array| -|**size**
*optional*|integer (int32)| - - - -### Inspire - -|Name|Schema| -|---|---| -|**inspire_limitation_access**
*optional*|[InspireLimitationAccess](#inspirelimitationaccess)| -|**inspire_uri**
*optional*|[InspireURI](#inspireuri)| -|**inspire_use_conditions**
*optional*|string| -|**keywords**
*optional*|< [Keyword](#keyword) > array| -|**languages**
*optional*|< string > array| -|**lineage**
*optional*|string| -|**spatial_resolution**
*optional*|[InspireSpatialResolution](#inspirespatialresolution)| -|**topic_categories**
*optional*|< string > array| - - - -### InspireLimitationAccess - -|Name|Schema| -|---|---| -|**access_constraints**
*optional*|string| -|**classification**
*optional*|string| -|**other_constraints**
*optional*|string| - - - -### InspireSpatialResolution - -|Name|Schema| -|---|---| -|**unit_of_measure**
*optional*|string| -|**value**
*optional*|[Number](#number)| - - - -### InspireURI - -|Name|Schema| -|---|---| -|**code**
*optional*|string| -|**namespace**
*optional*|string| - - - -### Interval - -|Name|Schema| -|---|---| -|**unit**
*optional*|enum (year, quarter, month, week, day, hour, minute, second)| -|**value**
*optional*|[Number](#number)| - - - -### Keyword - -|Name|Schema| -|---|---| -|**date_of_publication**
*optional*|string| -|**value**
*optional*|string| -|**vocabulary**
*optional*|string| - - - -### LineString -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|< [LngLatAlt](#lnglatalt) > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### Link - -|Name|Schema| -|---|---| -|**body**
*optional*|object| -|**href**
*required*|string| -|**method**
*required*|string| - - - -### LngLatAlt - -|Name|Schema| -|---|---| -|**additionalElements**
*optional*|< number (double) > array| -|**altitude**
*optional*|number (double)| -|**latitude**
*optional*|number (double)| -|**longitude**
*optional*|number (double)| - - - -### MD - -|Name|Schema| -|---|---| -|**centroid**
*optional*|[GeoJsonObject](#geojsonobject)| -|**geometry**
*optional*|[GeoJsonObject](#geojsonobject)| -|**id**
*optional*|string| -|**returned_geometries**
*optional*|< [Geo](#geo) > array| -|**timestamp**
*optional*|integer (int64)| - - - -### Metric - -|Name|Schema| -|---|---| -|**collect_fct**
*optional*|enum (AVG, CARDINALITY, MAX, MIN, SUM, GEOCENTROID, GEOBBOX)| -|**collect_field**
*optional*|string| - - - -### MultiLineString -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|< < [LngLatAlt](#lnglatalt) > array > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### MultiPoint -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|< [LngLatAlt](#lnglatalt) > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### MultiPolygon -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|< < < [LngLatAlt](#lnglatalt) > array > array > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### Number -*Type* : object - - - -### OpenSearch - -|Name|Schema| -|---|---| -|**adult_content**
*optional*|string| -|**attribution**
*optional*|string| -|**contact**
*optional*|string| -|**description**
*optional*|string| -|**developer**
*optional*|string| -|**image_height**
*optional*|string| -|**image_type**
*optional*|string| -|**image_url**
*optional*|string| -|**image_width**
*optional*|string| -|**input_encoding**
*optional*|string| -|**language**
*optional*|string| -|**long_name**
*optional*|string| -|**output_encoding**
*optional*|string| -|**short_name**
*optional*|string| -|**syndication_right**
*optional*|string| -|**tags**
*optional*|string| - - - -### Page - -|Name|Schema| -|---|---| -|**after**
*optional*|string| -|**before**
*optional*|string| -|**from**
*optional*|integer (int32)| -|**size**
*optional*|integer (int32)| -|**sort**
*optional*|string| - - - -### Person - -|Name|Schema| -|---|---| -|**email**
*optional*|string| -|**name**
*optional*|string| -|**uri**
*optional*|string| - - - -### Point -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|[LngLatAlt](#lnglatalt)| -|**crs**
*optional*|[Crs](#crs)| - - - -### Polygon -*Polymorphism* : Inheritance -*Discriminator* : type - - -|Name|Schema| -|---|---| -|**bbox**
*optional*|< number (double) > array| -|**coordinates**
*optional*|< < [LngLatAlt](#lnglatalt) > array > array| -|**crs**
*optional*|[Crs](#crs)| - - - -### Projection - -|Name|Schema| -|---|---| -|**excludes**
*optional*|string| -|**includes**
*optional*|string| - - - -### RasterTileURL - -|Name|Schema| -|---|---| -|**check_geometry**
*optional*|boolean| -|**id_path**
*required*|string| -|**max_z**
*optional*|integer (int32)| -|**min_z**
*optional*|integer (int32)| -|**url**
*required*|string| - - - -### RawGeometry - -|Name|Schema| -|---|---| -|**geometry**
*optional*|string| -|**include**
*optional*|< string > array| -|**signedSort**
*optional*|string| -|**sort**
*optional*|string| - - - -### ReturnedGeometry - -|Name|Schema| -|---|---| -|**geometry**
*optional*|[GeoJsonObject](#geojsonobject)| -|**is_raw**
*optional*|boolean| -|**reference**
*optional*|string| -|**sort**
*optional*|string| - - - -### Search - -|Name|Schema| -|---|---| -|**filter**
*optional*|[Filter](#filter)| -|**form**
*optional*|[Form](#form)| -|**page**
*optional*|[Page](#page)| -|**projection**
*optional*|[Projection](#projection)| -|**returned_geometries**
*optional*|string| - - - -### Success - -|Name|Schema| -|---|---| -|**message**
*optional*|string| -|**status**
*optional*|integer (int32)| - - - diff --git a/docs/api/overview.md b/docs/api/overview.md deleted file mode 100644 index c3b744eb5..000000000 --- a/docs/api/overview.md +++ /dev/null @@ -1,35 +0,0 @@ -# ARLAS Exploration API - - - -## Overview -Explore the content of ARLAS collections - - -### Version information -*Version* : 23.0.1 - - -### Contact information -*Contact* : Gisaia -*Contact Email* : contact@gisaia.com - - -### License information -*License* : Apache 2.0 -*License URL* : https://www.apache.org/licenses/LICENSE-2.0.html -*Terms of service* : null - - -### URI scheme -*BasePath* : /arlas -*Schemes* : HTTP, HTTPS - - -### Tags - -* collections -* explore - - - diff --git a/docs/api/paths.md b/docs/api/paths.md deleted file mode 100644 index f4a2ae91b..000000000 --- a/docs/api/paths.md +++ /dev/null @@ -1,1296 +0,0 @@ - - -## Resources - - -### Collections - - -#### Get all collection references -``` -GET /collections -``` - - -##### Description -Get all collection references in ARLAS - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|< [CollectionReference](#collectionreference) > array| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Get all collection references as a json file -``` -GET /collections/_export -``` - - -##### Description -Get all collection references in ARLAS as json file - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|< [CollectionReference](#collectionreference) > array| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Add collection references from a json file -``` -POST /collections/_import -``` - - -##### Description -Add collection references in ARLAS from a json file - - -##### Parameters - -|Type|Name|Schema| -|---|---|---| -|**FormData**|**file**
*optional*|file| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|string| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `multipart/form-data` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Get a collection reference -``` -GET /collections/{collection} -``` - - -##### Description -Get a collection reference in ARLAS - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[CollectionReference](#collectionreference)| -|**404**|Collection not found.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Add a collection reference -``` -PUT /collections/{collection} -``` - - -##### Description -Add a collection reference in ARLAS - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**checkfields**
*optional*||boolean|`"true"`| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**collectionParams**
*required*|collectionParams|[CollectionReferenceParameters](#collectionreferenceparameters)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[CollectionReference](#collectionreference)| -|**400**|JSON parameter malformed.|[Error](#error)| -|**404**|Not Found Error.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Delete a collection reference -``` -DELETE /collections/{collection} -``` - - -##### Description -Delete a collection reference in ARLAS - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[Success](#success)| -|**404**|Collection not found.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -### Explore - - -#### List -``` -GET /explore/_list -``` - - -##### Description -List the collections configured in ARLAS. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|< [CollectionReferenceDescription](#collectionreferencedescription) > array| -|**400**|Bad request.|[Error](#error)| -|**403**|Collection not authorized.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Suggest -``` -GET /explore/{collections}/_suggest -``` - - -##### Description -Suggest the the n (n=size) most relevant terms given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collections**
*required*|collections, comma separated|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided. The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator \| Description \| value type

: \| {fieldName} equals {value} \| numeric or strings

:gte: \| {fieldName} is greater than or equal to {value} \| numeric

:gt: \| {fieldName} is greater than {value} \| numeric

:lte: \| {fieldName} is less than or equal to {value} \| numeric

:lt: \| {fieldName} is less than {value} \| numeric



- The AND operator is applied between filters having different fieldNames.

- The OR operator is applied on filters having the same fieldName.

- If the fieldName starts with - then a must not filter is used

- If the fieldName starts with - then a must not filter is used

For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md|< string > array(multi)|| -|**Query**|**field**
*optional*|Name of the field to be used for retrieving the most relevant terms|string|`"_all"`| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer (int32)|`0`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search|string|| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer (int32)|`10`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Aggregate -``` -POST /explore/{collection}/_aggregate -``` - - -##### Description -Aggregate the elements in the collection(s), given the filters and the aggregation parameters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[AggregationsRequest](#aggregationsrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[AggregationResponse](#aggregationresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Aggregate -``` -GET /explore/{collection}/_aggregate -``` - - -##### Description -Aggregate the elements in the collection(s), given the filters and the aggregation parameters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**agg**
*required*|- The agg parameter should be given in the following formats:

{type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:fetch_hits-{fetch_hits values}

Where :

- **{type}:{field}** part is mandatory.

- **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.

- **format** is optional for datehistogram, and must not be specified for the other types.

- (**collect_field**,**collect_fct**) couple is optional for all aggregation types.

- It's possible to apply multiple metric aggregations by defining multiple (**collect_field**,**collect_fct**) couples.

- (**collect_field**,**collect_fct**) couples should be unique in that case.

- (**order**,**on**) couple is optional for all aggregation types.

- **size** is optional for term and geohash/geotile, and must not be specified for the other types.

- **include** is optional for term, and must not be specified for the other types.

- {type} possible values are :

datehistogram, histogram, geohash, geotile and term.

- {interval} possible values depends on {type}.

If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities.

If {type} = histogram, then {interval} = {size}.

If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation.

If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6.

If {type} = term, then interval-{interval} is not needed.

- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.

- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}.

{collect_fct} possible values are :

avg,cardinality,max,min,sum

- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'.

- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'.

- If {on} is equal to `result` and two or more (**collect_field**,**collect_fct**) couples are specified, then the order is applied on the first `collect_fct` that is different from geobbox and geocentroid

- {size} Defines how many buckets should be returned.

- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.

- **aggregated_geometries**

> **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.

> __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.

> __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.

- **centroid**: returns the centroid of data inside the bucket.

- **bbox**: returns the data extent (bbox) in each bucket.

- **cell**: returns the cell extent (zxy or geohash) of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

- **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

> __**Response**__: the aggregated geometries are returned in `geometries` list in the json response. Each object inside this list has : the reference to the aggregated form, the geojson geometry and an attribute `is_raw` set to false

> __**Example**__: `aggregated_geometries-bbox,cell`

- **raw_geometries**

> **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort

> __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.

> __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.

- sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied

- a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending

> __**Response**__: the aggregated geometries are returned in `geometries` list in the json response. Each object inside this list has : the reference to the geometry path, the used sort, the geojson geometry and an attribute `is_raw` set to true

> __**Example**__: `raw_geometries-geo_field1,geo_field2 \|\| raw_geometries-geo_field(-field1,field2)` \|\| raw_geometries-geo_field1(field1);geo_field2(field2,field3)

- **fetch_hits**

> **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.

> __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.

> **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.

> **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.

> __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.

**agg** parameter is multiple. Every agg parameter specified is a subaggregation of the previous one : order matters.

For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md.|< string > array(multi)|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[AggregationResponse](#aggregationresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Compute -``` -POST /explore/{collection}/_compute -``` - - -##### Description -Computes the given metric on a field in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[ComputationRequest](#computationrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[ComputationResponse](#computationresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Compute -``` -GET /explore/{collection}/_compute -``` - - -##### Description -Computes the given metric on a field in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**field**
*required*|The field on which the metric is calculated.|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**metric**
*required*|The metric to compute : `max, min, avg, sum, cardinality, spanning, geobbox, geocentroid`.|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[ComputationResponse](#computationresponse)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Count -``` -POST /explore/{collection}/_count -``` - - -##### Description -Count the number of elements found in the collection(s), given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collections|string|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[Count](#count)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[Hits](#hits)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Count -``` -GET /explore/{collection}/_count -``` - - -##### Description -Count the number of elements found in the collection(s), given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collections|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[Hits](#hits)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Describe -``` -GET /explore/{collection}/_describe -``` - - -##### Description -Describe the structure and the content of the given collection. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[CollectionReferenceDescription](#collectionreferencedescription)| -|**400**|Bad request.|[Error](#error)| -|**403**|Collection not authorized.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoAggregate -``` -POST /explore/{collection}/_geoaggregate -``` - - -##### Description -Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[AggregationsRequest](#aggregationsrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoAggregate -``` -GET /explore/{collection}/_geoaggregate -``` - - -##### Description -Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**agg**
*required*|- The agg parameter should be given in the following formats:

{type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values}

Where :

- **{type}:{field}** part is mandatory.

- **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.

- **format** is optional for datehistogram, and must not be specified for the other types.

- (**collect_field**,**collect_fct**) couple is optional for all aggregation types.

- (**order**,**on**) couple is optional for all aggregation types.

- **size** is optional for term and geohash/geotile, and must not be specified for the other types.

- **include** is optional for term, and must not be specified for the other types.

- {type} possible values are :

geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation.

- {interval} possible values depends on {type}.

If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities.

If {type} = histogram, then {interval} = {size}.

If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation.

If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29).

If {type} = term, then interval-{interval} is not needed.

- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.

- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}.

{collect_fct} possible values are :

avg,cardinality,max,min,sum,geobbox,geocentroid

- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections.

- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'.

- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'.

- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited

- {size} Defines how many buckets should be returned.

- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.

- **aggregated_geometries**

> **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.

> __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.

> __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.

- **centroid**: returns the centroid of data inside the bucket.

- **bbox**: returns the data extent (bbox) in each bucket.

- **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

- **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

> __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which aggregated form is returned

- **geometry_type** attribute set to *aggregated*

> __**Example**__: `aggregated_geometries-bbox,geohash`

- **raw_geometries**

> **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort

> __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.

> __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.

- sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied

- a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending

> __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which geometry path is returned

- **geometry_type** attribute set to *raw*

- **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)

> __**Example**__: `raw_geometries-geo_field1,geo_field2 \|\| raw_geometries-geo_field(-field1,field2)` \|\| raw_geometries-geo_field1(field1);geo_field2(field2,field3)

- **fetch_hits**

> **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.

> __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.

> **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.

> **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.

> __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.

**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters.

For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md|< string > array(multi)|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoAggregate on a geohash -``` -GET /explore/{collection}/_geoaggregate/{geohash} -``` - - -##### Description -Aggregate the elements in the collection(s) and localized in the given geohash as features, given the filters and the aggregation parameters. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**geohash**
*required*|geohash|string|| -|**Query**|**agg**
*optional*|- The agg parameter should be given in the following formats:

{type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values}

Where :

- **{type}:{field}** part is mandatory.

- **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.

- **format** is optional for datehistogram, and must not be specified for the other types.

- (**collect_field**,**collect_fct**) couple is optional for all aggregation types.

- (**order**,**on**) couple is optional for all aggregation types.

- **size** is optional for term and geohash/geotile, and must not be specified for the other types.

- **include** is optional for term, and must not be specified for the other types.

- {type} possible values are :

geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation.

- {interval} possible values depends on {type}.

If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities.

If {type} = histogram, then {interval} = {size}.

If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation.

If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29).

If {type} = term, then interval-{interval} is not needed.

- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.

- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}.

{collect_fct} possible values are :

avg,cardinality,max,min,sum,geobbox,geocentroid

- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections.

- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'.

- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'.

- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited

- {size} Defines how many buckets should be returned.

- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.

- **aggregated_geometries**

> **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.

> __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.

> __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.

- **centroid**: returns the centroid of data inside the bucket.

- **bbox**: returns the data extent (bbox) in each bucket.

- **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

- **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

> __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which aggregated form is returned

- **geometry_type** attribute set to *aggregated*

> __**Example**__: `aggregated_geometries-bbox,geohash`

- **raw_geometries**

> **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort

> __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.

> __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.

- sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied

- a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending

> __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which geometry path is returned

- **geometry_type** attribute set to *raw*

- **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)

> __**Example**__: `raw_geometries-geo_field1,geo_field2 \|\| raw_geometries-geo_field(-field1,field2)` \|\| raw_geometries-geo_field1(field1);geo_field2(field2,field3)

- **fetch_hits**

> **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.

> __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.

> **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.

> **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.

> __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.

**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters.

For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md|< string > array(multi)|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoAggregate on a geotile -``` -GET /explore/{collection}/_geoaggregate/{z}/{x}/{y} -``` - - -##### Description -Aggregate the elements in the collection(s) and localized in the given tile as features, given the filters and the aggregation parameters. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**x**
*required*|x|integer (int32)|| -|**Path**|**y**
*required*|y|integer (int32)|| -|**Path**|**z**
*required*|z|integer (int32)|| -|**Query**|**agg**
*optional*|- The agg parameter should be given in the following formats:

{type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values}

Where :

- **{type}:{field}** part is mandatory.

- **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.

- **format** is optional for datehistogram, and must not be specified for the other types.

- (**collect_field**,**collect_fct**) couple is optional for all aggregation types.

- (**order**,**on**) couple is optional for all aggregation types.

- **size** is optional for term and geohash/geotile, and must not be specified for the other types.

- **include** is optional for term, and must not be specified for the other types.

- {type} possible values are :

geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation.

- {interval} possible values depends on {type}.

If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities.

If {type} = histogram, then {interval} = {size}.

If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation.

If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29).

If {type} = term, then interval-{interval} is not needed.

- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.

- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}.

{collect_fct} possible values are :

avg,cardinality,max,min,sum,geobbox,geocentroid

- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections.

- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'.

- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'.

- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited

- {size} Defines how many buckets should be returned.

- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.

- **aggregated_geometries**

> **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.

> __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.

> __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.

- **centroid**: returns the centroid of data inside the bucket.

- **bbox**: returns the data extent (bbox) in each bucket.

- **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

- **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

> __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which aggregated form is returned

- **geometry_type** attribute set to *aggregated*

> __**Example**__: `aggregated_geometries-bbox,geohash`

- **raw_geometries**

> **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort

> __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.

> __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.

- sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied

- a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending

> __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which geometry path is returned

- **geometry_type** attribute set to *raw*

- **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)

> __**Example**__: `raw_geometries-geo_field1,geo_field2 \|\| raw_geometries-geo_field(-field1,field2)` \|\| raw_geometries-geo_field1(field1);geo_field2(field2,field3)

- **fetch_hits**

> **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.

> __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.

> **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.

> **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.

> __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.

**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters.

For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md|< string > array(multi)|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoSearch -``` -POST /explore/{collection}/_geosearch -``` - - -##### Description -Search and return the elements found in the collection(s) as features, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[Search](#search)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### GeoSearch -``` -GET /explore/{collection}/_geosearch -``` - - -##### Description -Search and return the elements found in the collection(s) as features, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**after**
*optional*|List of values of fields present in sort param that are used to search after.

> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).

> __**Restriction 1**__: **after** param works only combined with **sort** param.

> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.

> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search

> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param

> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.

> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.

> __**Restriction 2**__: **from** param must be set to 0 or kept unset|string|| -|**Query**|**before**
*optional*|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**exclude**
*optional*|List the name patterns of the field to be excluded in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer|`0`| -|**Query**|**include**
*optional*|List the name patterns of the field to be included in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**returned_geometries**
*optional*|Comma separated geometry field_paths to be included in the result. If not specified, only geometry_path is returned. If geometry_path is null, then centroid_path is returned|string|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer|`10`| -|**Query**|**sort**
*optional*|Sorts the resulted hits on the given fields and/or by distance to a given point:

> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.

> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.

> **Note 2**: The order of fields matters.

> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.

> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.

> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)|< string > array(multi)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Tiled GeoSearch -``` -GET /explore/{collection}/_geosearch/{z}/{x}/{y} -``` - - -##### Description -Search and return the elements found in the collection(s) and localized in the given tile(x,y,z) as features, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**x**
*required*|x|integer (int32)|| -|**Path**|**y**
*required*|y|integer (int32)|| -|**Path**|**z**
*required*|z|integer (int32)|| -|**Query**|**after**
*optional*|List of values of fields present in sort param that are used to search after.

> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).

> __**Restriction 1**__: **after** param works only combined with **sort** param.

> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.

> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search

> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param

> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.

> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.

> __**Restriction 2**__: **from** param must be set to 0 or kept unset|string|| -|**Query**|**before**
*optional*|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**exclude**
*optional*|List the name patterns of the field to be excluded in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer|`0`| -|**Query**|**include**
*optional*|List the name patterns of the field to be included in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**returned_geometries**
*optional*|Comma separated geometry field_paths to be included in the result. If not specified, only geometry_path is returned. If geometry_path is null, then centroid_path is returned|string|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer|`10`| -|**Query**|**sort**
*optional*|Sorts the resulted hits on the given fields and/or by distance to a given point:

> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.

> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.

> **Note 2**: The order of fields matters.

> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.

> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.

> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)|< string > array(multi)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[FeatureCollection](#featurecollection)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Search -``` -POST /explore/{collection}/_search -``` - - -##### Description -Search and return the elements found in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[Search](#search)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[Hits](#hits)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - -#### Search -``` -GET /explore/{collection}/_search -``` - - -##### Description -Search and return the elements found in the collection, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**after**
*optional*|List of values of fields present in sort param that are used to search after.

> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).

> __**Restriction 1**__: **after** param works only combined with **sort** param.

> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.

> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search

> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param

> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.

> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.

> __**Restriction 2**__: **from** param must be set to 0 or kept unset|string|| -|**Query**|**before**
*optional*|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**exclude**
*optional*|List the name patterns of the field to be excluded in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer|`0`| -|**Query**|**include**
*optional*|List the name patterns of the field to be included in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**returned_geometries**
*optional*|Comma separated geometry field_paths to be included in the result. If not specified, only geometry_path is returned. If geometry_path is null, then centroid_path is returned|string|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer|`10`| -|**Query**|**sort**
*optional*|Sorts the resulted hits on the given fields and/or by distance to a given point:

> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.

> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.

> **Note 2**: The order of fields matters.

> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.

> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.

> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)|string|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[Hits](#hits)| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` -* `application/atom+xml` - - - -#### ShapeAggregate -``` -POST /explore/{collection}/_shapeaggregate -``` - - -##### Description -Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters, and returns a shapefile of it. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[AggregationsRequest](#aggregationsrequest)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/zip` - - - -#### ShapeAggregate -``` -GET /explore/{collection}/_shapeaggregate -``` - - -##### Description -Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters, and returns a shapefile of it. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**agg**
*required*|- The agg parameter should be given in the following formats:

{type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values}

Where :

- **{type}:{field}** part is mandatory.

- **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.

- **format** is optional for datehistogram, and must not be specified for the other types.

- (**collect_field**,**collect_fct**) couple is optional for all aggregation types.

- (**order**,**on**) couple is optional for all aggregation types.

- **size** is optional for term and geohash/geotile, and must not be specified for the other types.

- **include** is optional for term, and must not be specified for the other types.

- {type} possible values are :

geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation.

- {interval} possible values depends on {type}.

If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities.

If {type} = histogram, then {interval} = {size}.

If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation.

If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29).

If {type} = term, then interval-{interval} is not needed.

- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.

- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}.

{collect_fct} possible values are :

avg,cardinality,max,min,sum,geobbox,geocentroid

- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections.

- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'.

- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'.

- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited

- {size} Defines how many buckets should be returned.

- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.

- **aggregated_geometries**

> **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.

> __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.

> __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.

- **centroid**: returns the centroid of data inside the bucket.

- **bbox**: returns the data extent (bbox) in each bucket.

- **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

- **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.

> __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which aggregated form is returned

- **geometry_type** attribute set to *aggregated*

> __**Example**__: `aggregated_geometries-bbox,geohash`

- **raw_geometries**

> **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort

> __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.

> __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.

- sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied

- a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending

> __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :

- **geometry_ref** attribute that informs which geometry path is returned

- **geometry_type** attribute set to *raw*

- **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)

> __**Example**__: `raw_geometries-geo_field1,geo_field2 \|\| raw_geometries-geo_field(-field1,field2)` \|\| raw_geometries-geo_field1(field1);geo_field2(field2,field3)

- **fetch_hits**

> **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.

> __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.

> **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.

> **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.

> __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.

**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters.

For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md|< string > array(multi)|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| -|**501**|Not implemented functionality.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/zip` - - - -#### ShapeSearch -``` -POST /explore/{collection}/_shapesearch -``` - - -##### Description -Search and return the elements found in the collection(s) as features, given the filters, exported as a Shapefile - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Body**|**body**
*optional*||[Search](#search)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/zip` - - - -#### ShapeSearch -``` -GET /explore/{collection}/_shapesearch -``` - - -##### Description -Search and return the elements found in the collection(s) as features, given the filters, exported as a Shapefile - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Query**|**after**
*optional*|List of values of fields present in sort param that are used to search after.

> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).

> __**Restriction 1**__: **after** param works only combined with **sort** param.

> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.

> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search

> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param

> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.

> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.

> __**Restriction 2**__: **from** param must be set to 0 or kept unset|string|| -|**Query**|**before**
*optional*|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).|string|| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**exclude**
*optional*|List the name patterns of the field to be excluded in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer|`0`| -|**Query**|**include**
*optional*|List the name patterns of the field to be included in the result. Separate patterns with a comma.|< string > array(multi)|| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**returned_geometries**
*optional*|Comma separated geometry field_paths to be included in the result. If not specified, only geometry_path is returned. If geometry_path is null, then centroid_path is returned|string|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|`"true"`| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer|`10`| -|**Query**|**sort**
*optional*|Sorts the resulted hits on the given fields and/or by distance to a given point:

> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.

> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.

> **Note 2**: The order of fields matters.

> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.

> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.

> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)|< string > array(multi)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/zip` - - - -#### Tiled GeoSearch -``` -GET /explore/{collection}/_tile/{z}/{x}/{y}.png -``` - - -##### Description -Search and return the elements found in the collection(s) and localized in the given tile(x,y,z) as features, given the filters - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**x**
*required*|x|integer (int32)|| -|**Path**|**y**
*required*|y|integer (int32)|| -|**Path**|**z**
*required*|z|integer (int32)|| -|**Query**|**after**
*optional*|List of values of fields present in sort param that are used to search after.

> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).

> __**Restriction 1**__: **after** param works only combined with **sort** param.

> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.

> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search

> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param

> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.

> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.

> __**Restriction 2**__: **from** param must be set to 0 or kept unset|string|| -|**Query**|**before**
*optional*|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).|string|| -|**Query**|**coverage**
*optional*|Percentage (]0-100]) of acceptable transparent pixels. Higher the percentage, more tiles could be used for filling the tile|integer (int32)|`70`| -|**Query**|**dateformat**
*optional*|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations|string|| -|**Query**|**f**
*optional*|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter.

- A triplet is composed of a field name, a comparison operator and a value.

The possible values of the comparison operator are :

Operator -- Description -- value type

:eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings

:ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings

:like: -- {fieldName} is like {value} -- numeric or strings

:gte: -- {fieldName} is greater than or equal to {value} -- numeric

:gt: -- {fieldName} is greater than {value} -- numeric

:lte: -- {fieldName} is less than or equal to {value} -- numeric

:lt: -- {fieldName} is less than {value} -- numeric

:range: -- {fieldName} is between `{comma separated [min
:within: -- {GeofieldName}` is within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:notwithin: -- {GeofieldName} is not within the `{given WKT string or the given BBOX }` -- a WKT string or the BBOX string : `"west, south, east, north"`

:intersects: -- {GeofieldName} intersects the `{given WKT string or the given BBOX }` \| a WKT string or the BBOX string : `"west, south, east, north"`

:notintersects: -- {GeofieldName} does not intersect the `{given WKT string or the given }` -- a WKT string or the BBOX string : `"west, south, east, north"`|< string > array(multi)|| -|**Query**|**from**
*optional*|From index to start the search from. Defaults to 0.|integer|`0`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**q**
*optional*|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}|< string > array(multi)|| -|**Query**|**righthand**
*optional*|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.
Inversely, If righthand = false, the passed WKT should be clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet.|boolean|| -|**Query**|**sampling**
*optional*|Size of the sampling for testing transparency: 1: test every pixel, 10: test 1 pixel every 10 pixels, etc.|integer (int32)|`10`| -|**Query**|**size**
*optional*|The maximum number of entries or sub-entries to be returned. The default value is 10|integer|`10`| -|**Query**|**sort**
*optional*|Sorts the resulted hits on the given fields and/or by distance to a given point:

> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.

> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.

> **Note 2**: The order of fields matters.

> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.

> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.

> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)|< string > array(multi)|| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|No Content| -|**400**|Bad request.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `image/png` - - - -#### Get an Arlas document -``` -GET /explore/{collection}/{identifier} -``` - - -##### Description -Returns a raw indexed document. - - -##### Parameters - -|Type|Name|Description|Schema|Default| -|---|---|---|---|---| -|**Path**|**collection**
*required*|collection|string|| -|**Path**|**identifier**
*required*|identifier|string|| -|**Query**|**flat**
*optional*|Flats the property map: only key/value on one level|boolean|`"false"`| -|**Query**|**max-age-cache**
*optional*|max-age-cache|integer (int32)|| -|**Query**|**pretty**
*optional*|Pretty print|boolean|`"false"`| - - -##### Responses - -|HTTP Code|Description|Schema| -|---|---|---| -|**200**|Successful operation|[ArlasHit](#arlashit)| -|**400**|Bad request.|[Error](#error)| -|**404**|Not Found Error.|[Error](#error)| -|**500**|Arlas Server Error.|[Error](#error)| - - -##### Consumes - -* `application/json;charset=utf-8` - - -##### Produces - -* `application/json;charset=utf-8` - - - diff --git a/docs/api/reference.md b/docs/api/reference.md new file mode 100644 index 000000000..f55850c3c --- /dev/null +++ b/docs/api/reference.md @@ -0,0 +1,6966 @@ + + +

ARLAS Server APIs vAPI_VERSION

+ +> Scroll down for example requests and responses. + +Explore the content of ARLAS collections + +Base URLs: + +* /arlas + +Email: Gisaia Web: Gisaia +License: Apache 2.0 + +

collections

+ +Collections API + +## Get a collection reference + + + +`GET /collections/{collection}` + +Get a collection reference in ARLAS + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +{ + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[CollectionReference](#schemacollectionreference)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Collection not found.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Add a collection reference + + + +`PUT /collections/{collection}` + +Add a collection reference in ARLAS + +> Body parameter + +```json +{ + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|checkfields|query|boolean|false|none| +|body|body|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|collectionParams| + +> Example responses + +> 200 Response + +```json +{ + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[CollectionReference](#schemacollectionreference)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|JSON parameter malformed.|[Error](#schemaerror)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found Error.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Delete a collection reference + + + +`DELETE /collections/{collection}` + +Delete a collection reference in ARLAS + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +{ + "status": 0, + "message": "string" +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[Success](#schemasuccess)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Collection not found.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Get all collection references as a json file + + + +`GET /collections/_export` + +Get all collection references in ARLAS as json file + +> Example responses + +> 200 Response + +```json +[ + { + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } + } +] +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|Inline| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[CollectionReference](#schemacollectionreference)]|false|none|none| +|» collection_name|string|true|none|none| +|» params|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|none|none| +|»» index_name|string|true|none|none| +|»» id_path|string|true|none|none| +|»» geometry_path|string|true|none|none| +|»» centroid_path|string|true|none|none| +|»» timestamp_path|string|true|none|none| +|»» exclude_fields|string|false|none|none| +|»» update_max_hits|integer(int32)|false|none|none| +|»» taggable_fields|string|false|none|none| +|»» exclude_wfs_fields|string|false|none|none| +|»» custom_params|object|false|none|none| +|»»» **additionalProperties**|string|false|none|none| +|»» display_names|[CollectionDisplayNames](#schemacollectiondisplaynames)|false|none|none| +|»»» collection|string|false|none|none| +|»»» fields|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»»» shape_columns|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»» organisations|[CollectionOrganisations](#schemacollectionorganisations)|false|none|none| +|»»» owner|string|false|none|none| +|»»» shared|[string]|false|none|none| +|»»» public|boolean|false|none|none| +|»» atom_feed|[Feed](#schemafeed)|false|none|none| +|»»» author|[Person](#schemaperson)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» email|string|false|none|none| +|»»»» uri|string|false|none|none| +|»»» contributor|[Person](#schemaperson)|false|none|none| +|»»» icon|string|false|none|none| +|»»» logo|string|false|none|none| +|»»» rights|string|false|none|none| +|»»» subtitle|string|false|none|none| +|»»» generator|[Generator](#schemagenerator)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» version|string|false|none|none| +|»»»» uri|string|false|none|none| +|»» open_search|[OpenSearch](#schemaopensearch)|false|none|none| +|»»» short_name|string|false|none|none| +|»»» description|string|false|none|none| +|»»» contact|string|false|none|none| +|»»» tags|string|false|none|none| +|»»» long_name|string|false|none|none| +|»»» image_height|string|false|none|none| +|»»» image_width|string|false|none|none| +|»»» image_type|string|false|none|none| +|»»» image_url|string|false|none|none| +|»»» developer|string|false|none|none| +|»»» attribution|string|false|none|none| +|»»» syndication_right|string|false|none|none| +|»»» adult_content|string|false|none|none| +|»»» language|string|false|none|none| +|»»» input_encoding|string|false|none|none| +|»»» output_encoding|string|false|none|none| +|»» inspire|[Inspire](#schemainspire)|false|none|none| +|»»» keywords|[[Keyword](#schemakeyword)]|false|none|none| +|»»»» value|string|false|none|none| +|»»»» vocabulary|string|false|none|none| +|»»»» date_of_publication|string|false|none|none| +|»»» topic_categories|[string]|false|none|none| +|»»» lineage|string|false|none|none| +|»»» languages|[string]|false|none|none| +|»»» spatial_resolution|[InspireSpatialResolution](#schemainspirespatialresolution)|false|none|none| +|»»»» value|number|false|none|none| +|»»»» unit_of_measure|string|false|none|none| +|»»» inspire_uri|[InspireURI](#schemainspireuri)|false|none|none| +|»»»» code|string|false|none|none| +|»»»» namespace|string|false|none|none| +|»»» inspire_limitation_access|[InspireLimitationAccess](#schemainspirelimitationaccess)|false|none|none| +|»»»» access_constraints|string|false|none|none| +|»»»» other_constraints|string|false|none|none| +|»»»» classification|string|false|none|none| +|»»» inspire_use_conditions|string|false|none|none| +|»» dublin_core_element_name|[DublinCoreElementName](#schemadublincoreelementname)|false|none|none| +|»»» title|string|false|none|none| +|»»» creator|string|false|none|none| +|»»» subject|string|false|none|none| +|»»» description|string|false|none|none| +|»»» publisher|string|false|none|none| +|»»» contributor|string|false|none|none| +|»»» type|string|false|none|none| +|»»» format|string|false|none|none| +|»»» identifier|string|false|none|none| +|»»» source|string|false|none|none| +|»»» language|string|false|none|none| +|»»» bbox|[Bbox](#schemabbox)|false|none|none| +|»»»» north|number(double)|true|none|none| +|»»»» south|number(double)|true|none|none| +|»»»» east|number(double)|true|none|none| +|»»»» west|number(double)|true|none|none| +|»»» date|string|false|none|none| +|»»» coverage|object|false|none|none| +|»»» coverage_centroid|string|false|none|none| +|»» raster_tile_url|[RasterTileURL](#schemarastertileurl)|false|none|none| +|»»» url|string|true|none|none| +|»»» id_path|string|true|none|none| +|»»» min_z|integer(int32)|false|none|none| +|»»» max_z|integer(int32)|false|none|none| +|»»» check_geometry|boolean|false|none|none| +|»» raster_tile_width|integer(int32)|false|none|none| +|»» raster_tile_height|integer(int32)|false|none|none| +|»» filter|[Filter](#schemafilter)|false|none|none| +|»»» f|[array]|false|none|none| +|»»»» field|string|false|none|none| +|»»»» op|string|false|none|none| +|»»»» value|string|false|none|none| +|»»»» empty|boolean|false|none|none| +|» q|[array]|false|none|none| +|»» empty|boolean|false|none|none| +|» dateformat|string|false|none|none| +|» righthand|boolean|false|none|none| +|license_name|string|false|none|none| +|license_urls|[string]|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| + + + +## Get all collection references + + + +`GET /collections` + +Get all collection references in ARLAS + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|pretty|query|boolean|false|Pretty print| + +> Example responses + +> 200 Response + +```json +[ + { + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } + } +] +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|Inline| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[CollectionReference](#schemacollectionreference)]|false|none|none| +|» collection_name|string|true|none|none| +|» params|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|none|none| +|»» index_name|string|true|none|none| +|»» id_path|string|true|none|none| +|»» geometry_path|string|true|none|none| +|»» centroid_path|string|true|none|none| +|»» timestamp_path|string|true|none|none| +|»» exclude_fields|string|false|none|none| +|»» update_max_hits|integer(int32)|false|none|none| +|»» taggable_fields|string|false|none|none| +|»» exclude_wfs_fields|string|false|none|none| +|»» custom_params|object|false|none|none| +|»»» **additionalProperties**|string|false|none|none| +|»» display_names|[CollectionDisplayNames](#schemacollectiondisplaynames)|false|none|none| +|»»» collection|string|false|none|none| +|»»» fields|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»»» shape_columns|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»» organisations|[CollectionOrganisations](#schemacollectionorganisations)|false|none|none| +|»»» owner|string|false|none|none| +|»»» shared|[string]|false|none|none| +|»»» public|boolean|false|none|none| +|»» atom_feed|[Feed](#schemafeed)|false|none|none| +|»»» author|[Person](#schemaperson)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» email|string|false|none|none| +|»»»» uri|string|false|none|none| +|»»» contributor|[Person](#schemaperson)|false|none|none| +|»»» icon|string|false|none|none| +|»»» logo|string|false|none|none| +|»»» rights|string|false|none|none| +|»»» subtitle|string|false|none|none| +|»»» generator|[Generator](#schemagenerator)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» version|string|false|none|none| +|»»»» uri|string|false|none|none| +|»» open_search|[OpenSearch](#schemaopensearch)|false|none|none| +|»»» short_name|string|false|none|none| +|»»» description|string|false|none|none| +|»»» contact|string|false|none|none| +|»»» tags|string|false|none|none| +|»»» long_name|string|false|none|none| +|»»» image_height|string|false|none|none| +|»»» image_width|string|false|none|none| +|»»» image_type|string|false|none|none| +|»»» image_url|string|false|none|none| +|»»» developer|string|false|none|none| +|»»» attribution|string|false|none|none| +|»»» syndication_right|string|false|none|none| +|»»» adult_content|string|false|none|none| +|»»» language|string|false|none|none| +|»»» input_encoding|string|false|none|none| +|»»» output_encoding|string|false|none|none| +|»» inspire|[Inspire](#schemainspire)|false|none|none| +|»»» keywords|[[Keyword](#schemakeyword)]|false|none|none| +|»»»» value|string|false|none|none| +|»»»» vocabulary|string|false|none|none| +|»»»» date_of_publication|string|false|none|none| +|»»» topic_categories|[string]|false|none|none| +|»»» lineage|string|false|none|none| +|»»» languages|[string]|false|none|none| +|»»» spatial_resolution|[InspireSpatialResolution](#schemainspirespatialresolution)|false|none|none| +|»»»» value|number|false|none|none| +|»»»» unit_of_measure|string|false|none|none| +|»»» inspire_uri|[InspireURI](#schemainspireuri)|false|none|none| +|»»»» code|string|false|none|none| +|»»»» namespace|string|false|none|none| +|»»» inspire_limitation_access|[InspireLimitationAccess](#schemainspirelimitationaccess)|false|none|none| +|»»»» access_constraints|string|false|none|none| +|»»»» other_constraints|string|false|none|none| +|»»»» classification|string|false|none|none| +|»»» inspire_use_conditions|string|false|none|none| +|»» dublin_core_element_name|[DublinCoreElementName](#schemadublincoreelementname)|false|none|none| +|»»» title|string|false|none|none| +|»»» creator|string|false|none|none| +|»»» subject|string|false|none|none| +|»»» description|string|false|none|none| +|»»» publisher|string|false|none|none| +|»»» contributor|string|false|none|none| +|»»» type|string|false|none|none| +|»»» format|string|false|none|none| +|»»» identifier|string|false|none|none| +|»»» source|string|false|none|none| +|»»» language|string|false|none|none| +|»»» bbox|[Bbox](#schemabbox)|false|none|none| +|»»»» north|number(double)|true|none|none| +|»»»» south|number(double)|true|none|none| +|»»»» east|number(double)|true|none|none| +|»»»» west|number(double)|true|none|none| +|»»» date|string|false|none|none| +|»»» coverage|object|false|none|none| +|»»» coverage_centroid|string|false|none|none| +|»» raster_tile_url|[RasterTileURL](#schemarastertileurl)|false|none|none| +|»»» url|string|true|none|none| +|»»» id_path|string|true|none|none| +|»»» min_z|integer(int32)|false|none|none| +|»»» max_z|integer(int32)|false|none|none| +|»»» check_geometry|boolean|false|none|none| +|»» raster_tile_width|integer(int32)|false|none|none| +|»» raster_tile_height|integer(int32)|false|none|none| +|»» filter|[Filter](#schemafilter)|false|none|none| +|»»» f|[array]|false|none|none| +|»»»» field|string|false|none|none| +|»»»» op|string|false|none|none| +|»»»» value|string|false|none|none| +|»»»» empty|boolean|false|none|none| +|» q|[array]|false|none|none| +|»» empty|boolean|false|none|none| +|» dateformat|string|false|none|none| +|» righthand|boolean|false|none|none| +|license_name|string|false|none|none| +|license_urls|[string]|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| + + + +## Add collection references from a json file + + + +`POST /collections/_import` + +Add collection references in ARLAS from a json file + +> Body parameter + +```yaml +file: + type: string + parameters: + property1: string + property2: string + fileName: string + creationDate: 2019-08-24T14:15:22Z + modificationDate: 2019-08-24T14:15:22Z + readDate: 2019-08-24T14:15:22Z + size: 0 + name: string + +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|body|body|object|false|none| +|» file|body|[FormDataContentDisposition](#schemaformdatacontentdisposition)|false|none| +|»» type|body|string|false|none| +|»» parameters|body|object|false|none| +|»»» **additionalProperties**|body|string|false|none| +|»» fileName|body|string|false|none| +|»» creationDate|body|string(date-time)|false|none| +|»» modificationDate|body|string(date-time)|false|none| +|»» readDate|body|string(date-time)|false|none| +|»» size|body|integer(int64)|false|none| +|»» name|body|string|false|none| + +> Example responses + +> 200 Response + +```json +"string" +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|string| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Update a collection reference's organisations attribute. + + + +`PATCH /collections/{collection}/organisations` + +Update a collection reference's organisations attribute. + +> Body parameter + +```json +{ + "organisations": { + "public": true, + "shared": [ + "string" + ] + } +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|body|body|[CollectionReferenceUpdate](#schemacollectionreferenceupdate)|true|collectionParamsUpdate| + +> Example responses + +> 200 Response + +```json +{ + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[CollectionReference](#schemacollectionreference)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|JSON parameter malformed.|[Error](#schemaerror)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Collection not found.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +

explore

+ +Explore API + +## Aggregate + + + +`POST /explore/{collection}/_aggregate` + +Aggregate the elements in the collection(s), given the filters and the aggregation parameters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "aggregations": [ + { + "type": "datehistogram", + "field": "string", + "interval": { + "value": 0, + "unit": "year" + }, + "format": "string", + "metrics": [ + { + "collect_field": "string", + "collect_fct": "AVG" + } + ], + "order": "asc", + "on": "field", + "size": "string", + "include": "string", + "raw_geometries": [ + { + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] + } + ], + "aggregated_geometries": [ + "BBOX" + ], + "fetch_hits": { + "size": 0, + "include": [ + "string" + ] + } + } + ] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[AggregationsRequest](#schemaaggregationsrequest)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "name": "string", + "count": 0, + "sumotherdoccounts": 0, + "key": {}, + "key_as_string": {}, + "elements": [ + { + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "name": "string", + "count": 0, + "sumotherdoccounts": 0, + "key": {}, + "key_as_string": {}, + "elements": [], + "metrics": [ + { + "type": "string", + "field": "string", + "value": {} + } + ], + "hits": [ + {} + ], + "geometries": [ + { + "reference": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "sort": "string", + "is_raw": true + } + ], + "flattened_elements": { + "property1": {}, + "property2": {} + } + } + ], + "metrics": [ + { + "type": "string", + "field": "string", + "value": {} + } + ], + "hits": [ + {} + ], + "geometries": [ + { + "reference": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "sort": "string", + "is_raw": true + } + ], + "flattened_elements": { + "property1": {}, + "property2": {} + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[AggregationResponse](#schemaaggregationresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## GeoAggregate + + + +`POST /explore/{collection}/_geoaggregate` + +Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters. + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "aggregations": [ + { + "type": "datehistogram", + "field": "string", + "interval": { + "value": 0, + "unit": "year" + }, + "format": "string", + "metrics": [ + { + "collect_field": "string", + "collect_fct": "AVG" + } + ], + "order": "asc", + "on": "field", + "size": "string", + "include": "string", + "raw_geometries": [ + { + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] + } + ], + "aggregated_geometries": [ + "BBOX" + ], + "fetch_hits": { + "size": 0, + "include": [ + "string" + ] + } + } + ] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[AggregationsRequest](#schemaaggregationsrequest)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "features": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" + } + ] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[FeatureCollection](#schemafeaturecollection)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| +|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not implemented functionality.|[Error](#schemaerror)| + + + +## GeoAggregate on a geohash + + + +`GET /explore/{collection}/_geoaggregate/{geohash}` + +Aggregate the elements in the collection(s) and localized in the given geohash as features, given the filters and the aggregation parameters. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|geohash|path|string|true|geohash| +|agg|query|array[string]|false|- The agg parameter should be given in the following formats: | +|f|query|array[string]|false|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. | +|q|query|array[string]|false|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}| +|dateformat|query|string|false|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations| +|righthand|query|boolean|false|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet. | +|pretty|query|boolean|false|Pretty print| +|flat|query|boolean|false|Flats the property map: only key/value on one level| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +#### Detailed descriptions + +**agg**: - The agg parameter should be given in the following formats: + + {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values} + +Where : + + - **{type}:{field}** part is mandatory. + + - **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash. + + - **format** is optional for datehistogram, and must not be specified for the other types. + + - (**collect_field**,**collect_fct**) couple is optional for all aggregation types. + + - (**order**,**on**) couple is optional for all aggregation types. + + - **size** is optional for term and geohash/geotile, and must not be specified for the other types. + + - **include** is optional for term, and must not be specified for the other types. + +- {type} possible values are : + + geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation. + +- {interval} possible values depends on {type}. + + If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities. + + If {type} = histogram, then {interval} = {size}. + + If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation. + + If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29). + + If {type} = term, then interval-{interval} is not needed. + +- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss. + +- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}. + + {collect_fct} possible values are : + + avg,cardinality,max,min,sum,geobbox,geocentroid + +- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections. + +- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'. + +- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'. + +- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited + +- {size} Defines how many buckets should be returned. + +- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created. + +- **aggregated_geometries** + + > **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket. + + > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`. + + > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`. + + - **centroid**: returns the centroid of data inside the bucket. + + - **bbox**: returns the data extent (bbox) in each bucket. + + - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. + + - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. + + > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has : + + - **geometry_ref** attribute that informs which aggregated form is returned + + - **geometry_type** attribute set to *aggregated* + + > __**Example**__: `aggregated_geometries-bbox,geohash` + +- **raw_geometries** + + > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort + + > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`. + + > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**. + + - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied + + - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending + + > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has : + + - **geometry_ref** attribute that informs which geometry path is returned + + - **geometry_type** attribute set to *raw* + + - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort) + + > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3) + +- **fetch_hits** + + > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits. + + > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`. + + > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default. + + > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters. + + > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket. + +**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. + +For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md + +**f**: - A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. + +- A triplet is composed of a field name, a comparison operator and a value. + + The possible values of the comparison operator are : + + Operator -- Description -- value type + + :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings + + :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings + + :like: -- {fieldName} is like {value} -- numeric or strings + + :gte: -- {fieldName} is greater than or equal to {value} -- numeric + + :gt: -- {fieldName} is greater than {value} -- numeric + + :lte: -- {fieldName} is less than or equal to {value} -- numeric + + :lt: -- {fieldName} is less than {value} -- numeric + + :range: -- {fieldName} is between `{comma separated [min Example responses + +> 200 Response + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "features": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" + } + ] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[FeatureCollection](#schemafeaturecollection)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| +|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not implemented functionality.|[Error](#schemaerror)| + + + +## GeoAggregate on a geotile + + + +`GET /explore/{collection}/_geoaggregate/{z}/{x}/{y}` + +Aggregate the elements in the collection(s) and localized in the given tile as features, given the filters and the aggregation parameters. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|z|path|integer(int32)|true|z| +|x|path|integer(int32)|true|x| +|y|path|integer(int32)|true|y| +|agg|query|array[string]|false|- The agg parameter should be given in the following formats: | +|f|query|array[string]|false|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. | +|q|query|array[string]|false|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}| +|dateformat|query|string|false|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations| +|righthand|query|boolean|false|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet. | +|pretty|query|boolean|false|Pretty print| +|flat|query|boolean|false|Flats the property map: only key/value on one level| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +#### Detailed descriptions + +**agg**: - The agg parameter should be given in the following formats: + + {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits values} + +Where : + + - **{type}:{field}** part is mandatory. + + - **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash. + + - **format** is optional for datehistogram, and must not be specified for the other types. + + - (**collect_field**,**collect_fct**) couple is optional for all aggregation types. + + - (**order**,**on**) couple is optional for all aggregation types. + + - **size** is optional for term and geohash/geotile, and must not be specified for the other types. + + - **include** is optional for term, and must not be specified for the other types. + +- {type} possible values are : + + geohash, geotile, datehistogram, histogram and term. geohash or geotile must be the main aggregation. + +- {interval} possible values depends on {type}. + + If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities. + + If {type} = histogram, then {interval} = {size}. + + If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation. + + If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6 (max 29). + + If {type} = term, then interval-{interval} is not needed. + +- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss. + +- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}. + + {collect_fct} possible values are : + + avg,cardinality,max,min,sum,geobbox,geocentroid + +- (collect_field,collect_fct) should both be specified, except when collect_fct = `geobbox` or `geocentroid`, it could be specified alone. The metrics `geobbox` and `geocentroid` are returned as features collections. + +- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'. + +- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'. + +- When {on} = `result`, then (collect_field,collect_fct) should be specified. Except when {collect_fct} = `geobbox` or `geocentroid`, then {on}=`result` is prohibited + +- {size} Defines how many buckets should be returned. + +- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created. + +- **aggregated_geometries** + + > **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket. + + > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`. + + > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`. + + - **centroid**: returns the centroid of data inside the bucket. + + - **bbox**: returns the data extent (bbox) in each bucket. + + - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. + + - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only. + + > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has : + + - **geometry_ref** attribute that informs which aggregated form is returned + + - **geometry_type** attribute set to *aggregated* + + > __**Example**__: `aggregated_geometries-bbox,geohash` + +- **raw_geometries** + + > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort + + > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`. + + > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**. + + - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied + + - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending + + > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has : + + - **geometry_ref** attribute that informs which geometry path is returned + + - **geometry_type** attribute set to *raw* + + - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort) + + > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3) + +- **fetch_hits** + + > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits. + + > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`. + + > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default. + + > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters. + + > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket. + +**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. + +For more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md + +**f**: - A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. + +- A triplet is composed of a field name, a comparison operator and a value. + + The possible values of the comparison operator are : + + Operator -- Description -- value type + + :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings + + :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings + + :like: -- {fieldName} is like {value} -- numeric or strings + + :gte: -- {fieldName} is greater than or equal to {value} -- numeric + + :gt: -- {fieldName} is greater than {value} -- numeric + + :lte: -- {fieldName} is less than or equal to {value} -- numeric + + :lt: -- {fieldName} is less than {value} -- numeric + + :range: -- {fieldName} is between `{comma separated [min Example responses + +> 200 Response + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "features": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" + } + ] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[FeatureCollection](#schemafeaturecollection)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| +|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not implemented functionality.|[Error](#schemaerror)| + + + +## ShapeAggregate + + + +`POST /explore/{collection}/_shapeaggregate` + +Aggregate the elements in the collection(s) as features, given the filters and the aggregation parameters, and returns a shapefile of it. + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "aggregations": [ + { + "type": "datehistogram", + "field": "string", + "interval": { + "value": 0, + "unit": "year" + }, + "format": "string", + "metrics": [ + { + "collect_field": "string", + "collect_fct": "AVG" + } + ], + "order": "asc", + "on": "field", + "size": "string", + "include": "string", + "raw_geometries": [ + { + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] + } + ], + "aggregated_geometries": [ + "BBOX" + ], + "fetch_hits": { + "size": 0, + "include": [ + "string" + ] + } + } + ] +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[AggregationsRequest](#schemaaggregationsrequest)|false|none| + +> Example responses + +> 400 Response + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|None| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| +|501|[Not Implemented](https://tools.ietf.org/html/rfc7231#section-6.6.2)|Not implemented functionality.|[Error](#schemaerror)| + + + +## Compute + + + +`POST /explore/{collection}/_compute` + +Computes the given metric on a field in the collection, given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "field": "string", + "metric": "AVG" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[ComputationRequest](#schemacomputationrequest)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "field": "string", + "metric": "AVG", + "value": 0.1, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[ComputationResponse](#schemacomputationresponse)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Count + + + +`POST /explore/{collection}/_count` + +Count the number of elements found in the collection(s), given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + } +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collections| +|pretty|query|boolean|false|Pretty print| +|body|body|[Count](#schemacount)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "collection": "string", + "hits": [ + { + "md": { + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] + }, + "data": {} + } + ], + "nbhits": 0, + "totalnb": 0, + "links": { + "property1": { + "href": "string", + "method": "string", + "body": {} + }, + "property2": { + "href": "string", + "method": "string", + "body": {} + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[Hits](#schemahits)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Describe + + + +`GET /explore/{collection}/_describe` + +Describe the structure and the content of the given collection. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +> Example responses + +> 200 Response + +```json +{ + "properties": { + "property1": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + }, + "property2": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + } + }, + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[CollectionReferenceDescription](#schemacollectionreferencedescription)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Collection not authorized.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## List + + + +`GET /explore/_list` + +List the collections configured in ARLAS. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +> Example responses + +> 200 Response + +```json +[ + { + "properties": { + "property1": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + }, + "property2": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + } + }, + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } + } +] +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|Inline| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|403|[Forbidden](https://tools.ietf.org/html/rfc7231#section-6.5.3)|Collection not authorized.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + +

Response Schema

+ +Status Code **200** + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[CollectionReferenceDescription](#schemacollectionreferencedescription)]|false|none|none| +|» properties|object|false|none|none| +|»» **additionalProperties**|[CollectionReferenceDescriptionProperty](#schemacollectionreferencedescriptionproperty)|false|none|none| +|»»» type|string|false|none|none| +|»»» format|string|false|none|none| +|»»» hash_field|string|false|none|none| +|»»» properties|[CollectionReferenceDescriptionProperty](#schemacollectionreferencedescriptionproperty)|false|none|none| +|»»»» **additionalProperties**|[CollectionReferenceDescriptionProperty](#schemacollectionreferencedescriptionproperty)|false|none|none| +|»»» taggable|boolean|false|none|none| +|»»» indexed|boolean|false|none|none| +|» collection_name|string|true|none|none| +|» params|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|none|none| +|»» index_name|string|true|none|none| +|»» id_path|string|true|none|none| +|»» geometry_path|string|true|none|none| +|»» centroid_path|string|true|none|none| +|»» timestamp_path|string|true|none|none| +|»» exclude_fields|string|false|none|none| +|»» update_max_hits|integer(int32)|false|none|none| +|»» taggable_fields|string|false|none|none| +|»» exclude_wfs_fields|string|false|none|none| +|»» custom_params|object|false|none|none| +|»»» **additionalProperties**|string|false|none|none| +|»» display_names|[CollectionDisplayNames](#schemacollectiondisplaynames)|false|none|none| +|»»» collection|string|false|none|none| +|»»» fields|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»»» shape_columns|object|false|none|none| +|»»»» **additionalProperties**|string|false|none|none| +|»» organisations|[CollectionOrganisations](#schemacollectionorganisations)|false|none|none| +|»»» owner|string|false|none|none| +|»»» shared|[string]|false|none|none| +|»»» public|boolean|false|none|none| +|»» atom_feed|[Feed](#schemafeed)|false|none|none| +|»»» author|[Person](#schemaperson)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» email|string|false|none|none| +|»»»» uri|string|false|none|none| +|»»» contributor|[Person](#schemaperson)|false|none|none| +|»»» icon|string|false|none|none| +|»»» logo|string|false|none|none| +|»»» rights|string|false|none|none| +|»»» subtitle|string|false|none|none| +|»»» generator|[Generator](#schemagenerator)|false|none|none| +|»»»» name|string|false|none|none| +|»»»» version|string|false|none|none| +|»»»» uri|string|false|none|none| +|»» open_search|[OpenSearch](#schemaopensearch)|false|none|none| +|»»» short_name|string|false|none|none| +|»»» description|string|false|none|none| +|»»» contact|string|false|none|none| +|»»» tags|string|false|none|none| +|»»» long_name|string|false|none|none| +|»»» image_height|string|false|none|none| +|»»» image_width|string|false|none|none| +|»»» image_type|string|false|none|none| +|»»» image_url|string|false|none|none| +|»»» developer|string|false|none|none| +|»»» attribution|string|false|none|none| +|»»» syndication_right|string|false|none|none| +|»»» adult_content|string|false|none|none| +|»»» language|string|false|none|none| +|»»» input_encoding|string|false|none|none| +|»»» output_encoding|string|false|none|none| +|»» inspire|[Inspire](#schemainspire)|false|none|none| +|»»» keywords|[[Keyword](#schemakeyword)]|false|none|none| +|»»»» value|string|false|none|none| +|»»»» vocabulary|string|false|none|none| +|»»»» date_of_publication|string|false|none|none| +|»»» topic_categories|[string]|false|none|none| +|»»» lineage|string|false|none|none| +|»»» languages|[string]|false|none|none| +|»»» spatial_resolution|[InspireSpatialResolution](#schemainspirespatialresolution)|false|none|none| +|»»»» value|number|false|none|none| +|»»»» unit_of_measure|string|false|none|none| +|»»» inspire_uri|[InspireURI](#schemainspireuri)|false|none|none| +|»»»» code|string|false|none|none| +|»»»» namespace|string|false|none|none| +|»»» inspire_limitation_access|[InspireLimitationAccess](#schemainspirelimitationaccess)|false|none|none| +|»»»» access_constraints|string|false|none|none| +|»»»» other_constraints|string|false|none|none| +|»»»» classification|string|false|none|none| +|»»» inspire_use_conditions|string|false|none|none| +|»» dublin_core_element_name|[DublinCoreElementName](#schemadublincoreelementname)|false|none|none| +|»»» title|string|false|none|none| +|»»» creator|string|false|none|none| +|»»» subject|string|false|none|none| +|»»» description|string|false|none|none| +|»»» publisher|string|false|none|none| +|»»» contributor|string|false|none|none| +|»»» type|string|false|none|none| +|»»» format|string|false|none|none| +|»»» identifier|string|false|none|none| +|»»» source|string|false|none|none| +|»»» language|string|false|none|none| +|»»» bbox|[Bbox](#schemabbox)|false|none|none| +|»»»» north|number(double)|true|none|none| +|»»»» south|number(double)|true|none|none| +|»»»» east|number(double)|true|none|none| +|»»»» west|number(double)|true|none|none| +|»»» date|string|false|none|none| +|»»» coverage|object|false|none|none| +|»»» coverage_centroid|string|false|none|none| +|»» raster_tile_url|[RasterTileURL](#schemarastertileurl)|false|none|none| +|»»» url|string|true|none|none| +|»»» id_path|string|true|none|none| +|»»» min_z|integer(int32)|false|none|none| +|»»» max_z|integer(int32)|false|none|none| +|»»» check_geometry|boolean|false|none|none| +|»» raster_tile_width|integer(int32)|false|none|none| +|»» raster_tile_height|integer(int32)|false|none|none| +|»» filter|[Filter](#schemafilter)|false|none|none| +|»»» f|[array]|false|none|none| +|»»»» field|string|false|none|none| +|»»»» op|string|false|none|none| +|»»»» value|string|false|none|none| +|»»»» empty|boolean|false|none|none| +|» q|[array]|false|none|none| +|»» empty|boolean|false|none|none| +|» dateformat|string|false|none|none| +|» righthand|boolean|false|none|none| +|license_name|string|false|none|none| +|license_urls|[string]|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|type|TEXT| +|type|KEYWORD| +|type|LONG| +|type|INTEGER| +|type|SHORT| +|type|BYTE| +|type|DOUBLE| +|type|FLOAT| +|type|DATE| +|type|BOOLEAN| +|type|BINARY| +|type|INT_RANGE| +|type|FLOAT_RANGE| +|type|LONG_RANGE| +|type|DOUBLE_RANGE| +|type|DATE_RANGE| +|type|OBJECT| +|type|NESTED| +|type|GEO_POINT| +|type|GEO_SHAPE| +|type|IP| +|type|COMPLETION| +|type|TOKEN_COUNT| +|type|MAPPER_MURMUR3| +|type|UNKNOWN| +|type|VARCHAR| +|type|CHAR| +|type|CHARACTER| +|type|BIT| +|type|TINYINT| +|type|SMALLINT| +|type|INT| +|type|BIGINT| +|type|DECIMAL| +|type|NUMERIC| +|type|REAL| +|type|DOUBLEPRECISION| +|type|TIMESTAMP| +|type|TIME| +|type|INTERVAL| +|type|GEOMETRY| +|type|GEOGRAPHY| +|type|POINT| +|type|LINESTRING| +|type|POLYGON| +|type|MULTIPOINT| +|type|MULTILINESTRING| +|type|MULTIPOLYGON| +|type|GEOMETRYCOLLECTION| +|type|MURMUR3| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| + + + +## Get an Arlas document + + + +`GET /explore/{collection}/{identifier}` + +Returns a raw indexed document. + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|identifier|path|string|true|identifier| +|pretty|query|boolean|false|Pretty print| +|flat|query|boolean|false|Flats the property map: only key/value on one level| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +> Example responses + +> 200 Response + +```json +{ + "md": { + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] + }, + "data": {} +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[ArlasHit](#schemaarlashit)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|Not Found Error.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## GeoSearch + + + +`POST /explore/{collection}/_geosearch` + +Search and return the elements found in the collection(s) as features, given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[Search](#schemasearch)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "features": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" + } + ] +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[FeatureCollection](#schemafeaturecollection)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## ShapeSearch + + + +`POST /explore/{collection}/_shapesearch` + +Search and return the elements found in the collection(s) as features, given the filters, exported as a Shapefile + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[Search](#schemasearch)|false|none| + +> Example responses + +> 400 Response + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|None| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Tiled GeoSearch + + + +`GET /explore/{collection}/_tile/{z}/{x}/{y}.png` + +Search and return the elements found in the collection(s) and localized in the given tile(x,y,z) as features, given the filters + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|x|path|integer(int32)|true|x| +|y|path|integer(int32)|true|y| +|z|path|integer(int32)|true|z| +|f|query|array[string]|false|- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. | +|q|query|array[string]|false|A full text search. Optionally, it's possible to search on a field using this syntax: {fieldname}:{text}| +|dateformat|query|string|false|The format of dates. This parameter should be set only if a date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte` and `range` operations| +|righthand|query|boolean|false|If righthand = true, the passed WKT should be counter clock-wise; otherwise, ARLAS-server will attempt to parse it as the "Complementary" Polygon on the other facet of the planet. | +|size|query|integer(int64)|false|The maximum number of entries or sub-entries to be returned. The default value is 10| +|from|query|integer(int64)|false|From index to start the search from. Defaults to 0.| +|sort|query|string|false|Sorts the resulted hits on the given fields and/or by distance to a given point:| +|after|query|string|false|List of values of fields present in sort param that are used to search after. | +|before|query|string|false|Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).| +|sampling|query|integer(int32)|false|Size of the sampling for testing transparency: 1: test every pixel, 10: test 1 pixel every 10 pixels, etc.| +|coverage|query|integer(int32)|false|Percentage (]0-100]) of acceptable transparent pixels. Higher the percentage, more tiles could be used for filling the tile| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +#### Detailed descriptions + +**f**: - A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. + +- A triplet is composed of a field name, a comparison operator and a value. + + The possible values of the comparison operator are : + + Operator -- Description -- value type + + :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings + + :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings + + :like: -- {fieldName} is like {value} -- numeric or strings + + :gte: -- {fieldName} is greater than or equal to {value} -- numeric + + :gt: -- {fieldName} is greater than {value} -- numeric + + :lte: -- {fieldName} is less than or equal to {value} -- numeric + + :lt: -- {fieldName} is less than {value} -- numeric + + :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`. + +> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending. + +> **Note 2**: The order of fields matters. + +> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time. + +> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time. + +> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°) + + +**after**: List of values of fields present in sort param that are used to search after. + +> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort). + +> __**Restriction 1**__: **after** param works only combined with **sort** param. + +> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`. + +> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search + +> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param + +> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value. + +> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*. + +> __**Restriction 2**__: **from** param must be set to 0 or kept unset + + +> Example responses + +> 400 Response + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|None| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Search + + + +`POST /explore/{collection}/_search` + +Search and return the elements found in the collection, given the filters + +> Body parameter + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" +} +``` + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collection|path|string|true|collection| +|pretty|query|boolean|false|Pretty print| +|max-age-cache|query|integer(int32)|false|max-age-cache| +|body|body|[Search](#schemasearch)|false|none| + +> Example responses + +> 200 Response + +```json +{ + "collection": "string", + "hits": [ + { + "md": { + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] + }, + "data": {} + } + ], + "nbhits": 0, + "totalnb": 0, + "links": { + "property1": { + "href": "string", + "method": "string", + "body": {} + }, + "property2": { + "href": "string", + "method": "string", + "body": {} + } + } +} +``` + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|[Hits](#schemahits)| +|400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad request.|[Error](#schemaerror)| +|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Arlas Server Error.|[Error](#schemaerror)| + + + +## Suggest + + + +`GET /explore/{collections}/_suggest` + +Suggest the the n (n=size) most relevant terms given the filters + +

Parameters

+ +|Name|In|Type|Required|Description| +|---|---|---|---|---| +|collections|path|string|true|collections, comma separated| +|f|query|array[string]|false|- A triplet for filtering the result. Multiple filter can be provided. The order does not matter. | +|q|query|string|false|A full text search| +|pretty|query|boolean|false|Pretty print| +|size|query|integer(int64)|false|The maximum number of entries or sub-entries to be returned. The default value is 10| +|from|query|integer(int64)|false|From index to start the search from. Defaults to 0.| +|field|query|string|false|Name of the field to be used for retrieving the most relevant terms| +|max-age-cache|query|integer(int32)|false|max-age-cache| + +#### Detailed descriptions + +**f**: - A triplet for filtering the result. Multiple filter can be provided. The order does not matter. + +- A triplet is composed of a field name, a comparison operator and a value. + + The possible values of the comparison operator are : + + Operator | Description | value type + + : | {fieldName} equals {value} | numeric or strings + + :gte: | {fieldName} is greater than or equal to {value} | numeric + + :gt: | {fieldName} is greater than {value} | numeric + + :lte: | {fieldName} is less than or equal to {value} | numeric + + :lt: | {fieldName} is less than {value} | numeric + + + +- The AND operator is applied between filters having different fieldNames. + +- The OR operator is applied on filters having the same fieldName. + +- If the fieldName starts with - then a must not filter is used + +- If the fieldName starts with - then a must not filter is used + +For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md + +

Responses

+ +|Status|Meaning|Description|Schema| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Successful operation|None| + + + +# Schemas + +

Success

+ + + + + + +```json +{ + "status": 0, + "message": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|status|integer(int32)|false|none|none| +|message|string|false|none|none| + +

Error

+ + + + + + +```json +{ + "status": 0, + "message": "string", + "error": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|status|integer(int32)|false|none|none| +|message|string|false|none|none| +|error|string|false|none|none| + +

Bbox

+ + + + + + +```json +{ + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|north|number(double)|true|none|none| +|south|number(double)|true|none|none| +|east|number(double)|true|none|none| +|west|number(double)|true|none|none| + +

CollectionDisplayNames

+ + + + + + +```json +{ + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|collection|string|false|none|none| +|fields|object|false|none|none| +|» **additionalProperties**|string|false|none|none| +|shape_columns|object|false|none|none| +|» **additionalProperties**|string|false|none|none| + +

CollectionOrganisations

+ + + + + + +```json +{ + "owner": "string", + "shared": [ + "string" + ], + "public": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|owner|string|false|none|none| +|shared|[string]|false|none|none| +|public|boolean|false|none|none| + +

CollectionReference

+ + + + + + +```json +{ + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|collection_name|string|true|none|none| +|params|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|none|none| + +

CollectionReferenceParameters

+ + + + + + +```json +{ + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|index_name|string|true|none|none| +|id_path|string|true|none|none| +|geometry_path|string|true|none|none| +|centroid_path|string|true|none|none| +|timestamp_path|string|true|none|none| +|exclude_fields|string|false|none|none| +|update_max_hits|integer(int32)|false|none|none| +|taggable_fields|string|false|none|none| +|exclude_wfs_fields|string|false|none|none| +|custom_params|object|false|none|none| +|» **additionalProperties**|string|false|none|none| +|display_names|[CollectionDisplayNames](#schemacollectiondisplaynames)|false|none|none| +|organisations|[CollectionOrganisations](#schemacollectionorganisations)|false|none|none| +|atom_feed|[Feed](#schemafeed)|false|none|none| +|open_search|[OpenSearch](#schemaopensearch)|false|none|none| +|inspire|[Inspire](#schemainspire)|false|none|none| +|dublin_core_element_name|[DublinCoreElementName](#schemadublincoreelementname)|false|none|none| +|raster_tile_url|[RasterTileURL](#schemarastertileurl)|false|none|none| +|raster_tile_width|integer(int32)|false|none|none| +|raster_tile_height|integer(int32)|false|none|none| +|filter|[Filter](#schemafilter)|false|none|none| +|license_name|string|false|none|none| +|license_urls|[string]|false|none|none| + +

DublinCoreElementName

+ + + + + + +```json +{ + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|title|string|false|none|none| +|creator|string|false|none|none| +|subject|string|false|none|none| +|description|string|false|none|none| +|publisher|string|false|none|none| +|contributor|string|false|none|none| +|type|string|false|none|none| +|format|string|false|none|none| +|identifier|string|false|none|none| +|source|string|false|none|none| +|language|string|false|none|none| +|bbox|[Bbox](#schemabbox)|false|none|none| +|date|string|false|none|none| +|coverage|object|false|none|none| +|coverage_centroid|string|false|none|none| + +

Expression

+ + + + + + +```json +{ + "field": "string", + "op": "eq", + "value": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|field|string|false|none|none| +|op|string|false|none|none| +|value|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|op|eq| +|op|gte| +|op|gt| +|op|lte| +|op|lt| +|op|like| +|op|ne| +|op|range| +|op|within| +|op|notwithin| +|op|intersects| +|op|notintersects| + +

Feed

+ + + + + + +```json +{ + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|author|[Person](#schemaperson)|false|none|none| +|contributor|[Person](#schemaperson)|false|none|none| +|icon|string|false|none|none| +|logo|string|false|none|none| +|rights|string|false|none|none| +|subtitle|string|false|none|none| +|generator|[Generator](#schemagenerator)|false|none|none| + +

Filter

+ + + + + + +```json +{ + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|f|[array]|false|none|none| +|» empty|boolean|false|none|none| +|q|[array]|false|none|none| +|» empty|boolean|false|none|none| +|dateformat|string|false|none|none| +|righthand|boolean|false|none|none| + +

Generator

+ + + + + + +```json +{ + "name": "string", + "version": "string", + "uri": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|name|string|false|none|none| +|version|string|false|none|none| +|uri|string|false|none|none| + +

Inspire

+ + + + + + +```json +{ + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|keywords|[[Keyword](#schemakeyword)]|false|none|none| +|topic_categories|[string]|false|none|none| +|lineage|string|false|none|none| +|languages|[string]|false|none|none| +|spatial_resolution|[InspireSpatialResolution](#schemainspirespatialresolution)|false|none|none| +|inspire_uri|[InspireURI](#schemainspireuri)|false|none|none| +|inspire_limitation_access|[InspireLimitationAccess](#schemainspirelimitationaccess)|false|none|none| +|inspire_use_conditions|string|false|none|none| + +

InspireLimitationAccess

+ + + + + + +```json +{ + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|access_constraints|string|false|none|none| +|other_constraints|string|false|none|none| +|classification|string|false|none|none| + +

InspireSpatialResolution

+ + + + + + +```json +{ + "value": 0, + "unit_of_measure": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|value|number|false|none|none| +|unit_of_measure|string|false|none|none| + +

InspireURI

+ + + + + + +```json +{ + "code": "string", + "namespace": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|code|string|false|none|none| +|namespace|string|false|none|none| + +

JSONObject

+ + + + + + +```json +{} + +``` + +### Properties + +*None* + +

Keyword

+ + + + + + +```json +{ + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|value|string|false|none|none| +|vocabulary|string|false|none|none| +|date_of_publication|string|false|none|none| + +

MultiValueFilterExpression

+ + + + + + +```json +[ + { + "field": "string", + "op": "eq", + "value": "string" + } +] + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[[Expression](#schemaexpression)]|false|none|none| +|empty|boolean|false|none|none| + +

MultiValueFilterString

+ + + + + + +```json +[ + "string" +] + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|empty|boolean|false|none|none| + +

OpenSearch

+ + + + + + +```json +{ + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|short_name|string|false|none|none| +|description|string|false|none|none| +|contact|string|false|none|none| +|tags|string|false|none|none| +|long_name|string|false|none|none| +|image_height|string|false|none|none| +|image_width|string|false|none|none| +|image_type|string|false|none|none| +|image_url|string|false|none|none| +|developer|string|false|none|none| +|attribution|string|false|none|none| +|syndication_right|string|false|none|none| +|adult_content|string|false|none|none| +|language|string|false|none|none| +|input_encoding|string|false|none|none| +|output_encoding|string|false|none|none| + +

Person

+ + + + + + +```json +{ + "name": "string", + "email": "string", + "uri": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|name|string|false|none|none| +|email|string|false|none|none| +|uri|string|false|none|none| + +

RasterTileURL

+ + + + + + +```json +{ + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|url|string|true|none|none| +|id_path|string|true|none|none| +|min_z|integer(int32)|false|none|none| +|max_z|integer(int32)|false|none|none| +|check_geometry|boolean|false|none|none| + +

FormDataContentDisposition

+ + + + + + +```json +{ + "type": "string", + "parameters": { + "property1": "string", + "property2": "string" + }, + "fileName": "string", + "creationDate": "2019-08-24T14:15:22Z", + "modificationDate": "2019-08-24T14:15:22Z", + "readDate": "2019-08-24T14:15:22Z", + "size": 0, + "name": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|type|string|false|none|none| +|parameters|object|false|none|none| +|» **additionalProperties**|string|false|none|none| +|fileName|string|false|none|none| +|creationDate|string(date-time)|false|none|none| +|modificationDate|string(date-time)|false|none|none| +|readDate|string(date-time)|false|none|none| +|size|integer(int64)|false|none|none| +|name|string|false|none|none| + +

CollectionReferenceUpdate

+ + + + + + +```json +{ + "organisations": { + "public": true, + "shared": [ + "string" + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|organisations|[CollectionReferenceUpdateOrg](#schemacollectionreferenceupdateorg)|false|none|none| + +

CollectionReferenceUpdateOrg

+ + + + + + +```json +{ + "public": true, + "shared": [ + "string" + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|public|boolean|false|none|none| +|shared|[string]|false|none|none| + +

AggregationMetric

+ + + + + + +```json +{ + "type": "string", + "field": "string", + "value": {} +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|type|string|false|none|none| +|field|string|false|none|none| +|value|object|false|none|none| + +

AggregationResponse

+ + + + + + +```json +{ + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "name": "string", + "count": 0, + "sumotherdoccounts": 0, + "key": {}, + "key_as_string": {}, + "elements": [ + { + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "name": "string", + "count": 0, + "sumotherdoccounts": 0, + "key": {}, + "key_as_string": {}, + "elements": [], + "metrics": [ + { + "type": "string", + "field": "string", + "value": {} + } + ], + "hits": [ + {} + ], + "geometries": [ + { + "reference": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "sort": "string", + "is_raw": true + } + ], + "flattened_elements": { + "property1": {}, + "property2": {} + } + } + ], + "metrics": [ + { + "type": "string", + "field": "string", + "value": {} + } + ], + "hits": [ + {} + ], + "geometries": [ + { + "reference": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "sort": "string", + "is_raw": true + } + ], + "flattened_elements": { + "property1": {}, + "property2": {} + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|query_time|integer(int64)|false|none|none| +|total_time|integer(int64)|false|none|none| +|totalnb|integer(int64)|false|none|none| +|name|string|false|none|none| +|count|integer(int64)|false|none|none| +|sumotherdoccounts|integer(int64)|false|none|none| +|key|object|false|none|none| +|key_as_string|object|false|none|none| +|elements|[[AggregationResponse](#schemaaggregationresponse)]|false|none|none| +|metrics|[[AggregationMetric](#schemaaggregationmetric)]|false|none|none| +|hits|[object]|false|none|none| +|geometries|[[ReturnedGeometry](#schemareturnedgeometry)]|false|none|none| +|flattened_elements|object|false|none|none| +|» **additionalProperties**|object|false|none|none| + +

Crs

+ + + + + + +```json +{ + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|type|string|false|none|none| +|properties|object|false|none|none| +|» **additionalProperties**|object|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|type|name| +|type|link| + +

Feature

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» properties|object|false|none|none| +|»» **additionalProperties**|object|false|none|none| +|» geometry|[GeoJsonObject](#schemageojsonobject)|false|none|none| +|» id|string|false|none|none| + +

FeatureCollection

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "features": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "id": "string" + } + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» features|[[Feature](#schemafeature)]|false|none|none| + +

GeoJsonObject

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|crs|[Crs](#schemacrs)|false|none|none| +|bbox|[number]|false|none|none| +|type|string|true|none|none| + +

GeometryCollection

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "geometries": [ + { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» geometries|[[GeoJsonObject](#schemageojsonobject)]|false|none|none| + +

LineString

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": [ + { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[[LngLatAlt](#schemalnglatalt)]|false|none|none| + +

LngLatAlt

+ + + + + + +```json +{ + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|longitude|number(double)|false|none|none| +|latitude|number(double)|false|none|none| +|altitude|number(double)|false|none|none| +|additionalElements|[number]|false|none|none| + +

MultiLineString

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": [ + [ + { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } + ] + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[array]|false|none|none| + +

MultiPoint

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": [ + { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[[LngLatAlt](#schemalnglatalt)]|false|none|none| + +

MultiPolygon

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": [ + [ + [ + { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } + ] + ] + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[array]|false|none|none| + +

Point

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[LngLatAlt](#schemalnglatalt)|false|none|none| + +

Polygon

+ + + + + + +```json +{ + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string", + "coordinates": [ + [ + { + "longitude": 0.1, + "latitude": 0.1, + "altitude": 0.1, + "additionalElements": [ + 0.1 + ] + } + ] + ] +} + +``` + +### Properties + +allOf - discriminator: GeoJsonObject.type + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +and + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|*anonymous*|object|false|none|none| +|» coordinates|[array]|false|none|none| + +

ReturnedGeometry

+ + + + + + +```json +{ + "reference": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "sort": "string", + "is_raw": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|reference|string|false|none|none| +|geometry|[GeoJsonObject](#schemageojsonobject)|false|none|none| +|sort|string|false|none|none| +|is_raw|boolean|false|none|none| + +

Aggregation

+ + + + + + +```json +{ + "type": "datehistogram", + "field": "string", + "interval": { + "value": 0, + "unit": "year" + }, + "format": "string", + "metrics": [ + { + "collect_field": "string", + "collect_fct": "AVG" + } + ], + "order": "asc", + "on": "field", + "size": "string", + "include": "string", + "raw_geometries": [ + { + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] + } + ], + "aggregated_geometries": [ + "BBOX" + ], + "fetch_hits": { + "size": 0, + "include": [ + "string" + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|type|string|false|none|none| +|field|string|false|none|none| +|interval|[Interval](#schemainterval)|false|none|none| +|format|string|false|none|none| +|metrics|[[Metric](#schemametric)]|false|none|none| +|order|string|false|none|none| +|on|string|false|none|none| +|size|string|false|none|none| +|include|string|false|none|none| +|raw_geometries|[[RawGeometry](#schemarawgeometry)]|false|none|none| +|aggregated_geometries|[string]|false|none|none| +|fetch_hits|[HitsFetcher](#schemahitsfetcher)|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|type|datehistogram| +|type|geohash| +|type|geotile| +|type|histogram| +|type|term| +|type|geohex| +|order|asc| +|order|desc| +|on|field| +|on|count| +|on|result| + +

AggregationsRequest

+ + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "aggregations": [ + { + "type": "datehistogram", + "field": "string", + "interval": { + "value": 0, + "unit": "year" + }, + "format": "string", + "metrics": [ + { + "collect_field": "string", + "collect_fct": "AVG" + } + ], + "order": "asc", + "on": "field", + "size": "string", + "include": "string", + "raw_geometries": [ + { + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] + } + ], + "aggregated_geometries": [ + "BBOX" + ], + "fetch_hits": { + "size": 0, + "include": [ + "string" + ] + } + } + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|aggregations|[[Aggregation](#schemaaggregation)]|false|none|none| + +

Form

+ + + + + + +```json +{ + "pretty": true, + "flat": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|pretty|boolean|false|none|none| +|flat|boolean|false|none|none| + +

HitsFetcher

+ + + + + + +```json +{ + "size": 0, + "include": [ + "string" + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|size|integer(int32)|false|none|none| +|include|[string]|false|none|none| + +

Interval

+ + + + + + +```json +{ + "value": 0, + "unit": "year" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|value|number|false|none|none| +|unit|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|unit|year| +|unit|quarter| +|unit|month| +|unit|week| +|unit|day| +|unit|hour| +|unit|minute| +|unit|second| + +

Metric

+ + + + + + +```json +{ + "collect_field": "string", + "collect_fct": "AVG" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|collect_field|string|false|none|none| +|collect_fct|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|collect_fct|AVG| +|collect_fct|CARDINALITY| +|collect_fct|MAX| +|collect_fct|MIN| +|collect_fct|SUM| +|collect_fct|GEOCENTROID| +|collect_fct|GEOBBOX| + +

RawGeometry

+ + + + + + +```json +{ + "geometry": "string", + "sort": "string", + "signedSort": "string", + "include": [ + "string" + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|geometry|string|false|none|none| +|sort|string|false|none|none| +|signedSort|string|false|none|none| +|include|[string]|false|none|none| + +

ComputationResponse

+ + + + + + +```json +{ + "query_time": 0, + "total_time": 0, + "totalnb": 0, + "field": "string", + "metric": "AVG", + "value": 0.1, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|query_time|integer(int64)|false|none|none| +|total_time|integer(int64)|false|none|none| +|totalnb|integer(int64)|false|none|none| +|field|string|false|none|none| +|metric|string|false|none|none| +|value|number(double)|false|none|none| +|geometry|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|metric|AVG| +|metric|MAX| +|metric|MIN| +|metric|SUM| +|metric|CARDINALITY| +|metric|SPANNING| +|metric|GEOBBOX| +|metric|GEOCENTROID| + +

ComputationRequest

+ + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "field": "string", + "metric": "AVG" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|field|string|false|none|none| +|metric|string|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|metric|AVG| +|metric|MAX| +|metric|MIN| +|metric|SUM| +|metric|CARDINALITY| +|metric|SPANNING| +|metric|GEOBBOX| +|metric|GEOCENTROID| + +

ArlasHit

+ + + + + + +```json +{ + "md": { + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] + }, + "data": {} +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|md|[MD](#schemamd)|false|none|none| +|data|object|false|none|none| + +

Geo

+ + + + + + +```json +{ + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|path|string|false|none|none| +|geometry|[GeoJsonObject](#schemageojsonobject)|false|none|none| + +

Hits

+ + + + + + +```json +{ + "collection": "string", + "hits": [ + { + "md": { + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] + }, + "data": {} + } + ], + "nbhits": 0, + "totalnb": 0, + "links": { + "property1": { + "href": "string", + "method": "string", + "body": {} + }, + "property2": { + "href": "string", + "method": "string", + "body": {} + } + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|collection|string|false|none|none| +|hits|[[ArlasHit](#schemaarlashit)]|false|none|none| +|nbhits|integer(int64)|false|none|none| +|totalnb|integer(int64)|false|none|none| +|links|object|false|none|none| +|» **additionalProperties**|[Link](#schemalink)|false|none|none| + + + + + + + + +```json +{ + "href": "string", + "method": "string", + "body": {} +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|href|string|true|none|none| +|method|string|true|none|none| +|body|object|false|none|none| + +

MD

+ + + + + + +```json +{ + "id": "string", + "timestamp": 0, + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "centroid": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + }, + "returned_geometries": [ + { + "path": "string", + "geometry": { + "crs": { + "type": "name", + "properties": { + "property1": {}, + "property2": {} + } + }, + "bbox": [ + 0.1 + ], + "type": "string" + } + } + ] +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|id|string|false|none|none| +|timestamp|integer(int64)|false|none|none| +|geometry|[GeoJsonObject](#schemageojsonobject)|false|none|none| +|centroid|[GeoJsonObject](#schemageojsonobject)|false|none|none| +|returned_geometries|[[Geo](#schemageo)]|false|none|none| + +

Count

+ + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| + +

CollectionReferenceDescription

+ + + + + + +```json +{ + "properties": { + "property1": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + }, + "property2": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": {}, + "property2": {} + }, + "taggable": true, + "indexed": true + } + }, + "collection_name": "string", + "params": { + "index_name": "string", + "id_path": "string", + "geometry_path": "string", + "centroid_path": "string", + "timestamp_path": "string", + "exclude_fields": "string", + "update_max_hits": 0, + "taggable_fields": "string", + "exclude_wfs_fields": "string", + "custom_params": { + "property1": "string", + "property2": "string" + }, + "display_names": { + "collection": "string", + "fields": { + "property1": "string", + "property2": "string" + }, + "shape_columns": { + "property1": "string", + "property2": "string" + } + }, + "organisations": { + "owner": "string", + "shared": [ + "string" + ], + "public": true + }, + "atom_feed": { + "author": { + "name": "string", + "email": "string", + "uri": "string" + }, + "contributor": { + "name": "string", + "email": "string", + "uri": "string" + }, + "icon": "string", + "logo": "string", + "rights": "string", + "subtitle": "string", + "generator": { + "name": "string", + "version": "string", + "uri": "string" + } + }, + "open_search": { + "short_name": "string", + "description": "string", + "contact": "string", + "tags": "string", + "long_name": "string", + "image_height": "string", + "image_width": "string", + "image_type": "string", + "image_url": "string", + "developer": "string", + "attribution": "string", + "syndication_right": "string", + "adult_content": "string", + "language": "string", + "input_encoding": "string", + "output_encoding": "string" + }, + "inspire": { + "keywords": [ + { + "value": "string", + "vocabulary": "string", + "date_of_publication": "string" + } + ], + "topic_categories": [ + "string" + ], + "lineage": "string", + "languages": [ + "string" + ], + "spatial_resolution": { + "value": 0, + "unit_of_measure": "string" + }, + "inspire_uri": { + "code": "string", + "namespace": "string" + }, + "inspire_limitation_access": { + "access_constraints": "string", + "other_constraints": "string", + "classification": "string" + }, + "inspire_use_conditions": "string" + }, + "dublin_core_element_name": { + "title": "string", + "creator": "string", + "subject": "string", + "description": "string", + "publisher": "string", + "contributor": "string", + "type": "string", + "format": "string", + "identifier": "string", + "source": "string", + "language": "string", + "bbox": { + "north": 0.1, + "south": 0.1, + "east": 0.1, + "west": 0.1 + }, + "date": "string", + "coverage": {}, + "coverage_centroid": "string" + }, + "raster_tile_url": { + "url": "string", + "id_path": "string", + "min_z": 0, + "max_z": 0, + "check_geometry": true + }, + "raster_tile_width": 0, + "raster_tile_height": 0, + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "license_name": "string", + "license_urls": [ + "string" + ] + } +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|properties|object|false|none|none| +|» **additionalProperties**|[CollectionReferenceDescriptionProperty](#schemacollectionreferencedescriptionproperty)|false|none|none| +|collection_name|string|true|none|none| +|params|[CollectionReferenceParameters](#schemacollectionreferenceparameters)|true|none|none| + +

CollectionReferenceDescriptionProperty

+ + + + + + +```json +{ + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": { + "property1": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": {}, + "taggable": true, + "indexed": true + }, + "property2": { + "type": "TEXT", + "format": "string", + "hash_field": "string", + "properties": {}, + "taggable": true, + "indexed": true + } + }, + "taggable": true, + "indexed": true +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|type|string|false|none|none| +|format|string|false|none|none| +|hash_field|string|false|none|none| +|properties|object|false|none|none| +|» **additionalProperties**|[CollectionReferenceDescriptionProperty](#schemacollectionreferencedescriptionproperty)|false|none|none| +|taggable|boolean|false|none|none| +|indexed|boolean|false|none|none| + +#### Enumerated Values + +|Property|Value| +|---|---| +|type|TEXT| +|type|KEYWORD| +|type|LONG| +|type|INTEGER| +|type|SHORT| +|type|BYTE| +|type|DOUBLE| +|type|FLOAT| +|type|DATE| +|type|BOOLEAN| +|type|BINARY| +|type|INT_RANGE| +|type|FLOAT_RANGE| +|type|LONG_RANGE| +|type|DOUBLE_RANGE| +|type|DATE_RANGE| +|type|OBJECT| +|type|NESTED| +|type|GEO_POINT| +|type|GEO_SHAPE| +|type|IP| +|type|COMPLETION| +|type|TOKEN_COUNT| +|type|MAPPER_MURMUR3| +|type|UNKNOWN| +|type|VARCHAR| +|type|CHAR| +|type|CHARACTER| +|type|BIT| +|type|TINYINT| +|type|SMALLINT| +|type|INT| +|type|BIGINT| +|type|DECIMAL| +|type|NUMERIC| +|type|REAL| +|type|DOUBLEPRECISION| +|type|TIMESTAMP| +|type|TIME| +|type|INTERVAL| +|type|GEOMETRY| +|type|GEOGRAPHY| +|type|POINT| +|type|LINESTRING| +|type|POLYGON| +|type|MULTIPOINT| +|type|MULTILINESTRING| +|type|MULTIPOLYGON| +|type|GEOMETRYCOLLECTION| +|type|MURMUR3| + +

Page

+ + + + + + +```json +{ + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|size|integer(int32)|false|none|none| +|from|integer(int32)|false|none|none| +|sort|string|false|none|none| +|after|string|false|none|none| +|before|string|false|none|none| + +

Projection

+ + + + + + +```json +{ + "includes": "string", + "excludes": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|includes|string|false|none|none| +|excludes|string|false|none|none| + + + + + + + + +```json +{ + "filter": { + "f": [ + [ + { + "field": "string", + "op": "eq", + "value": "string" + } + ] + ], + "q": [ + [ + "string" + ] + ], + "dateformat": "string", + "righthand": true + }, + "form": { + "pretty": true, + "flat": true + }, + "page": { + "size": 0, + "from": 0, + "sort": "string", + "after": "string", + "before": "string" + }, + "projection": { + "includes": "string", + "excludes": "string" + }, + "returned_geometries": "string" +} + +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|filter|[Filter](#schemafilter)|false|none|none| +|form|[Form](#schemaform)|false|none|none| +|page|[Page](#schemapage)|false|none|none| +|projection|[Projection](#schemaprojection)|false|none|none| +|returned_geometries|string|false|none|none| + diff --git a/docs/api/security.md b/docs/api/security.md deleted file mode 100644 index 139597f9c..000000000 --- a/docs/api/security.md +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/mkDocs.sh b/mkDocs.sh index a0c58752d..815d6a8a2 100755 --- a/mkDocs.sh +++ b/mkDocs.sh @@ -16,9 +16,9 @@ mkdir -p target/tmp/typescript-fetch echo "=> Generate API" docker run --rm \ - --mount dst=/input/api.json,src="$PWD/openapi/swagger.json",type=bind,ro \ + --mount dst=/input/api.json,src="$PWD/openapi/openapi.json",type=bind,ro \ --mount dst=/output,src="$PWD/target/tmp/typescript-fetch",type=bind \ - gisaia/swagger-codegen-2.4.14 \ + gisaia/swagger-codegen-3.0.42 \ -l typescript-fetch --additional-properties modelPropertyNaming=snake_case echo "=> Generate Typescript client documentation" @@ -48,10 +48,7 @@ docker run --rm \ -v $PWD:/opt/maven \ -v $HOME/.m2:/root/.m2 \ busybox \ - sh -c 'cat /opt/maven/docs/api/overview.md > /opt/maven/target/generated-docs/reference.md \ - && cat /opt/maven/docs/api/paths.md >> /opt/maven/target/generated-docs/reference.md \ - && cat /opt/maven/docs/api/definitions.md >> /opt/maven/target/generated-docs/reference.md \ - && cat /opt/maven/docs/api/security.md >> /opt/maven/target/generated-docs/reference.md' + sh -c 'cat /opt/maven/docs/api/reference.md > /opt/maven/target/generated-docs/reference.md' echo "=> Copy documentation under docs/ repository" docker run --rm \ diff --git a/ogc-common/pom.xml b/ogc-common/pom.xml index 51eb1cd1e..dedaeaeb1 100644 --- a/ogc-common/pom.xml +++ b/ogc-common/pom.xml @@ -33,7 +33,8 @@ org.codehaus.mojo jaxb2-maven-plugin - 2.5.0 + 3.1.0 + xjc @@ -42,6 +43,7 @@ + src/main/resources/global.xjb @@ -55,20 +57,26 @@ -Xannotate - + - org.jvnet.jaxb2_commons - jaxb2-basics-annotate - 1.1.0 + org.jvnet.jaxb + jaxb-basics-annotate + 2.0.9 + + + javax.xml.bind + jaxb-api + 2.3.1 + org.codehaus.mojo build-helper-maven-plugin - 3.2.0 + 3.5.0 generate-sources @@ -83,6 +91,7 @@ + org.apache.maven.plugins maven-compiler-plugin diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/OGCRESTService.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/OGCRESTService.java index a0902be54..8cfaf4e6a 100644 --- a/ogc-common/src/main/java/io/arlas/server/ogc/common/OGCRESTService.java +++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/OGCRESTService.java @@ -19,11 +19,12 @@ package io.arlas.server.ogc.common; +import io.arlas.server.core.services.ArlasRESTServices; import io.arlas.server.core.services.CollectionReferenceService; import io.arlas.server.ogc.common.dao.OGCCollectionReferenceDao; -public class OGCRESTService { +public class OGCRESTService extends ArlasRESTServices { protected CollectionReferenceService collectionReferenceService = null; protected OGCCollectionReferenceDao ogcDao = null; private static final String META_COLLECTION_NAME = "metacollection"; diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/INSPIRE/INSPIREExceptionCode.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/INSPIRE/INSPIREExceptionCode.java index 45a87b574..7e142534d 100644 --- a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/INSPIRE/INSPIREExceptionCode.java +++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/INSPIRE/INSPIREExceptionCode.java @@ -20,8 +20,7 @@ package io.arlas.server.ogc.common.exceptions.INSPIRE; import io.arlas.server.ogc.common.exceptions.OGC.OGCExceptionCode; - -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; public class INSPIREExceptionCode extends OGCExceptionCode { public static final INSPIREExceptionCode MISSING_INSPIRE_METADATA = new INSPIREExceptionCode("InspireMissingMetadata", HttpServletResponse.SC_BAD_REQUEST); diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCException.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCException.java index aa6413b62..66bb8458d 100644 --- a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCException.java +++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCException.java @@ -21,12 +21,12 @@ import io.arlas.commons.exceptions.ArlasException; -import io.arlas.server.ogc.common.model.response.OGCError; import io.arlas.server.ogc.common.model.Service; +import io.arlas.server.ogc.common.model.response.OGCError; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.apache.commons.collections4.CollectionUtils; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.Arrays; import java.util.List; diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCExceptionCode.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCExceptionCode.java index 10a825aee..adc5b498d 100644 --- a/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCExceptionCode.java +++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/exceptions/OGC/OGCExceptionCode.java @@ -19,7 +19,7 @@ package io.arlas.server.ogc.common.exceptions.OGC; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; public class OGCExceptionCode { private final String value; diff --git a/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/InsensitiveCaseFilter.java b/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/InsensitiveCaseFilter.java index 0717d82e5..73be31a99 100644 --- a/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/InsensitiveCaseFilter.java +++ b/ogc-common/src/main/java/io/arlas/server/ogc/common/requestfilter/InsensitiveCaseFilter.java @@ -19,15 +19,15 @@ package io.arlas.server.wfs.requestfilter; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.PreMatching; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.UriBuilder; +import jakarta.ws.rs.ext.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.ext.Provider; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/ogc-common/src/main/resources/csw/atom/common.xsd b/ogc-common/src/main/resources/csw/atom/common.xsd index b8b37db55..077a3141d 100644 --- a/ogc-common/src/main/resources/csw/atom/common.xsd +++ b/ogc-common/src/main/resources/csw/atom/common.xsd @@ -17,7 +17,14 @@ the Licence. Date: 12-03-2014 --> - + - + GML Profile schema for gml:Point,gml:LineString,gml:Polygon,gml:Envelope, gml:CirclebyCenterpoint written by Joshua Lieberman. for use by the GeoRSS v. 1.1 application schema diff --git a/ogc-common/src/main/resources/csw/atom/network.xsd b/ogc-common/src/main/resources/csw/atom/network.xsd index 964ddbea3..d417b3c7d 100644 --- a/ogc-common/src/main/resources/csw/atom/network.xsd +++ b/ogc-common/src/main/resources/csw/atom/network.xsd @@ -16,7 +16,14 @@ the Licence. Date: 12-03-2014 --> - + diff --git a/ogc-common/src/main/resources/csw/atom/opensearch.xsd b/ogc-common/src/main/resources/csw/atom/opensearch.xsd index bd79714a9..0567fa920 100644 --- a/ogc-common/src/main/resources/csw/atom/opensearch.xsd +++ b/ogc-common/src/main/resources/csw/atom/opensearch.xsd @@ -26,7 +26,7 @@ Date: 12-03-2014 targetNamespace="http://a9.com/-/spec/opensearch/1.1/" elementFormDefault="qualified" - xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"> + xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0"> diff --git a/ogc-common/src/main/resources/global.xjb b/ogc-common/src/main/resources/global.xjb index 73bd9a2a7..cb037e1f5 100644 --- a/ogc-common/src/main/resources/global.xjb +++ b/ogc-common/src/main/resources/global.xjb @@ -1,10 +1,10 @@ - + + @@ -41,10 +41,10 @@ - @javax.xml.bind.annotation.XmlSchemaType(name="double") + @jakarta.xml.bind.annotation.XmlSchemaType(name="double") - @javax.xml.bind.annotation.XmlSchemaType(name="double") + @jakarta.xml.bind.annotation.XmlSchemaType(name="double") diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWRESTService.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWRESTService.java index f2c728349..0ab0e9f75 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWRESTService.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/CSWRESTService.java @@ -46,18 +46,24 @@ import io.arlas.server.ogc.csw.utils.CSWConstant; import io.arlas.server.ogc.csw.utils.CSWRequestType; import io.arlas.server.ogc.csw.utils.ElementSetName; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +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; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.xml.bind.JAXBElement; import net.opengis.cat.csw._3.AbstractRecordType; import net.opengis.cat.csw._3.CapabilitiesType; import net.opengis.cat.csw._3.GetRecordsResponseType; import org.apache.commons.collections4.CollectionUtils; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.xml.bind.JAXBElement; import javax.xml.datatype.DatatypeConfigurationException; import java.io.IOException; import java.util.ArrayList; @@ -70,7 +76,7 @@ import static io.arlas.server.core.utils.CheckParams.isBboxLatLonInCorrectRanges; @Path("/ogc") -@Api(value = "/ogc") +@Tag(name="ogc", description="OGC API") public class CSWRESTService extends OGCRESTService { public static final String MIME_TYPE__OPENSEARCH_XML = "application/opensearchdescription+xml"; @@ -88,160 +94,126 @@ public CSWRESTService(CSWHandler cswHandler) { @Path("/csw") @GET @Produces({MediaType.APPLICATION_XML, MediaType.TEXT_XML, ATOM.APPLICATION_ATOM_XML, MIME_TYPE__OPENSEARCH_XML}) - @ApiOperation( - value = "CSW", - - produces = MediaType.APPLICATION_XML + "," + MediaType.TEXT_XML + "," + ATOM.APPLICATION_ATOM_XML + "," + MIME_TYPE__OPENSEARCH_XML, - notes = "CSW" + @Operation( + summary = "CSW", + description = "CSW" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response doKVP( - @ApiParam( + @Parameter( name = "version", - value = "version", - allowMultiple = false, + description = "version", required = true) @QueryParam(value = "version") String version, - @ApiParam( + @Parameter( name = "acceptversions", - value = "acceptversions", - allowMultiple = false, + description = "acceptversions", required = true) @QueryParam(value = "acceptversions") String acceptVersions, - @ApiParam( + @Parameter( name = "service", - value = "service", - allowMultiple = false, + description = "service", required = true) @QueryParam(value = "service") String service, - @ApiParam( + @Parameter( name = "request", - value = "request", - allowMultiple = false, + description = "request", required = true) @QueryParam(value = "request") String request, - @ApiParam( + @Parameter( name = "elementname", - value = "elementname", - allowMultiple = false, + description = "elementname", required = true) @QueryParam(value = "elementname") String elementName, - @ApiParam( + @Parameter( name = "elementsetname", - value = "elementsetname", - allowMultiple = false, + description = "elementsetname", required = true) @QueryParam(value = "elementsetname") String elementSetName, - @ApiParam( + @Parameter( name = "filter", - value = "filter", - allowMultiple = false, + description = "filter", required = true) @QueryParam(value = "filter") String filter, - @ApiParam( + @Parameter( name = "constraint", - value = "constraint", - allowMultiple = false, + description = "constraint", required = true) @QueryParam(value = "constraint") String constraint, - @ApiParam( + @Parameter( name = "constraintLanguage", - value = "constraintLanguage", - allowMultiple = false, + description = "constraintLanguage", required = true) @QueryParam(value = "constraintLanguage") String constraintLanguage, - @ApiParam( + @Parameter( name = "startposition", - value = "startposition", - allowMultiple = false, - required = false) + description = "startposition") @QueryParam(value = "startposition") Integer startPosition, - @ApiParam( + @Parameter( name = "maxrecords", - value = "maxrecords", - allowMultiple = false, - required = false) + description = "maxrecords") @QueryParam(value = "maxrecords") Integer maxRecords, - @ApiParam( + @Parameter( name = "sections", - value = "sections", - allowMultiple = false, - required = false) + description = "sections") @QueryParam(value = "sections") String sections, - @ApiParam( + @Parameter( name = "acceptformats", - value = "acceptformats", - allowMultiple = false, - required = false) + description = "acceptformats") @QueryParam(value = "acceptformats") String acceptFormats, - @ApiParam( + @Parameter( name = "q", - value = "q", - allowMultiple = false, - required = false) + description = "q") @QueryParam(value = "q") String query, - @ApiParam( + @Parameter( name = "bbox", - value = "bbox", - allowMultiple = false, - required = false) + description = "bbox") @QueryParam(value = "bbox") String bbox, - @ApiParam( + @Parameter( name = "outputformat", - value = "outputformat", - allowMultiple = false, - required = false) + description = "outputformat") @QueryParam(value = "outputformat") String outputFormat, - @ApiParam( + @Parameter( name = "outputschema", - value = "outputschema", - allowMultiple = false, - required = false) + description = "outputschema") @QueryParam(value = "outputschema") String outputSchema, - @ApiParam( + @Parameter( name = "typenames", - value = "typenames", - allowMultiple = false, - required = false) + description = "typenames") @QueryParam(value = "typenames") String typeNames, - @ApiParam( + @Parameter( name = "recordids", - value = "recordids", - allowMultiple = false, - required = false) + description = "recordids") @QueryParam(value = "recordids") String recordIds, - @ApiParam( + @Parameter( name = "id", - value = "id", - allowMultiple = false, - required = false) + description = "id") @QueryParam(value = "id") String id, - @ApiParam( + @Parameter( name = "language", - value = "language", - allowMultiple = false, - required = false) + description = "language") @QueryParam(value = "language") String language, // -------------------------------------------------------- // ----------------------- FILTER ----------------------- // -------------------------------------------------------- - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam(name = "pretty", value = Documentation.FORM_PRETTY, - allowMultiple = false, - defaultValue = "false", - required = false) + @Parameter(name = "pretty", description = Documentation.FORM_PRETTY, + schema = @Schema(defaultValue = "false")) @QueryParam(value = "pretty") Boolean pretty, @Context HttpHeaders headers ) throws ArlasException, DatatypeConfigurationException, IOException { @@ -388,7 +360,7 @@ public Response doKVP( private void filterCollectionsByColumnFilter( @HeaderParam(COLUMN_FILTER) - @ApiParam(hidden = true) String columnFilter, + @Parameter(hidden = true) String columnFilter, List collections ) throws CollectionUnavailableException { @@ -410,16 +382,22 @@ private void filterCollectionsByColumnFilter( @Path("/csw/opensearch") @GET @Produces({MediaType.APPLICATION_XML, MIME_TYPE__OPENSEARCH_XML}) - @ApiOperation(value = "OpenSearch CSW Description Document", - produces = MediaType.APPLICATION_XML + "," + MIME_TYPE__OPENSEARCH_XML, - notes = Documentation.OPENSEARCH_CSW_OPERATION) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class), @ApiResponse(code = 400, message = "Bad request.", response = Error.class)}) + @Operation( + summary = "OpenSearch CSW Description Document", + description = Documentation.OPENSEARCH_CSW_OPERATION + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "400", description = "Bad request.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response opensearch( // -------------------------------------------------------- // ----------------------- EXTRA ----------------------- // -------------------------------------------------------- - @ApiParam(value = "max-age-cache", required = false) + @Parameter(description = "max-age-cache", required = false) @QueryParam(value = "max-age-cache") Integer maxagecache ) { OpenSearchHandler openSearchHandler = cswHandler.openSearchHandler; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getcapabilities/GetCapabilitiesHandler.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getcapabilities/GetCapabilitiesHandler.java index 76241cf9c..570aca913 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getcapabilities/GetCapabilitiesHandler.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getcapabilities/GetCapabilitiesHandler.java @@ -21,28 +21,28 @@ import eu.europa.ec.inspire.schemas.common._1.*; import eu.europa.ec.inspire.schemas.inspire_dls._1.ExtendedCapabilitiesType; -import io.arlas.server.core.app.OGCConfiguration; import io.arlas.commons.exceptions.ArlasException; +import io.arlas.commons.utils.StringUtil; +import io.arlas.server.core.app.OGCConfiguration; +import io.arlas.server.core.model.CollectionReference; +import io.arlas.server.core.model.InspireConformity; +import io.arlas.server.core.ns.GML; import io.arlas.server.ogc.common.exceptions.INSPIRE.INSPIREException; import io.arlas.server.ogc.common.exceptions.INSPIRE.INSPIREExceptionCode; import io.arlas.server.ogc.common.inspire.common.constants.InspireConstants; import io.arlas.server.ogc.common.inspire.common.enums.AdditionalQueryables; import io.arlas.server.ogc.common.inspire.common.enums.SupportedISOQueryables; import io.arlas.server.ogc.common.inspire.common.utils.InspireCheckParam; -import io.arlas.server.core.model.CollectionReference; -import io.arlas.server.core.model.InspireConformity; -import io.arlas.server.core.ns.GML; import io.arlas.server.ogc.common.model.Service; import io.arlas.server.ogc.csw.CSWHandler; import io.arlas.server.ogc.csw.utils.CSWConstant; import io.arlas.server.ogc.csw.utils.CSWParamsParser; import io.arlas.server.ogc.csw.utils.CSWRequestType; -import io.arlas.commons.utils.StringUtil; +import jakarta.xml.bind.JAXBElement; import net.opengis.cat.csw._3.CapabilitiesType; import net.opengis.fes._2.*; import net.opengis.ows._2.*; -import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecordbyid/GetRecordByIdResponse.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecordbyid/GetRecordByIdResponse.java index fb764c7a8..5ee9cc451 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecordbyid/GetRecordByIdResponse.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecordbyid/GetRecordByIdResponse.java @@ -20,14 +20,15 @@ package io.arlas.server.ogc.csw.operation.getrecordbyid; -import net.opengis.cat.csw._3.AbstractRecordType; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlType; import net.opengis.cat.csw._3.BriefRecordType; import net.opengis.cat.csw._3.RecordType; import net.opengis.cat.csw._3.SummaryRecordType; import org.isotc211._2005.gmd.MDMetadataType; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; @XmlAccessorType(XmlAccessType.FIELD) diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecords/GetRecordsHandler.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecords/GetRecordsHandler.java index cd62a94c2..c91e17c37 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecords/GetRecordsHandler.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/getrecords/GetRecordsHandler.java @@ -19,17 +19,17 @@ package io.arlas.server.ogc.csw.operation.getrecords; -import io.arlas.server.ogc.common.exceptions.OGC.OGCException; import io.arlas.server.core.model.CollectionReference; +import io.arlas.server.ogc.common.exceptions.OGC.OGCException; import io.arlas.server.ogc.csw.CSWHandler; import io.arlas.server.ogc.csw.utils.CSWConstant; import io.arlas.server.ogc.csw.utils.ElementSetName; import io.arlas.server.ogc.csw.utils.MDMetadataBuilder; import io.arlas.server.ogc.csw.utils.RecordBuilder; +import jakarta.xml.bind.JAXBElement; import net.opengis.cat.csw._3.*; import org.isotc211._2005.gmd.MDMetadataType; -import javax.xml.bind.JAXBElement; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/opensearch/OpenSearchHandler.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/opensearch/OpenSearchHandler.java index 558f627d6..627e64a77 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/opensearch/OpenSearchHandler.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/operation/opensearch/OpenSearchHandler.java @@ -24,8 +24,8 @@ import com.a9.opensearch.OpenSearchDescription; import com.a9.opensearch.Url; import io.arlas.server.ogc.csw.CSWHandler; +import jakarta.ws.rs.core.MediaType; -import javax.ws.rs.core.MediaType; import javax.xml.namespace.QName; public class OpenSearchHandler { diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/AtomBuilder.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/AtomBuilder.java index d2657f726..49c29722c 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/AtomBuilder.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/AtomBuilder.java @@ -20,16 +20,14 @@ package io.arlas.server.ogc.csw.utils; +import jakarta.ws.rs.WebApplicationException; import net.opengis.cat.csw._3.AbstractRecordType; import net.opengis.cat.csw._3.BriefRecordType; import net.opengis.cat.csw._3.RecordType; import net.opengis.cat.csw._3.SummaryRecordType; import org.purl.dc.elements._1.SimpleLiteral; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.w3._2005.atom.*; -import javax.ws.rs.WebApplicationException; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/RecordBuilder.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/RecordBuilder.java index f8de0ed94..c9f351d74 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/RecordBuilder.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/utils/RecordBuilder.java @@ -19,11 +19,12 @@ package io.arlas.server.ogc.csw.utils; +import io.arlas.commons.utils.StringUtil; import io.arlas.server.core.model.CollectionReference; import io.arlas.server.core.model.DublinCoreElementName; import io.arlas.server.core.model.Inspire; import io.arlas.server.ogc.common.utils.OGCConstant; -import io.arlas.commons.utils.StringUtil; +import jakarta.xml.bind.JAXBElement; import net.opengis.cat.csw._3.AbstractRecordType; import net.opengis.cat.csw._3.BriefRecordType; import net.opengis.cat.csw._3.RecordType; @@ -31,7 +32,6 @@ import net.opengis.ows._2.WGS84BoundingBoxType; import org.purl.dc.elements._1.SimpleLiteral; -import javax.xml.bind.JAXBElement; import java.util.Arrays; public class RecordBuilder { diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java index 13fa266cb..d09843940 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/AtomGetRecordsMessageBodyWriter.java @@ -24,21 +24,21 @@ import io.arlas.server.core.ns.ATOM; import io.arlas.server.ogc.csw.CSWRESTService; import io.arlas.server.ogc.csw.utils.AtomBuilder; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Marshaller; import net.opengis.cat.csw._3.GetRecordsResponseType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3._2005.atom.*; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/XmlGetRecordsMessageBodyWriter.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/XmlGetRecordsMessageBodyWriter.java index 01c50d140..c9e938786 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/XmlGetRecordsMessageBodyWriter.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/getrecords/XmlGetRecordsMessageBodyWriter.java @@ -20,18 +20,18 @@ package io.arlas.server.ogc.csw.writer.getrecords; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; +import jakarta.xml.bind.JAXB; import net.opengis.cat.csw._3.GetRecordsResponseType; import net.opengis.cat.csw._3.ObjectFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; -import javax.xml.bind.JAXB; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/AtomRecordMessageBodyWriter.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/AtomRecordMessageBodyWriter.java index 56ff3d5cb..c60a1fd7b 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/AtomRecordMessageBodyWriter.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/AtomRecordMessageBodyWriter.java @@ -20,16 +20,16 @@ package io.arlas.server.ogc.csw.writer.record; import io.arlas.server.ogc.csw.utils.AtomBuilder; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.xml.bind.JAXB; import net.opengis.cat.csw._3.AbstractRecordType; import org.w3._2005.atom.EntryType; import org.w3._2005.atom.FeedType; import org.w3._2005.atom.ObjectFactory; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.xml.bind.JAXB; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlMDMetadataMessageBodyWriter.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlMDMetadataMessageBodyWriter.java index 5b068f220..96213a375 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlMDMetadataMessageBodyWriter.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlMDMetadataMessageBodyWriter.java @@ -20,15 +20,15 @@ package io.arlas.server.ogc.csw.writer.record; import io.arlas.server.ogc.csw.operation.getrecordbyid.GetRecordByIdResponse; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; +import jakarta.xml.bind.JAXB; +import jakarta.xml.bind.JAXBElement; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; -import javax.xml.bind.JAXB; -import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import java.io.OutputStream; import java.lang.annotation.Annotation; diff --git a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlRecordMessageBodyBuilder.java b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlRecordMessageBodyBuilder.java index 1578eebc5..6a96f069e 100644 --- a/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlRecordMessageBodyBuilder.java +++ b/ogc-csw/src/main/java/io/arlas/server/ogc/csw/writer/record/XmlRecordMessageBodyBuilder.java @@ -19,14 +19,15 @@ package io.arlas.server.ogc.csw.writer.record; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; +import jakarta.xml.bind.JAXB; import net.opengis.cat.csw._3.*; -import javax.ws.rs.Produces; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; -import javax.xml.bind.JAXB; + import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSRESTService.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSRESTService.java index 2fbcfc641..e3e920c4e 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSRESTService.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/WFSRESTService.java @@ -41,16 +41,22 @@ import io.arlas.server.ogc.wfs.utils.WFSCheckParam; import io.arlas.server.ogc.wfs.utils.WFSConstant; import io.arlas.server.ogc.wfs.utils.WFSRequestType; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; +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; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.StreamingOutput; +import jakarta.xml.bind.JAXBElement; import net.opengis.wfs._2.DescribeStoredQueriesResponseType; import net.opengis.wfs._2.ListStoredQueriesResponseType; import net.opengis.wfs._2.ValueCollectionType; -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.StreamingOutput; -import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import java.io.IOException; import java.util.List; @@ -60,7 +66,7 @@ import static io.arlas.commons.rest.utils.ServerConstants.*; @Path("/ogc/wfs") -@Api(value = "/ogc/wfs") +@Tag(name="ogc/wfs", description="OGC WFS API") public class WFSRESTService extends OGCRESTService { public WFSHandler wfsHandler; @@ -81,114 +87,90 @@ public WFSRESTService(WFSHandler wfsHandler) { @Path("{collection}") @GET @Produces(MediaType.APPLICATION_XML) - @ApiOperation( - value = "WFS", - produces = MediaType.APPLICATION_XML, - notes = "WFS" + @Operation( + summary = "WFS", + description = "WFS" ) - @ApiResponses(value = {@ApiResponse(code = 200, message = "Successful operation" - ), @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "Successful operation"), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response doKVP( - @ApiParam( + @Parameter( name = "collection", - value = "collection", - allowMultiple = false, + description = "collection", required = true) @PathParam(value = "collection") String collection, // -------------------------------------------------------- // ----------------------- FORM ----------------------- // -------------------------------------------------------- - @ApiParam( + @Parameter( name = "version", - value = "version", - allowMultiple = false, + description = "version", required = true) @QueryParam(value = "version") String version, - @ApiParam( + @Parameter( name = "service", - value = "service", - allowMultiple = false, + description = "service", required = true) @QueryParam(value = "service") String service, - @ApiParam( + @Parameter( name = "request", - value = "request", - allowMultiple = false, + description = "request", required = true) @QueryParam(value = "request") String request, - @ApiParam( + @Parameter( name = "storedquery_id", - value = "storedquery_id", - allowMultiple = false, - required = false) + description = "storedquery_id") @QueryParam(value = "storedquery_id") String storedquery_id, - @ApiParam( + @Parameter( name = "id", - value = "id", - allowMultiple = false, - required = false) + description = "id") @QueryParam(value = "id") String id, - @ApiParam( + @Parameter( name = "typenames", - value = "typenames", - allowMultiple = false, - required = false) + description = "typenames") @QueryParam(value = "typenames") String typenames, - @ApiParam( + @Parameter( name = "startindex", - value = "startindex", - allowMultiple = false, - required = false) + description = "startindex") @QueryParam(value = "startindex") Integer startindex, - @ApiParam( + @Parameter( name = "count", - value = "count", - allowMultiple = false, - required = false) + description = "count") @QueryParam(value = "count") Integer count, - @ApiParam( + @Parameter( name = "valuereference", - value = "valuereference", - allowMultiple = false, - required = false) + description = "valuereference") @QueryParam(value = "valuereference") String valuereference, - @ApiParam( + @Parameter( name = "filter", - value = "filter", - allowMultiple = false, - required = false) + description = "filter") @QueryParam(value = "filter") String filter, - @ApiParam( + @Parameter( name = "resourceid", - value = "resourceid", - allowMultiple = false, - required = false) + description = "resourceid") @QueryParam(value = "resourceid") String resourceid, - @ApiParam( + @Parameter( name = "srsname", - value = "srsname", - allowMultiple = false, - required = false) + description = "srsname") @QueryParam(value = "srsname") String srsname, - @ApiParam( + @Parameter( name = "bbox", - value = "bbox", - allowMultiple = false, - required = false) + description = "bbox") @QueryParam(value = "bbox") String bbox, - @ApiParam( + @Parameter( name = "language", - value = "language", - allowMultiple = false, - required = false) + description = "language") @QueryParam(value = "language") String language, //header filters - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/describefeaturetype/DescribeFeatureTypeHandler.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/describefeaturetype/DescribeFeatureTypeHandler.java index 041d88e68..285011d17 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/describefeaturetype/DescribeFeatureTypeHandler.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/describefeaturetype/DescribeFeatureTypeHandler.java @@ -22,12 +22,12 @@ import io.arlas.server.core.exceptions.CollectionUnavailableException; import io.arlas.server.core.model.CollectionReference; import io.arlas.server.core.model.response.CollectionReferenceDescription; +import io.arlas.server.core.utils.ColumnFilterUtil; +import io.arlas.server.ogc.common.utils.XmlUtils; import io.arlas.server.ogc.wfs.WFSHandler; import io.arlas.server.ogc.wfs.utils.WFSConstant; -import io.arlas.server.ogc.common.utils.XmlUtils; -import io.arlas.server.core.utils.ColumnFilterUtil; +import jakarta.ws.rs.core.StreamingOutput; -import javax.ws.rs.core.StreamingOutput; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getcapabilities/GetCapabilitiesHandler.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getcapabilities/GetCapabilitiesHandler.java index 107fcbb59..d2d4a205a 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getcapabilities/GetCapabilitiesHandler.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getcapabilities/GetCapabilitiesHandler.java @@ -22,32 +22,31 @@ import eu.europa.ec.inspire.schemas.common._1.*; import eu.europa.ec.inspire.schemas.inspire_dls._1.ExtendedCapabilitiesType; +import io.arlas.commons.exceptions.ArlasException; import io.arlas.commons.utils.StringUtil; import io.arlas.server.core.app.InspireConfiguration; import io.arlas.server.core.app.OGCConfiguration; import io.arlas.server.core.app.WFSConfiguration; -import io.arlas.commons.exceptions.ArlasException; -import io.arlas.server.ogc.common.exceptions.OGC.OGCException; -import io.arlas.server.ogc.common.inspire.common.utils.InspireCheckParam; import io.arlas.server.core.model.CollectionReference; import io.arlas.server.core.model.DublinCoreElementName; import io.arlas.server.core.model.InspireConformity; import io.arlas.server.core.model.Keyword; -import io.arlas.server.ogc.common.inspire.common.constants.InspireConstants; -import io.arlas.server.core.model.enumerations.InspireSupportedLanguages; import io.arlas.server.core.model.enumerations.AccessConstraintEnum; +import io.arlas.server.core.model.enumerations.InspireSupportedLanguages; +import io.arlas.server.ogc.common.exceptions.OGC.OGCException; +import io.arlas.server.ogc.common.inspire.common.constants.InspireConstants; +import io.arlas.server.ogc.common.inspire.common.utils.InspireCheckParam; import io.arlas.server.ogc.common.model.Service; import io.arlas.server.ogc.wfs.WFSHandler; import io.arlas.server.ogc.wfs.utils.ExtendedWFSCapabilitiesType; import io.arlas.server.ogc.wfs.utils.WFSConstant; import io.arlas.server.ogc.wfs.utils.WFSRequestType; - +import jakarta.xml.bind.JAXBElement; import net.opengis.fes._2.*; import net.opengis.ows._1.*; import net.opengis.wfs._2.*; import org.w3._1999.xlink.TypeType; -import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import java.util.ArrayList; import java.util.Arrays; diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getfeature/GetFeatureHandler.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getfeature/GetFeatureHandler.java index af6c7d4b2..26f7d4a65 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getfeature/GetFeatureHandler.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/getfeature/GetFeatureHandler.java @@ -19,20 +19,20 @@ package io.arlas.server.ogc.wfs.operation.getfeature; -import io.arlas.server.core.app.OGCConfiguration; import io.arlas.commons.exceptions.ArlasException; +import io.arlas.server.core.app.OGCConfiguration; import io.arlas.server.core.impl.elastic.utils.GeoTypeMapper; import io.arlas.server.core.managers.CollectionReferenceManager; import io.arlas.server.core.model.response.CollectionReferenceDescription; +import io.arlas.server.core.utils.MapExplorer; import io.arlas.server.ogc.common.utils.GeoFormat; import io.arlas.server.ogc.common.utils.XmlUtils; import io.arlas.server.ogc.wfs.WFSHandler; import io.arlas.server.ogc.wfs.utils.WFSConstant; -import io.arlas.server.core.utils.MapExplorer; +import jakarta.ws.rs.WebApplicationException; +import jakarta.ws.rs.core.StreamingOutput; import org.geojson.GeoJsonObject; -import javax.ws.rs.WebApplicationException; -import javax.ws.rs.core.StreamingOutput; import javax.xml.namespace.QName; import javax.xml.stream.FactoryConfigurationError; import javax.xml.stream.XMLOutputFactory; diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/storedquery/ListStoredQueriesHandler.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/storedquery/ListStoredQueriesHandler.java index 32f49b78d..df260be04 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/storedquery/ListStoredQueriesHandler.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/operation/storedquery/ListStoredQueriesHandler.java @@ -20,10 +20,10 @@ package io.arlas.server.ogc.wfs.operation.storedquery; import io.arlas.server.ogc.wfs.WFSHandler; +import jakarta.xml.bind.JAXBElement; import net.opengis.wfs._2.ListStoredQueriesResponseType; import net.opengis.wfs._2.StoredQueryListItemType; -import javax.xml.bind.JAXBElement; import javax.xml.namespace.QName; import java.util.List; diff --git a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/utils/ExtendedWFSCapabilitiesType.java b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/utils/ExtendedWFSCapabilitiesType.java index 1e1a2614b..0e9af0e62 100644 --- a/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/utils/ExtendedWFSCapabilitiesType.java +++ b/ogc-wfs/src/main/java/io/arlas/server/ogc/wfs/utils/ExtendedWFSCapabilitiesType.java @@ -19,10 +19,13 @@ package io.arlas.server.ogc.wfs.utils; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlElementDecl; import net.opengis.wfs._2.WFSCapabilitiesType; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.*; import javax.xml.namespace.QName; // This class is added in order to add the xsi:schemaLocation namespace in WFS GetCapabilities Response diff --git a/openapi/swagger.json b/openapi/openapi.json similarity index 65% rename from openapi/swagger.json rename to openapi/openapi.json index 7baf296a8..c7d6b0fe9 100644 --- a/openapi/swagger.json +++ b/openapi/openapi.json @@ -1,9 +1,8 @@ { - "swagger" : "2.0", + "openapi" : "3.0.1", "info" : { + "title" : "ARLAS Server APIs", "description" : "Explore the content of ARLAS collections", - "version" : "23.0.1", - "title" : "ARLAS Exploration API", "contact" : { "name" : "Gisaia", "url" : "http://www.gisaia.com/", @@ -12,15 +11,24 @@ "license" : { "name" : "Apache 2.0", "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" - } + }, + "version" : "API_VERSION" }, - "basePath" : "/arlas", + "externalDocs" : { + "description" : "API documentation", + "url" : "https://docs.arlas.io/arlas-api/" + }, + "servers" : [ { + "url" : "/arlas", + "description" : "default server" + } ], "tags" : [ { - "name" : "collections" + "name" : "collections", + "description" : "Collections API" }, { - "name" : "explore" + "name" : "explore", + "description" : "Explore API" } ], - "schemes" : [ "http", "https" ], "paths" : { "/collections/{collection}" : { "get" : { @@ -28,39 +36,52 @@ "summary" : "Get a collection reference", "description" : "Get a collection reference in ARLAS", "operationId" : "get", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } } ], "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/CollectionReference" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionReference" + } + } } }, "404" : { "description" : "Collection not found.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -70,59 +91,80 @@ "summary" : "Add a collection reference", "description" : "Add a collection reference in ARLAS", "operationId" : "put", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "collectionParams", - "description" : "collectionParams", - "required" : true, "schema" : { - "$ref" : "#/definitions/CollectionReferenceParameters" + "type" : "string" } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } }, { "name" : "checkfields", "in" : "query", - "required" : false, - "type" : "boolean", - "default" : true + "schema" : { + "type" : "boolean", + "default" : true + } } ], + "requestBody" : { + "description" : "collectionParams", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionReferenceParameters" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/CollectionReference" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionReference" + } + } } }, "400" : { "description" : "JSON parameter malformed.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "404" : { "description" : "Not Found Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -132,39 +174,85 @@ "summary" : "Delete a collection reference", "description" : "Delete a collection reference in ARLAS", "operationId" : "delete", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } } ], "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/Success" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Success" + } + } } }, "404" : { "description" : "Collection not found.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/collections/_export" : { + "get" : { + "tags" : [ "collections" ], + "summary" : "Get all collection references as a json file", + "description" : "Get all collection references in ARLAS as json file", + "operationId" : "exportCollections", + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CollectionReference" + } + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -176,88 +264,159 @@ "summary" : "Get all collection references", "description" : "Get all collection references in ARLAS", "operationId" : "getAll", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } } ], "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/CollectionReference" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/CollectionReference" + } + } } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } } }, - "/collections/_export" : { - "get" : { + "/collections/_import" : { + "post" : { "tags" : [ "collections" ], - "summary" : "Get all collection references as a json file", - "description" : "Get all collection references in ARLAS as json file", - "operationId" : "exportCollections", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ ], + "summary" : "Add collection references from a json file", + "description" : "Add collection references in ARLAS from a json file", + "operationId" : "importCollections", + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "type" : "object", + "properties" : { + "file" : { + "$ref" : "#/components/schemas/FormDataContentDisposition" + } + } + } + } + } + }, "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/CollectionReference" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "type" : "string" + } } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } } }, - "/collections/_import" : { - "post" : { + "/collections/{collection}/organisations" : { + "patch" : { "tags" : [ "collections" ], - "summary" : "Add collection references from a json file", - "description" : "Add collection references in ARLAS from a json file", - "operationId" : "importCollections", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json;charset=utf-8" ], + "summary" : "Update a collection reference's organisations attribute.", + "description" : "Update a collection reference's organisations attribute.", + "operationId" : "patch", "parameters" : [ { - "name" : "file", - "in" : "formData", - "required" : false, - "type" : "file" + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "pretty", + "in" : "query", + "description" : "Pretty print", + "schema" : { + "type" : "boolean", + "default" : false + } } ], + "requestBody" : { + "description" : "collectionParamsUpdate", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionReferenceUpdate" + } + } + }, + "required" : true + }, "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "type" : "string" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionReference" + } + } + } + }, + "400" : { + "description" : "JSON parameter malformed.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "404" : { + "description" : "Collection not found.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -269,96 +428,116 @@ "summary" : "Aggregate", "description" : "Aggregate the elements in the collection(s), given the filters and the aggregation parameters", "operationId" : "aggregate", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "agg", "in" : "query", "description" : "- The agg parameter should be given in the following formats: \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:fetch_hits-{fetch_hits values} \n \nWhere :\n \n - **{type}:{field}** part is mandatory. \n \n - **interval** must be specified only when aggregation type is datehistogram, histogram, geotile and geohash.\n \n - **format** is optional for datehistogram, and must not be specified for the other types.\n \n - (**collect_field**,**collect_fct**) couple is optional for all aggregation types. \n \n - It's possible to apply multiple metric aggregations by defining multiple (**collect_field**,**collect_fct**) couples.\n \n - (**collect_field**,**collect_fct**) couples should be unique in that case.\n \n - (**order**,**on**) couple is optional for all aggregation types.\n \n - **size** is optional for term and geohash/geotile, and must not be specified for the other types.\n \n - **include** is optional for term, and must not be specified for the other types.\n \n- {type} possible values are : \n \n datehistogram, histogram, geohash, geotile and term. \n \n- {interval} possible values depends on {type}. \n \n If {type} = datehistogram, then {interval} = {size}(year,quarter,month,week,day,hour,minute,second). Size value must be equal to 1 for year,quarter,month and week unities. \n \n If {type} = histogram, then {interval} = {size}. \n \n If {type} = geohash, then {interval} = {size}. It's an integer between 1 and 12. Lower the length, greater is the surface of aggregation. \n \n If {type} = geotile, then {interval} = {size}. It's an integer corresponding to zoom level of the aggregation, that should be larger than or equal to {z} in the path param, and no bigger than {z}+6. \n \n If {type} = term, then interval-{interval} is not needed. \n \n- format-{format} is the date format for key aggregation. The default value is yyyy-MM-dd-hh:mm:ss.\n \n- {collect_fct} is the aggregation function to apply to collections on the specified {collect_field}. \n \n {collect_fct} possible values are : \n \n avg,cardinality,max,min,sum\n \n- {order} is set to sort the aggregation buckets on the field name, on the count of the buckets or on the the result of a metric sub-aggregation. Its values are 'asc' or 'desc'. \n \n- {on} is set to specify whether the {order} is on the field name, on the count of the aggregation or on the result of a metric sub-aggregation. Its values are 'field', 'count' or 'result'. \n \n- If {on} is equal to `result` and two or more (**collect_field**,**collect_fct**) couples are specified, then the order is applied on the first `collect_fct` that is different from geobbox and geocentroid\n \n- {size} Defines how many buckets should be returned. \n \n- {include} Specifies the values for which buckets will be created. This values are comma separated. If one value is specified then regular expressions can be used (only in this case) and buckets matching them will be created. If more than one value are specified then only buckets matching the exact values will be created.\n \n- **aggregated_geometries**\n \n > **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.\n \n > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.\n \n > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.\n \n - **centroid**: returns the centroid of data inside the bucket.\n \n - **bbox**: returns the data extent (bbox) in each bucket.\n \n - **cell**: returns the cell extent (zxy or geohash) of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n > __**Response**__: the aggregated geometries are returned in `geometries` list in the json response. Each object inside this list has : the reference to the aggregated form, the geojson geometry and an attribute `is_raw` set to false\n \n > __**Example**__: `aggregated_geometries-bbox,cell`\n \n- **raw_geometries**\n \n > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort\n \n > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.\n \n > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.\n \n - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied\n \n - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending\n \n > __**Response**__: the aggregated geometries are returned in `geometries` list in the json response. Each object inside this list has : the reference to the geometry path, the used sort, the geojson geometry and an attribute `is_raw` set to true\n \n > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3)\n \n- **fetch_hits** \n \n > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.\n \n > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.\n \n > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.\n \n > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.\n \n > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.\n \n**agg** parameter is multiple. Every agg parameter specified is a subaggregation of the previous one : order matters. \n \nFor more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md.", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.\n \n > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.\n \n > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.\n \n - **centroid**: returns the centroid of data inside the bucket.\n \n - **bbox**: returns the data extent (bbox) in each bucket.\n \n - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which aggregated form is returned \n \n - **geometry_type** attribute set to *aggregated*\n \n > __**Example**__: `aggregated_geometries-bbox,geohash`\n \n- **raw_geometries**\n \n > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort\n \n > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.\n \n > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.\n \n - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied\n \n - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending\n \n > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which geometry path is returned \n \n - **geometry_type** attribute set to *raw*\n \n - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)\n \n > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3)\n \n- **fetch_hits** \n \n > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.\n \n > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.\n \n > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.\n \n > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.\n \n > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.\n \n**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md ", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.\n \n > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.\n \n > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.\n \n - **centroid**: returns the centroid of data inside the bucket.\n \n - **bbox**: returns the data extent (bbox) in each bucket.\n \n - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which aggregated form is returned \n \n - **geometry_type** attribute set to *aggregated*\n \n > __**Example**__: `aggregated_geometries-bbox,geohash`\n \n- **raw_geometries**\n \n > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort\n \n > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.\n \n > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.\n \n - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied\n \n - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending\n \n > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which geometry path is returned \n \n - **geometry_type** attribute set to *raw*\n \n - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)\n \n > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3)\n \n- **fetch_hits** \n \n > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.\n \n > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.\n \n > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.\n \n > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.\n \n > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.\n \n**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md ", - "required" : false, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.\n \n > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.\n \n > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.\n \n - **centroid**: returns the centroid of data inside the bucket.\n \n - **bbox**: returns the data extent (bbox) in each bucket.\n \n - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which aggregated form is returned \n \n - **geometry_type** attribute set to *aggregated*\n \n > __**Example**__: `aggregated_geometries-bbox,geohash`\n \n- **raw_geometries**\n \n > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort\n \n > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.\n \n > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.\n \n - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied\n \n - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending\n \n > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which geometry path is returned \n \n - **geometry_type** attribute set to *raw*\n \n - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)\n \n > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3)\n \n- **fetch_hits** \n \n > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.\n \n > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.\n \n > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.\n \n > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.\n \n > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.\n \n**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md ", - "required" : false, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min **What it does**: Allows to specify a list of aggregated forms of geometries that represent the bucket.\n \n > __**Syntax**__: `aggregated_geometries-{COMMA_SEPARATED_AGGREGATED_GEOMETRIES}`.\n \n > __**Available aggregated geometries**__: `centroid, bbox, cell, cell_center`.\n \n - **centroid**: returns the centroid of data inside the bucket.\n \n - **bbox**: returns the data extent (bbox) in each bucket.\n \n - **cell**: returns the cell (zxy or geohash) extent of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n - **cell_center**: returns the cell center of each bucket. This form is supported for **geohash** and **geotile** aggregation type only.\n \n > __**Response**__: Each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified aggregated geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which aggregated form is returned \n \n - **geometry_type** attribute set to *aggregated*\n \n > __**Example**__: `aggregated_geometries-bbox,geohash`\n \n- **raw_geometries**\n \n > **What it does**: Allows to specify a list of raw geometries provided by hits that represent the bucket and that are elected by a sort\n \n > __**Syntax**__: `raw_geometries-{GEOMETRY_FIELD}({COMMA_SEPERATED_SORT_FIELDS});{GEOMETRY_FIELD2}({COMMA_SEPERATED_SORT_FIELDS2})`.\n \n > __**Available raw geometries**__: any field of the collection whose type is **geo-point** or **geo-shape**.\n \n - sort fields are optional. If no sort is specified, an ascending sort on `collection.params.timestamp_path` is applied\n \n - a sort field can be preceded by '-' for descending sort. Otherwise the sort is ascending\n \n > __**Response**__: each bucket of the aggregation will be represented with as many features (in a feature collection) as there are specified raw geometries. The properties of each feature has :\n \n - **geometry_ref** attribute that informs which geometry path is returned \n \n - **geometry_type** attribute set to *raw*\n \n - **geometry_sort** attribute that informs how the geometry path is fetched (with what sort)\n \n > __**Example**__: `raw_geometries-geo_field1,geo_field2 || raw_geometries-geo_field(-field1,field2)` || raw_geometries-geo_field1(field1);geo_field2(field2,field3)\n \n- **fetch_hits** \n \n > **What it does**: Specifies the number of hits to retrieve inside each aggregation bucket and which fields to include in the hits.\n \n > __**Syntax**__: `fetch_hits-{sizeOfHitsToFetch}(+{field1}, {field2}, -{field3}, ...)`.\n \n > **Note 1**: `{sizeOfHitsToFetch}` is optional, if not specified, 1 is considered as default.\n \n > **Note 2**: `{field}` can be preceded by **+** or **-** for **ascending** or **descending** sort of the hits. Order matters.\n \n > __**Example**__: `fetch_hits-3(-timestamp, geometry)`. Fetches the 3 last positions for each bucket.\n \n**agg** parameter is multiple. The first (main) aggregation must be geohash or geotile. Every agg parameter specified is a subaggregation of the previous one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md ", "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", - "required" : false, - "type" : "array", - "items" : { + "style" : "form", + "schema" : { "type" : "string" - }, - "collectionFormat" : "multi" + } }, { "name" : "after", "in" : "query", "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "before", "in" : "query", "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/FeatureCollection" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/FeatureCollection" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } - } - }, - "/explore/{collection}/_geosearch" : { - "get" : { + }, + "post" : { "tags" : [ "explore" ], "summary" : "GeoSearch", "description" : "Search and return the elements found in the collection(s) as features, given the filters", - "operationId" : "geosearch", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], + "operationId" : "geosearchPost", "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" - }, { - "name" : "f", - "in" : "query", - "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", - "required" : false, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" - }, { - "name" : "after", - "in" : "query", - "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", - "required" : false, - "type" : "string" - }, { - "name" : "before", - "in" : "query", - "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", - "required" : false, - "type" : "string" - }, { - "name" : "max-age-cache", + "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" - } ], - "responses" : { - "200" : { - "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/FeatureCollection" - } - }, - "500" : { - "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" - } - }, - "400" : { - "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" - } - } - } - }, - "post" : { - "tags" : [ "explore" ], - "summary" : "GeoSearch", - "description" : "Search and return the elements found in the collection(s) as features, given the filters", - "operationId" : "geosearchPost", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], - "parameters" : [ { - "name" : "collection", - "in" : "path", - "description" : "collection", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "required" : false, "schema" : { - "$ref" : "#/definitions/Search" + "type" : "integer", + "format" : "int32" } - }, { - "name" : "pretty", - "in" : "query", - "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false - }, { - "name" : "max-age-cache", - "in" : "query", - "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" } ], + "requestBody" : { + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Search" + } + } + } + }, "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/FeatureCollection" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/FeatureCollection" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -1847,126 +2160,133 @@ "summary" : "ShapeSearch", "description" : "Search and return the elements found in the collection(s) as features, given the filters, exported as a Shapefile", "operationId" : "shapesearch", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/zip" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", - "required" : false, - "type" : "array", - "items" : { + "style" : "form", + "schema" : { "type" : "string" - }, - "collectionFormat" : "multi" + } }, { "name" : "after", "in" : "query", "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "before", "in" : "query", "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { @@ -1974,14 +2294,22 @@ }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/zip" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/zip" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -1991,202 +2319,453 @@ "summary" : "ShapeSearch", "description" : "Search and return the elements found in the collection(s) as features, given the filters, exported as a Shapefile", "operationId" : "shapesearchPost", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/zip" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "required" : false, "schema" : { - "$ref" : "#/definitions/Search" + "type" : "string" } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], + "requestBody" : { + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Search" + } + } + } + }, "responses" : { "200" : { "description" : "Successful operation" }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/zip" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/zip" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } } }, - "/explore/{collection}/_search" : { + "/explore/{collection}/_geosearch/{z}/{x}/{y}" : { "get" : { "tags" : [ "explore" ], - "summary" : "Search", - "description" : "Search and return the elements found in the collection, given the filters", - "operationId" : "search", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8", "application/atom+xml" ], + "summary" : "Tiled GeoSearch", + "description" : "Search and return the elements found in the collection(s) and localized in the given tile(x,y,z) as features, given the filters", + "operationId" : "tiledgeosearch", "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } + }, { + "name" : "x", + "in" : "path", + "description" : "x", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "y", + "in" : "path", + "description" : "y", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "z", + "in" : "path", + "description" : "z", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", - "required" : false, - "type" : "string" + "style" : "form", + "schema" : { + "type" : "string" + } }, { "name" : "after", "in" : "query", "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "before", "in" : "query", "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } + }, { + "name" : "max-age-cache", + "in" : "query", + "description" : "max-age-cache", + "schema" : { + "type" : "integer", + "format" : "int32" + } + } ], + "responses" : { + "200" : { + "description" : "Successful operation", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/FeatureCollection" + } + } + } + }, + "500" : { + "description" : "Arlas Server Error.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + }, + "400" : { + "description" : "Bad request.", + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/explore/{collection}/_search" : { + "get" : { + "tags" : [ "explore" ], + "summary" : "Search", + "description" : "Search and return the elements found in the collection, given the filters", + "operationId" : "search", + "parameters" : [ { + "name" : "collection", + "in" : "path", + "description" : "collection", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "f", + "in" : "query", + "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", + "schema" : { + "type" : "string" + } + }, { + "name" : "after", + "in" : "query", + "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", + "schema" : { + "type" : "string" + } + }, { + "name" : "before", + "in" : "query", + "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", + "schema" : { + "type" : "string" + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/Hits" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Hits" + } + }, + "application/atom+xml" : { + "schema" : { + "$ref" : "#/components/schemas/Hits" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/atom+xml" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + }, + "application/atom+xml" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -2196,53 +2775,69 @@ "summary" : "Search", "description" : "Search and return the elements found in the collection, given the filters", "operationId" : "searchPost", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "required" : false, "schema" : { - "$ref" : "#/definitions/Search" + "type" : "string" } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], + "requestBody" : { + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Search" + } + } + } + }, "responses" : { "200" : { "description" : "Successful operation", - "schema" : { - "$ref" : "#/definitions/Hits" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Hits" + } + } } }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "application/json;charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } @@ -2254,69 +2849,76 @@ "summary" : "Suggest", "description" : "Suggest the the n (n=size) most relevant terms given the filters", "operationId" : "suggest", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "application/json;charset=utf-8" ], "parameters" : [ { "name" : "collections", "in" : "path", "description" : "collections, comma separated", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided. The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator | Description | value type\n \n : | {fieldName} equals {value} | numeric or strings \n \n :gte: | {fieldName} is greater than or equal to {value} | numeric \n \n :gt: | {fieldName} is greater than {value} | numeric \n \n :lte: | {fieldName} is less than or equal to {value} | numeric \n \n :lt: | {fieldName} is less than {value} | numeric \n \n\n \n- The AND operator is applied between filters having different fieldNames. \n \n- The OR operator is applied on filters having the same fieldName. \n \n- If the fieldName starts with - then a must not filter is used\n \n- If the fieldName starts with - then a must not filter is used\n \nFor more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md ", - "required" : false, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "multi" + "style" : "form", + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } }, { "name" : "q", "in" : "query", "description" : "A full text search", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "pretty", "in" : "query", "description" : "Pretty print", - "required" : false, - "type" : "boolean", - "default" : false + "schema" : { + "type" : "boolean", + "default" : false + } }, { "name" : "size", "in" : "query", "description" : "The maximum number of entries or sub-entries to be returned. The default value is 10", - "required" : false, - "type" : "integer", - "default" : 10, - "minimum" : 1, - "format" : "int32" + "schema" : { + "minimum" : 1, + "type" : "integer", + "format" : "int64", + "default" : 10 + } }, { "name" : "from", "in" : "query", "description" : "From index to start the search from. Defaults to 0.", - "required" : false, - "type" : "integer", - "default" : 0, - "minimum" : 1, - "format" : "int32" + "schema" : { + "minimum" : 1, + "type" : "integer", + "format" : "int64", + "default" : 0 + } }, { "name" : "field", "in" : "query", "description" : "Name of the field to be used for retrieving the most relevant terms", - "required" : false, - "type" : "string", - "default" : "_all" + "schema" : { + "type" : "string", + "default" : "_all" + } }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { @@ -2331,128 +2933,145 @@ "summary" : "Tiled GeoSearch", "description" : "Search and return the elements found in the collection(s) and localized in the given tile(x,y,z) as features, given the filters", "operationId" : "tiledgeosearch_1", - "consumes" : [ "application/json;charset=utf-8" ], - "produces" : [ "image/png" ], "parameters" : [ { "name" : "collection", "in" : "path", "description" : "collection", "required" : true, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "x", "in" : "path", "description" : "x", "required" : true, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } }, { "name" : "y", "in" : "path", "description" : "y", "required" : true, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } }, { "name" : "z", "in" : "path", "description" : "z", "required" : true, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } }, { "name" : "f", "in" : "query", "description" : "- A triplet for filtering the result. Multiple filter can be provided in distinct parameters (AND operator is applied) or in the same parameter separated by semi-colons (OR operator is applied). The order does not matter. \n \n- A triplet is composed of a field name, a comparison operator and a value. \n \n The possible values of the comparison operator are : \n \n Operator -- Description -- value type\n \n :eq: -- {fieldName} equals {comma separated values}. **OR** operation is applied for the specified values -- numeric or strings \n \n :ne: -- {fieldName} must not equal {comma separated values }. **AND** operation is applied for the specified values -- numeric or strings \n \n :like: -- {fieldName} is like {value} -- numeric or strings \n \n :gte: -- {fieldName} is greater than or equal to {value} -- numeric \n \n :gt: -- {fieldName} is greater than {value} -- numeric \n \n :lte: -- {fieldName} is less than or equal to {value} -- numeric \n \n :lt: -- {fieldName} is less than {value} -- numeric \n \n :range: -- {fieldName} is between `{comma separated [min __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat} {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'** for **descending** sort. By default, sort is ascending.\n \n> **Note 2**: The order of fields matters.\n \n> **Note 3** ***geodistance sort***: Sorts the hits centroids by distance to the given **{lat} {lon}** (ascending distance sort). It can be specified at most 1 time.\n \n> __**Example 1**__: sort=`age,-timestamp`. Resulted hits are sorted by age. For same age hits, they are decreasingly sorted in time.\n \n> __**Example 2**__: sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same age hits, they are sorted by closest distance to the point(89°,179°)\n \n", - "required" : false, - "type" : "array", - "items" : { + "style" : "form", + "schema" : { "type" : "string" - }, - "collectionFormat" : "multi" + } }, { "name" : "after", "in" : "query", "description" : "List of values of fields present in sort param that are used to search after. \n \n> **What it does**: Retrieve the data placed after the pointed element, given the provided order (sort).\n \n> __**Restriction 1**__: **after** param works only combined with **sort** param.\n \n> __**Syntax**__: `after={value1},{value2},...,{valueN} & sort={field1},{field2},...,{fieldN}`.\n \n> **Note 1**: *{value1}` and `{value2}` are the values of `{field1}` and `{field2}` in the last hit returned in the previous search\n \n> **Note 2**: The order of fields and values matters. *{value1},{value2}* must be in the same order of *{field1},{field2}* in **sort** param\n \n> **Note 3**: The last field `{fieldN}` must be the id field specified in the collection **collection.params.idPath** (returned as **md.id**) and `{valueN}` its corresponding value.\n \n> __**Example**__: *sort=`-date,id` & **after**=`01/02/2019,abcd1234`*. Gets the following hits of the previous search that stopped at date *01/02/2019* and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be set to 0 or kept unset\n \n", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "before", "in" : "query", "description" : "Same idea that after param, but to retrieve the data placed before the pointed element, given the provided order (sort).", - "required" : false, - "type" : "string" + "schema" : { + "type" : "string" + } }, { "name" : "sampling", "in" : "query", "description" : "Size of the sampling for testing transparency: 1: test every pixel, 10: test 1 pixel every 10 pixels, etc.", - "required" : false, - "type" : "integer", - "default" : 10, - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } }, { "name" : "coverage", "in" : "query", "description" : "Percentage (]0-100]) of acceptable transparent pixels. Higher the percentage, more tiles could be used for filling the tile", - "required" : false, - "type" : "integer", - "default" : 70, - "format" : "int32" - }, { + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 70 + } + }, { "name" : "max-age-cache", "in" : "query", "description" : "max-age-cache", - "required" : false, - "type" : "integer", - "format" : "int32" + "schema" : { + "type" : "integer", + "format" : "int32" + } } ], "responses" : { "200" : { @@ -2460,1218 +3079,1315 @@ }, "500" : { "description" : "Arlas Server Error.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "image/png" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } }, "400" : { "description" : "Bad request.", - "schema" : { - "$ref" : "#/definitions/Error" + "content" : { + "image/png" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } } } } } } }, - "definitions" : { - "Bbox" : { - "type" : "object", - "required" : [ "east", "north", "south", "west" ], - "properties" : { - "north" : { - "type" : "number", - "format" : "double" - }, - "south" : { - "type" : "number", - "format" : "double" - }, - "east" : { - "type" : "number", - "format" : "double" - }, - "west" : { - "type" : "number", - "format" : "double" - } - } - }, - "CollectionDisplayNames" : { - "type" : "object", - "properties" : { - "collection" : { - "type" : "string" - }, - "fields" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "shape_columns" : { - "type" : "object", - "additionalProperties" : { + "components" : { + "schemas" : { + "Success" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "integer", + "format" : "int32" + }, + "message" : { "type" : "string" } } - } - }, - "CollectionOrganisations" : { - "type" : "object", - "properties" : { - "owner" : { - "type" : "string" - }, - "shared" : { - "type" : "array", - "items" : { + }, + "Error" : { + "type" : "object", + "properties" : { + "status" : { + "type" : "integer", + "format" : "int32" + }, + "message" : { + "type" : "string" + }, + "error" : { "type" : "string" } - }, - "public" : { - "type" : "boolean" } - } - }, - "CollectionReference" : { - "type" : "object", - "required" : [ "collection_name", "params" ], - "properties" : { - "collection_name" : { - "type" : "string" - }, - "params" : { - "$ref" : "#/definitions/CollectionReferenceParameters" + }, + "Bbox" : { + "required" : [ "east", "north", "south", "west" ], + "type" : "object", + "properties" : { + "north" : { + "type" : "number", + "format" : "double" + }, + "south" : { + "type" : "number", + "format" : "double" + }, + "east" : { + "type" : "number", + "format" : "double" + }, + "west" : { + "type" : "number", + "format" : "double" + } } - } - }, - "CollectionReferenceParameters" : { - "type" : "object", - "required" : [ "centroid_path", "geometry_path", "id_path", "index_name", "timestamp_path" ], - "properties" : { - "index_name" : { - "type" : "string" - }, - "id_path" : { - "type" : "string" - }, - "geometry_path" : { - "type" : "string" - }, - "centroid_path" : { - "type" : "string" - }, - "h3_path" : { - "type" : "string" - }, - "timestamp_path" : { - "type" : "string" - }, - "exclude_fields" : { - "type" : "string" - }, - "update_max_hits" : { - "type" : "integer", - "format" : "int32" - }, - "taggable_fields" : { - "type" : "string" - }, - "exclude_wfs_fields" : { - "type" : "string" - }, - "custom_params" : { - "type" : "object", - "additionalProperties" : { + }, + "CollectionDisplayNames" : { + "type" : "object", + "properties" : { + "collection" : { "type" : "string" + }, + "fields" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "shape_columns" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } } - }, - "display_names" : { - "$ref" : "#/definitions/CollectionDisplayNames" - }, - "organisations" : { - "$ref" : "#/definitions/CollectionOrganisations" - }, - "atom_feed" : { - "$ref" : "#/definitions/Feed" - }, - "open_search" : { - "$ref" : "#/definitions/OpenSearch" - }, - "inspire" : { - "$ref" : "#/definitions/Inspire" - }, - "dublin_core_element_name" : { - "$ref" : "#/definitions/DublinCoreElementName" - }, - "raster_tile_url" : { - "$ref" : "#/definitions/RasterTileURL" - }, - "raster_tile_width" : { - "type" : "integer", - "format" : "int32" - }, - "raster_tile_height" : { - "type" : "integer", - "format" : "int32" - }, - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "license_name" : { - "type" : "string" - }, - "license_urls" : { - "type" : "array", - "items" : { + } + }, + "CollectionOrganisations" : { + "type" : "object", + "properties" : { + "owner" : { "type" : "string" + }, + "shared" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "public" : { + "type" : "boolean" } } - } - }, - "DublinCoreElementName" : { - "type" : "object", - "properties" : { - "title" : { - "type" : "string" - }, - "creator" : { - "type" : "string" - }, - "subject" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "publisher" : { - "type" : "string" - }, - "contributor" : { - "type" : "string" - }, - "type" : { - "type" : "string" - }, - "format" : { - "type" : "string" - }, - "identifier" : { - "type" : "string" - }, - "source" : { - "type" : "string" - }, - "language" : { - "type" : "string" - }, - "bbox" : { - "$ref" : "#/definitions/Bbox" - }, - "date" : { - "type" : "string" - }, - "coverage" : { - "type" : "object", - "additionalProperties" : { - "type" : "object" + }, + "CollectionReference" : { + "required" : [ "collection_name", "params" ], + "type" : "object", + "properties" : { + "collection_name" : { + "type" : "string" + }, + "params" : { + "$ref" : "#/components/schemas/CollectionReferenceParameters" } - }, - "coverage_centroid" : { - "type" : "string" - } - } - }, - "Expression" : { - "type" : "object", - "properties" : { - "field" : { - "type" : "string" - }, - "op" : { - "type" : "string", - "enum" : [ "eq", "gte", "gt", "lte", "lt", "like", "ne", "range", "within", "notwithin", "intersects", "notintersects" ] - }, - "value" : { - "type" : "string" - } - } - }, - "Feed" : { - "type" : "object", - "properties" : { - "author" : { - "$ref" : "#/definitions/Person" - }, - "contributor" : { - "$ref" : "#/definitions/Person" - }, - "icon" : { - "type" : "string" - }, - "logo" : { - "type" : "string" - }, - "rights" : { - "type" : "string" - }, - "subtitle" : { - "type" : "string" - }, - "generator" : { - "$ref" : "#/definitions/Generator" } - } - }, - "Filter" : { - "type" : "object", - "properties" : { - "f" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Expression" + }, + "CollectionReferenceParameters" : { + "required" : [ "centroid_path", "geometry_path", "id_path", "index_name", "timestamp_path" ], + "type" : "object", + "properties" : { + "index_name" : { + "type" : "string" + }, + "id_path" : { + "type" : "string" + }, + "geometry_path" : { + "type" : "string" + }, + "centroid_path" : { + "type" : "string" + }, + "timestamp_path" : { + "type" : "string" + }, + "exclude_fields" : { + "type" : "string" + }, + "update_max_hits" : { + "type" : "integer", + "format" : "int32" + }, + "taggable_fields" : { + "type" : "string" + }, + "exclude_wfs_fields" : { + "type" : "string" + }, + "custom_params" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" } - } - }, - "q" : { - "type" : "array", - "items" : { + }, + "display_names" : { + "$ref" : "#/components/schemas/CollectionDisplayNames" + }, + "organisations" : { + "$ref" : "#/components/schemas/CollectionOrganisations" + }, + "atom_feed" : { + "$ref" : "#/components/schemas/Feed" + }, + "open_search" : { + "$ref" : "#/components/schemas/OpenSearch" + }, + "inspire" : { + "$ref" : "#/components/schemas/Inspire" + }, + "dublin_core_element_name" : { + "$ref" : "#/components/schemas/DublinCoreElementName" + }, + "raster_tile_url" : { + "$ref" : "#/components/schemas/RasterTileURL" + }, + "raster_tile_width" : { + "type" : "integer", + "format" : "int32" + }, + "raster_tile_height" : { + "type" : "integer", + "format" : "int32" + }, + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "license_name" : { + "type" : "string" + }, + "license_urls" : { "type" : "array", "items" : { "type" : "string" } } - }, - "dateformat" : { - "type" : "string" - }, - "righthand" : { - "type" : "boolean" } - } - }, - "Generator" : { - "type" : "object", - "properties" : { - "name" : { - "type" : "string" - }, - "version" : { - "type" : "string" - }, - "uri" : { - "type" : "string" - } - } - }, - "Inspire" : { - "type" : "object", - "properties" : { - "keywords" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Keyword" - } - }, - "topic_categories" : { - "type" : "array", - "items" : { + }, + "DublinCoreElementName" : { + "type" : "object", + "properties" : { + "title" : { "type" : "string" - } - }, - "lineage" : { - "type" : "string" - }, - "languages" : { - "type" : "array", - "items" : { + }, + "creator" : { + "type" : "string" + }, + "subject" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "publisher" : { + "type" : "string" + }, + "contributor" : { + "type" : "string" + }, + "type" : { + "type" : "string" + }, + "format" : { + "type" : "string" + }, + "identifier" : { + "type" : "string" + }, + "source" : { + "type" : "string" + }, + "language" : { + "type" : "string" + }, + "bbox" : { + "$ref" : "#/components/schemas/Bbox" + }, + "date" : { + "type" : "string" + }, + "coverage" : { + "type" : "object" + }, + "coverage_centroid" : { "type" : "string" } - }, - "spatial_resolution" : { - "$ref" : "#/definitions/InspireSpatialResolution" - }, - "inspire_uri" : { - "$ref" : "#/definitions/InspireURI" - }, - "inspire_limitation_access" : { - "$ref" : "#/definitions/InspireLimitationAccess" - }, - "inspire_use_conditions" : { - "type" : "string" } - } - }, - "InspireLimitationAccess" : { - "type" : "object", - "properties" : { - "access_constraints" : { - "type" : "string" - }, - "other_constraints" : { - "type" : "string" - }, - "classification" : { - "type" : "string" + }, + "Expression" : { + "type" : "object", + "properties" : { + "field" : { + "type" : "string" + }, + "op" : { + "type" : "string", + "enum" : [ "eq", "gte", "gt", "lte", "lt", "like", "ne", "range", "within", "notwithin", "intersects", "notintersects" ] + }, + "value" : { + "type" : "string" + } } - } - }, - "InspireSpatialResolution" : { - "type" : "object", - "properties" : { - "value" : { - "$ref" : "#/definitions/Number" - }, - "unit_of_measure" : { - "type" : "string" + }, + "Feed" : { + "type" : "object", + "properties" : { + "author" : { + "$ref" : "#/components/schemas/Person" + }, + "contributor" : { + "$ref" : "#/components/schemas/Person" + }, + "icon" : { + "type" : "string" + }, + "logo" : { + "type" : "string" + }, + "rights" : { + "type" : "string" + }, + "subtitle" : { + "type" : "string" + }, + "generator" : { + "$ref" : "#/components/schemas/Generator" + } } - } - }, - "InspireURI" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "string" - }, - "namespace" : { - "type" : "string" + }, + "Filter" : { + "type" : "object", + "properties" : { + "f" : { + "type" : "array", + "items" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "$ref" : "#/components/schemas/Expression" + } + } + }, + "q" : { + "type" : "array", + "items" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } + }, + "items" : { + "type" : "string" + } + } + }, + "dateformat" : { + "type" : "string" + }, + "righthand" : { + "type" : "boolean" + } } - } - }, - "Keyword" : { - "type" : "object", - "properties" : { - "value" : { - "type" : "string" - }, - "vocabulary" : { - "type" : "string" - }, - "date_of_publication" : { - "type" : "string" + }, + "Generator" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "version" : { + "type" : "string" + }, + "uri" : { + "type" : "string" + } } - } - }, - "Number" : { - "type" : "object" - }, - "OpenSearch" : { - "type" : "object", - "properties" : { - "short_name" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "contact" : { - "type" : "string" - }, - "tags" : { - "type" : "string" - }, - "long_name" : { - "type" : "string" - }, - "image_height" : { - "type" : "string" - }, - "image_width" : { - "type" : "string" - }, - "image_type" : { - "type" : "string" - }, - "image_url" : { - "type" : "string" - }, - "developer" : { - "type" : "string" - }, - "attribution" : { - "type" : "string" - }, - "syndication_right" : { - "type" : "string" - }, - "adult_content" : { - "type" : "string" - }, - "language" : { - "type" : "string" - }, - "input_encoding" : { - "type" : "string" - }, - "output_encoding" : { - "type" : "string" + }, + "Inspire" : { + "type" : "object", + "properties" : { + "keywords" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Keyword" + } + }, + "topic_categories" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "lineage" : { + "type" : "string" + }, + "languages" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "spatial_resolution" : { + "$ref" : "#/components/schemas/InspireSpatialResolution" + }, + "inspire_uri" : { + "$ref" : "#/components/schemas/InspireURI" + }, + "inspire_limitation_access" : { + "$ref" : "#/components/schemas/InspireLimitationAccess" + }, + "inspire_use_conditions" : { + "type" : "string" + } } - } - }, - "Person" : { - "type" : "object", - "properties" : { - "name" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "uri" : { - "type" : "string" + }, + "InspireLimitationAccess" : { + "type" : "object", + "properties" : { + "access_constraints" : { + "type" : "string" + }, + "other_constraints" : { + "type" : "string" + }, + "classification" : { + "type" : "string" + } } - } - }, - "RasterTileURL" : { - "type" : "object", - "required" : [ "id_path", "url" ], - "properties" : { - "url" : { - "type" : "string" - }, - "id_path" : { - "type" : "string" - }, - "min_z" : { - "type" : "integer", - "format" : "int32" - }, - "max_z" : { - "type" : "integer", - "format" : "int32" - }, - "check_geometry" : { - "type" : "boolean" + }, + "InspireSpatialResolution" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "number" + }, + "unit_of_measure" : { + "type" : "string" + } } - } - }, - "Error" : { - "type" : "object", - "properties" : { - "status" : { - "type" : "integer", - "format" : "int32" + }, + "InspireURI" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "string" + }, + "namespace" : { + "type" : "string" + } + } + }, + "JSONObject" : { + "type" : "object" + }, + "Keyword" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "string" + }, + "vocabulary" : { + "type" : "string" + }, + "date_of_publication" : { + "type" : "string" + } + } + }, + "MultiValueFilterExpression" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } }, - "message" : { - "type" : "string" + "items" : { + "$ref" : "#/components/schemas/Expression" + } + }, + "MultiValueFilterString" : { + "type" : "array", + "properties" : { + "empty" : { + "type" : "boolean" + } }, - "error" : { + "items" : { "type" : "string" } - } - }, - "Success" : { - "type" : "object", - "properties" : { - "status" : { - "type" : "integer", - "format" : "int32" + }, + "OpenSearch" : { + "type" : "object", + "properties" : { + "short_name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "contact" : { + "type" : "string" + }, + "tags" : { + "type" : "string" + }, + "long_name" : { + "type" : "string" + }, + "image_height" : { + "type" : "string" + }, + "image_width" : { + "type" : "string" + }, + "image_type" : { + "type" : "string" + }, + "image_url" : { + "type" : "string" + }, + "developer" : { + "type" : "string" + }, + "attribution" : { + "type" : "string" + }, + "syndication_right" : { + "type" : "string" + }, + "adult_content" : { + "type" : "string" + }, + "language" : { + "type" : "string" + }, + "input_encoding" : { + "type" : "string" + }, + "output_encoding" : { + "type" : "string" + } + } + }, + "Person" : { + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "uri" : { + "type" : "string" + } + } + }, + "RasterTileURL" : { + "required" : [ "id_path", "url" ], + "type" : "object", + "properties" : { + "url" : { + "type" : "string" + }, + "id_path" : { + "type" : "string" + }, + "min_z" : { + "type" : "integer", + "format" : "int32" + }, + "max_z" : { + "type" : "integer", + "format" : "int32" + }, + "check_geometry" : { + "type" : "boolean" + } + } + }, + "FormDataContentDisposition" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" + }, + "parameters" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "fileName" : { + "type" : "string" + }, + "creationDate" : { + "type" : "string", + "format" : "date-time" + }, + "modificationDate" : { + "type" : "string", + "format" : "date-time" + }, + "readDate" : { + "type" : "string", + "format" : "date-time" + }, + "size" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + } + }, + "CollectionReferenceUpdate" : { + "type" : "object", + "properties" : { + "organisations" : { + "$ref" : "#/components/schemas/CollectionReferenceUpdateOrg" + } + } + }, + "CollectionReferenceUpdateOrg" : { + "type" : "object", + "properties" : { + "public" : { + "type" : "boolean" + }, + "shared" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "AggregationMetric" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string" + }, + "field" : { + "type" : "string" + }, + "value" : { + "type" : "object" + } + } + }, + "AggregationResponse" : { + "type" : "object", + "properties" : { + "query_time" : { + "type" : "integer", + "format" : "int64" + }, + "total_time" : { + "type" : "integer", + "format" : "int64" + }, + "totalnb" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + }, + "count" : { + "type" : "integer", + "format" : "int64" + }, + "sumotherdoccounts" : { + "type" : "integer", + "format" : "int64" + }, + "key" : { + "type" : "object" + }, + "key_as_string" : { + "type" : "object" + }, + "elements" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AggregationResponse" + } + }, + "metrics" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AggregationMetric" + } + }, + "hits" : { + "type" : "array", + "items" : { + "type" : "object" + } + }, + "geometries" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ReturnedGeometry" + } + }, + "flattened_elements" : { + "type" : "object", + "additionalProperties" : { + "type" : "object" + } + } + } + }, + "Crs" : { + "type" : "object", + "properties" : { + "type" : { + "type" : "string", + "enum" : [ "name", "link" ] + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "object" + } + } + } + }, + "Feature" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "object" + } + }, + "geometry" : { + "$ref" : "#/components/schemas/GeoJsonObject" + }, + "id" : { + "type" : "string" + } + } + } ] + }, + "FeatureCollection" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "features" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Feature" + } + } + } + } ] + }, + "GeoJsonObject" : { + "required" : [ "type" ], + "type" : "object", + "properties" : { + "crs" : { + "$ref" : "#/components/schemas/Crs" + }, + "bbox" : { + "type" : "array", + "items" : { + "type" : "number", + "format" : "double" + } + }, + "type" : { + "type" : "string" + } }, - "message" : { - "type" : "string" + "discriminator" : { + "propertyName" : "type" } - } - }, - "AggregationMetric" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string" - }, - "field" : { - "type" : "string" - }, - "value" : { - "type" : "object" + }, + "GeometryCollection" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "geometries" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/GeoJsonObject" + } + } + } + } ] + }, + "LineString" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "coordinates" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LngLatAlt" + } + } + } + } ] + }, + "LngLatAlt" : { + "type" : "object", + "properties" : { + "longitude" : { + "type" : "number", + "format" : "double" + }, + "latitude" : { + "type" : "number", + "format" : "double" + }, + "altitude" : { + "type" : "number", + "format" : "double" + }, + "additionalElements" : { + "type" : "array", + "items" : { + "type" : "number", + "format" : "double" + } + } } - } - }, - "AggregationResponse" : { - "type" : "object", - "properties" : { - "query_time" : { - "type" : "integer", - "format" : "int64" - }, - "total_time" : { - "type" : "integer", - "format" : "int64" - }, - "totalnb" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - }, - "count" : { - "type" : "integer", - "format" : "int64" - }, - "sumotherdoccounts" : { - "type" : "integer", - "format" : "int64" - }, - "key" : { - "type" : "object" - }, - "key_as_string" : { - "type" : "object" - }, - "elements" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/AggregationResponse" + }, + "MultiLineString" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "coordinates" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LngLatAlt" + } + } + } } - }, - "metrics" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/AggregationMetric" + } ] + }, + "MultiPoint" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "coordinates" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LngLatAlt" + } + } } - }, - "hits" : { - "type" : "array", - "items" : { - "type" : "object" + } ] + }, + "MultiPolygon" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "coordinates" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LngLatAlt" + } + } + } + } } - }, - "geometries" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/ReturnedGeometry" + } ] + }, + "Point" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { + "type" : "object", + "properties" : { + "coordinates" : { + "$ref" : "#/components/schemas/LngLatAlt" + } } - }, - "flattened_elements" : { + } ] + }, + "Polygon" : { + "type" : "object", + "allOf" : [ { + "$ref" : "#/components/schemas/GeoJsonObject" + }, { "type" : "object", - "additionalProperties" : { - "type" : "object" + "properties" : { + "coordinates" : { + "type" : "array", + "items" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/LngLatAlt" + } + } + } + } + } ] + }, + "ReturnedGeometry" : { + "type" : "object", + "properties" : { + "reference" : { + "type" : "string" + }, + "geometry" : { + "$ref" : "#/components/schemas/GeoJsonObject" + }, + "sort" : { + "type" : "string" + }, + "is_raw" : { + "type" : "boolean" } } - } - }, - "Crs" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string", - "enum" : [ "name", "link" ] - }, + }, + "Aggregation" : { + "type" : "object", "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "object" + "type" : { + "type" : "string", + "enum" : [ "datehistogram", "geohash", "geotile", "histogram", "term", "geohex" ] + }, + "field" : { + "type" : "string" + }, + "interval" : { + "$ref" : "#/components/schemas/Interval" + }, + "format" : { + "type" : "string" + }, + "metrics" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Metric" + } + }, + "order" : { + "type" : "string", + "enum" : [ "asc", "desc" ] + }, + "on" : { + "type" : "string", + "enum" : [ "field", "count", "result" ] + }, + "size" : { + "type" : "string" + }, + "include" : { + "type" : "string" + }, + "raw_geometries" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/RawGeometry" + } + }, + "aggregated_geometries" : { + "type" : "array", + "items" : { + "type" : "string", + "enum" : [ "BBOX", "CENTROID", "CELL", "CELLCENTER", "GEOHASH", "GEOHASH_CENTER" ] + } + }, + "fetch_hits" : { + "$ref" : "#/components/schemas/HitsFetcher" } } - } - }, - "Feature" : { - "type" : "object", - "properties" : { - "crs" : { - "$ref" : "#/definitions/Crs" - }, - "bbox" : { - "type" : "array", - "items" : { - "type" : "number", - "format" : "double" + }, + "AggregationsRequest" : { + "type" : "object", + "properties" : { + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "aggregations" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Aggregation" + } } - }, + } + }, + "Form" : { + "type" : "object", "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "object" + "pretty" : { + "type" : "boolean" + }, + "flat" : { + "type" : "boolean" } - }, - "geometry" : { - "$ref" : "#/definitions/GeoJsonObject" - }, - "id" : { - "type" : "string" } - } - }, - "FeatureCollection" : { - "type" : "object", - "properties" : { - "crs" : { - "$ref" : "#/definitions/Crs" - }, - "bbox" : { - "type" : "array", - "items" : { - "type" : "number", - "format" : "double" + }, + "HitsFetcher" : { + "type" : "object", + "properties" : { + "size" : { + "type" : "integer", + "format" : "int32" + }, + "include" : { + "type" : "array", + "items" : { + "type" : "string" + } } - }, - "features" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Feature" + } + }, + "Interval" : { + "type" : "object", + "properties" : { + "value" : { + "type" : "number" + }, + "unit" : { + "type" : "string", + "enum" : [ "year", "quarter", "month", "week", "day", "hour", "minute", "second" ] } } - } - }, - "GeoJsonObject" : { - "type" : "object", - "discriminator" : "type", - "properties" : { - "crs" : { - "$ref" : "#/definitions/Crs" - }, - "bbox" : { - "type" : "array", - "items" : { - "type" : "number", - "format" : "double" + }, + "Metric" : { + "type" : "object", + "properties" : { + "collect_field" : { + "type" : "string" + }, + "collect_fct" : { + "type" : "string", + "enum" : [ "AVG", "CARDINALITY", "MAX", "MIN", "SUM", "GEOCENTROID", "GEOBBOX" ] } } - } - }, - "GeometryCollection" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "RawGeometry" : { "type" : "object", "properties" : { - "geometries" : { + "geometry" : { + "type" : "string" + }, + "sort" : { + "type" : "string" + }, + "signedSort" : { + "type" : "string" + }, + "include" : { "type" : "array", "items" : { - "$ref" : "#/definitions/GeoJsonObject" + "type" : "string" } } } - } ] - }, - "LineString" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "ComputationResponse" : { + "type" : "object", + "properties" : { + "query_time" : { + "type" : "integer", + "format" : "int64" + }, + "total_time" : { + "type" : "integer", + "format" : "int64" + }, + "totalnb" : { + "type" : "integer", + "format" : "int64" + }, + "field" : { + "type" : "string" + }, + "metric" : { + "type" : "string", + "enum" : [ "AVG", "MAX", "MIN", "SUM", "CARDINALITY", "SPANNING", "GEOBBOX", "GEOCENTROID" ] + }, + "value" : { + "type" : "number", + "format" : "double" + }, + "geometry" : { + "$ref" : "#/components/schemas/GeoJsonObject" + } + } + }, + "ComputationRequest" : { + "type" : "object", + "properties" : { + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "field" : { + "type" : "string" + }, + "metric" : { + "type" : "string", + "enum" : [ "AVG", "MAX", "MIN", "SUM", "CARDINALITY", "SPANNING", "GEOBBOX", "GEOCENTROID" ] + } + } + }, + "ArlasHit" : { "type" : "object", "properties" : { - "coordinates" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/LngLatAlt" - } + "md" : { + "$ref" : "#/components/schemas/MD" + }, + "data" : { + "type" : "object" } } - } ] - }, - "LngLatAlt" : { - "type" : "object", - "properties" : { - "longitude" : { - "type" : "number", - "format" : "double" - }, - "latitude" : { - "type" : "number", - "format" : "double" - }, - "altitude" : { - "type" : "number", - "format" : "double" - }, - "additionalElements" : { - "type" : "array", - "items" : { - "type" : "number", - "format" : "double" + }, + "Geo" : { + "type" : "object", + "properties" : { + "path" : { + "type" : "string" + }, + "geometry" : { + "$ref" : "#/components/schemas/GeoJsonObject" } } - } - }, - "MultiLineString" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "Hits" : { "type" : "object", "properties" : { - "coordinates" : { + "collection" : { + "type" : "string" + }, + "hits" : { "type" : "array", "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/LngLatAlt" - } + "$ref" : "#/components/schemas/ArlasHit" + } + }, + "nbhits" : { + "type" : "integer", + "format" : "int64" + }, + "totalnb" : { + "type" : "integer", + "format" : "int64" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/Link" } } } - } ] - }, - "MultiPoint" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "Link" : { + "required" : [ "href", "method" ], "type" : "object", "properties" : { - "coordinates" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/LngLatAlt" - } + "href" : { + "type" : "string" + }, + "method" : { + "type" : "string" + }, + "body" : { + "type" : "object" } } - } ] - }, - "MultiPolygon" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "MD" : { "type" : "object", "properties" : { - "coordinates" : { + "id" : { + "type" : "string" + }, + "timestamp" : { + "type" : "integer", + "format" : "int64" + }, + "geometry" : { + "$ref" : "#/components/schemas/GeoJsonObject" + }, + "centroid" : { + "$ref" : "#/components/schemas/GeoJsonObject" + }, + "returned_geometries" : { "type" : "array", "items" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/LngLatAlt" - } - } + "$ref" : "#/components/schemas/Geo" } } } - } ] - }, - "Point" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "Count" : { "type" : "object", "properties" : { - "coordinates" : { - "$ref" : "#/definitions/LngLatAlt" + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" } } - } ] - }, - "Polygon" : { - "allOf" : [ { - "$ref" : "#/definitions/GeoJsonObject" - }, { + }, + "CollectionReferenceDescription" : { + "required" : [ "collection_name", "params" ], "type" : "object", "properties" : { - "coordinates" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/LngLatAlt" - } + "properties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionReferenceDescriptionProperty" } + }, + "collection_name" : { + "type" : "string" + }, + "params" : { + "$ref" : "#/components/schemas/CollectionReferenceParameters" } } - } ] - }, - "ReturnedGeometry" : { - "type" : "object", - "properties" : { - "reference" : { - "type" : "string" - }, - "geometry" : { - "$ref" : "#/definitions/GeoJsonObject" - }, - "sort" : { - "type" : "string" - }, - "is_raw" : { - "type" : "boolean" - } - } - }, - "Aggregation" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string", - "enum" : [ "datehistogram", "geohash", "geotile", "histogram", "term", "geohex" ] - }, - "field" : { - "type" : "string" - }, - "interval" : { - "$ref" : "#/definitions/Interval" - }, - "format" : { - "type" : "string" - }, - "metrics" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Metric" - } - }, - "order" : { - "type" : "string", - "enum" : [ "asc", "desc" ] - }, - "on" : { - "type" : "string", - "enum" : [ "field", "count", "result" ] - }, - "size" : { - "type" : "string" - }, - "include" : { - "type" : "string" - }, - "raw_geometries" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/RawGeometry" - } - }, - "aggregated_geometries" : { - "type" : "array", - "items" : { + }, + "CollectionReferenceDescriptionProperty" : { + "type" : "object", + "properties" : { + "type" : { "type" : "string", - "enum" : [ "BBOX", "CENTROID", "CELL", "CELLCENTER", "GEOHASH", "GEOHASH_CENTER" ] - } - }, - "fetch_hits" : { - "$ref" : "#/definitions/HitsFetcher" - } - } - }, - "AggregationsRequest" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "aggregations" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Aggregation" - } - } - } - }, - "Form" : { - "type" : "object", - "properties" : { - "pretty" : { - "type" : "boolean" - }, - "flat" : { - "type" : "boolean" - } - } - }, - "HitsFetcher" : { - "type" : "object", - "properties" : { - "size" : { - "type" : "integer", - "format" : "int32" - }, - "include" : { - "type" : "array", - "items" : { + "enum" : [ "TEXT", "KEYWORD", "LONG", "INTEGER", "SHORT", "BYTE", "DOUBLE", "FLOAT", "DATE", "BOOLEAN", "BINARY", "INT_RANGE", "FLOAT_RANGE", "LONG_RANGE", "DOUBLE_RANGE", "DATE_RANGE", "OBJECT", "NESTED", "GEO_POINT", "GEO_SHAPE", "IP", "COMPLETION", "TOKEN_COUNT", "MAPPER_MURMUR3", "UNKNOWN", "VARCHAR", "CHAR", "CHARACTER", "BIT", "TINYINT", "SMALLINT", "INT", "BIGINT", "DECIMAL", "NUMERIC", "REAL", "DOUBLEPRECISION", "TIMESTAMP", "TIME", "INTERVAL", "GEOMETRY", "GEOGRAPHY", "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", "MURMUR3" ] + }, + "format" : { "type" : "string" - } - } - } - }, - "Interval" : { - "type" : "object", - "properties" : { - "value" : { - "$ref" : "#/definitions/Number" - }, - "unit" : { - "type" : "string", - "enum" : [ "year", "quarter", "month", "week", "day", "hour", "minute", "second" ] - } - } - }, - "Metric" : { - "type" : "object", - "properties" : { - "collect_field" : { - "type" : "string" - }, - "collect_fct" : { - "type" : "string", - "enum" : [ "AVG", "CARDINALITY", "MAX", "MIN", "SUM", "GEOCENTROID", "GEOBBOX" ] - } - } - }, - "RawGeometry" : { - "type" : "object", - "properties" : { - "geometry" : { - "type" : "string" - }, - "sort" : { - "type" : "string" - }, - "signedSort" : { - "type" : "string" - }, - "include" : { - "type" : "array", - "items" : { + }, + "hash_field" : { "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionReferenceDescriptionProperty" + } + }, + "taggable" : { + "type" : "boolean" + }, + "indexed" : { + "type" : "boolean" } } - } - }, - "ComputationResponse" : { - "type" : "object", - "properties" : { - "query_time" : { - "type" : "integer", - "format" : "int64" - }, - "total_time" : { - "type" : "integer", - "format" : "int64" - }, - "totalnb" : { - "type" : "integer", - "format" : "int64" - }, - "field" : { - "type" : "string" - }, - "metric" : { - "type" : "string", - "enum" : [ "AVG", "MAX", "MIN", "SUM", "CARDINALITY", "SPANNING", "GEOBBOX", "GEOCENTROID" ] - }, - "value" : { - "type" : "number", - "format" : "double" - }, - "geometry" : { - "$ref" : "#/definitions/GeoJsonObject" - } - } - }, - "ComputationRequest" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "field" : { - "type" : "string" - }, - "metric" : { - "type" : "string", - "enum" : [ "AVG", "MAX", "MIN", "SUM", "CARDINALITY", "SPANNING", "GEOBBOX", "GEOCENTROID" ] - } - } - }, - "ArlasHit" : { - "type" : "object", - "properties" : { - "md" : { - "$ref" : "#/definitions/MD" - }, - "data" : { - "type" : "object" - } - } - }, - "Geo" : { - "type" : "object", - "properties" : { - "path" : { - "type" : "string" - }, - "geometry" : { - "$ref" : "#/definitions/GeoJsonObject" - } - } - }, - "Hits" : { - "type" : "object", - "properties" : { - "collection" : { - "type" : "string" - }, - "hits" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/ArlasHit" - } - }, - "nbhits" : { - "type" : "integer", - "format" : "int64" - }, - "totalnb" : { - "type" : "integer", - "format" : "int64" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/Link" - } - } - } - }, - "Link" : { - "type" : "object", - "required" : [ "href", "method" ], - "properties" : { - "href" : { - "type" : "string" - }, - "method" : { - "type" : "string" - }, - "body" : { - "type" : "object" - } - } - }, - "MD" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - }, - "timestamp" : { - "type" : "integer", - "format" : "int64" - }, - "geometry" : { - "$ref" : "#/definitions/GeoJsonObject" - }, - "centroid" : { - "$ref" : "#/definitions/GeoJsonObject" - }, - "returned_geometries" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Geo" + }, + "Page" : { + "type" : "object", + "properties" : { + "size" : { + "type" : "integer", + "format" : "int32" + }, + "from" : { + "type" : "integer", + "format" : "int32" + }, + "sort" : { + "type" : "string" + }, + "after" : { + "type" : "string" + }, + "before" : { + "type" : "string" } } - } - }, - "Count" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - } - } - }, - "CollectionReferenceDescription" : { - "type" : "object", - "required" : [ "collection_name", "params" ], - "properties" : { + }, + "Projection" : { + "type" : "object", "properties" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/CollectionReferenceDescriptionProperty" + "includes" : { + "type" : "string" + }, + "excludes" : { + "type" : "string" } - }, - "collection_name" : { - "type" : "string" - }, - "params" : { - "$ref" : "#/definitions/CollectionReferenceParameters" } - } - }, - "CollectionReferenceDescriptionProperty" : { - "type" : "object", - "properties" : { - "type" : { - "type" : "string", - "enum" : [ "TEXT", "KEYWORD", "LONG", "INTEGER", "SHORT", "BYTE", "DOUBLE", "FLOAT", "DATE", "BOOLEAN", "BINARY", "INT_RANGE", "FLOAT_RANGE", "LONG_RANGE", "DOUBLE_RANGE", "DATE_RANGE", "OBJECT", "NESTED", "GEO_POINT", "GEO_SHAPE", "IP", "COMPLETION", "TOKEN_COUNT", "MAPPER_MURMUR3", "UNKNOWN", "VARCHAR", "CHAR", "CHARACTER", "BIT", "TINYINT", "SMALLINT", "INT", "BIGINT", "DECIMAL", "NUMERIC", "REAL", "DOUBLEPRECISION", "TIMESTAMP", "TIME", "INTERVAL", "GEOMETRY", "GEOGRAPHY", "POINT", "LINESTRING", "POLYGON", "MULTIPOINT", "MULTILINESTRING", "MULTIPOLYGON", "GEOMETRYCOLLECTION", "MURMUR3" ] - }, - "format" : { - "type" : "string" - }, - "hash_field" : { - "type" : "string" - }, + }, + "Search" : { + "type" : "object", "properties" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/definitions/CollectionReferenceDescriptionProperty" + "filter" : { + "$ref" : "#/components/schemas/Filter" + }, + "form" : { + "$ref" : "#/components/schemas/Form" + }, + "page" : { + "$ref" : "#/components/schemas/Page" + }, + "projection" : { + "$ref" : "#/components/schemas/Projection" + }, + "returned_geometries" : { + "type" : "string" } - }, - "taggable" : { - "type" : "boolean" - }, - "indexed" : { - "type" : "boolean" - } - } - }, - "Page" : { - "type" : "object", - "properties" : { - "size" : { - "type" : "integer", - "format" : "int32" - }, - "from" : { - "type" : "integer", - "format" : "int32" - }, - "sort" : { - "type" : "string" - }, - "after" : { - "type" : "string" - }, - "before" : { - "type" : "string" - } - } - }, - "Projection" : { - "type" : "object", - "properties" : { - "includes" : { - "type" : "string" - }, - "excludes" : { - "type" : "string" - } - } - }, - "Search" : { - "type" : "object", - "properties" : { - "filter" : { - "$ref" : "#/definitions/Filter" - }, - "form" : { - "$ref" : "#/definitions/Form" - }, - "page" : { - "$ref" : "#/definitions/Page" - }, - "projection" : { - "$ref" : "#/definitions/Projection" - }, - "returned_geometries" : { - "type" : "string" } } } diff --git a/openapi/swagger.yaml b/openapi/openapi.yaml similarity index 59% rename from openapi/swagger.yaml rename to openapi/openapi.yaml index 64b87ce0b..65645f9e7 100644 --- a/openapi/swagger.yaml +++ b/openapi/openapi.yaml @@ -1,242 +1,308 @@ ---- -swagger: "2.0" +openapi: 3.0.1 info: - description: "Explore the content of ARLAS collections" - version: "23.0.1" - title: "ARLAS Exploration API" + title: ARLAS Server APIs + description: Explore the content of ARLAS collections contact: - name: "Gisaia" - url: "http://www.gisaia.com/" - email: "contact@gisaia.com" + name: Gisaia + url: http://www.gisaia.com/ + email: contact@gisaia.com license: - name: "Apache 2.0" - url: "https://www.apache.org/licenses/LICENSE-2.0.html" -basePath: "/arlas" + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + version: API_VERSION +externalDocs: + description: API documentation + url: https://docs.arlas.io/arlas-api/ +servers: +- url: /arlas + description: default server tags: -- name: "collections" -- name: "explore" -schemes: -- "http" -- "https" +- name: collections + description: Collections API +- name: explore + description: Explore API paths: /collections/{collection}: get: tags: - - "collections" - summary: "Get a collection reference" - description: "Get a collection reference in ARLAS" - operationId: "get" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - collections + summary: Get a collection reference + description: Get a collection reference in ARLAS + operationId: get parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/CollectionReference" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReference' "404": - description: "Collection not found." - schema: - $ref: "#/definitions/Error" + description: Collection not found. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' put: tags: - - "collections" - summary: "Add a collection reference" - description: "Add a collection reference in ARLAS" - operationId: "put" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - collections + summary: Add a collection reference + description: Add a collection reference in ARLAS + operationId: put parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - in: "body" - name: "collectionParams" - description: "collectionParams" + - name: collection + in: path + description: collection required: true schema: - $ref: "#/definitions/CollectionReferenceParameters" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "checkfields" - in: "query" - required: false - type: "boolean" - default: true + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: checkfields + in: query + schema: + type: boolean + default: true + requestBody: + description: collectionParams + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReferenceParameters' + required: true responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/CollectionReference" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReference' "400": - description: "JSON parameter malformed." - schema: - $ref: "#/definitions/Error" + description: JSON parameter malformed. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "404": - description: "Not Found Error." - schema: - $ref: "#/definitions/Error" + description: Not Found Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' delete: tags: - - "collections" - summary: "Delete a collection reference" - description: "Delete a collection reference in ARLAS" - operationId: "delete" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - collections + summary: Delete a collection reference + description: Delete a collection reference in ARLAS + operationId: delete parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/Success" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Success' "404": - description: "Collection not found." - schema: - $ref: "#/definitions/Error" + description: Collection not found. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - /collections: + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /collections/_export: get: tags: - - "collections" - summary: "Get all collection references" - description: "Get all collection references in ARLAS" - operationId: "getAll" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false + - collections + summary: Get all collection references as a json file + description: Get all collection references in ARLAS as json file + operationId: exportCollections responses: "200": - description: "Successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/CollectionReference" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: array + items: + $ref: '#/components/schemas/CollectionReference' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - /collections/_export: + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /collections: get: tags: - - "collections" - summary: "Get all collection references as a json file" - description: "Get all collection references in ARLAS as json file" - operationId: "exportCollections" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - parameters: [] + - collections + summary: Get all collection references + description: Get all collection references in ARLAS + operationId: getAll + parameters: + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false responses: "200": - description: "Successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/CollectionReference" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: array + items: + $ref: '#/components/schemas/CollectionReference' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /collections/_import: post: tags: - - "collections" - summary: "Add collection references from a json file" - description: "Add collection references in ARLAS from a json file" - operationId: "importCollections" - consumes: - - "multipart/form-data" - produces: - - "application/json;charset=utf-8" + - collections + summary: Add collection references from a json file + description: Add collection references in ARLAS from a json file + operationId: importCollections + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + $ref: '#/components/schemas/FormDataContentDisposition' + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: string + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /collections/{collection}/organisations: + patch: + tags: + - collections + summary: Update a collection reference's organisations attribute. + description: Update a collection reference's organisations attribute. + operationId: patch parameters: - - name: "file" - in: "formData" - required: false - type: "file" + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + requestBody: + description: collectionParamsUpdate + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReferenceUpdate' + required: true responses: "200": - description: "Successful operation" - schema: - type: "string" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReference' + "400": + description: JSON parameter malformed. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "404": + description: Collection not found. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_aggregate: get: tags: - - "explore" - summary: "Aggregate" + - explore + summary: Aggregate description: "Aggregate the elements in the collection(s), given the filters\ \ and the aggregation parameters" - operationId: "aggregate" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: aggregate parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "agg" - in: "query" + schema: + type: string + - name: agg + in: query description: "- The agg parameter should be given in the following formats:\ \ \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:fetch_hits-{fetch_hits\ \ values} \n \nWhere :\n \n - **{type}:{field}** part is mandatory. \n\ @@ -316,12 +382,12 @@ paths: \ parameter is multiple. Every agg parameter specified is a subaggregation\ \ of the previous one : order matters. \n \nFor more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md." required: true - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "f" - in: "query" + schema: + type: array + items: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -353,136 +419,142 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/AggregationResponse" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/AggregationResponse' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "Aggregate" + - explore + summary: Aggregate description: "Aggregate the elements in the collection(s), given the filters\ \ and the aggregation parameters" - operationId: "aggregatePost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: aggregatePost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/AggregationsRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/AggregationsRequest' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/AggregationResponse" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/AggregationResponse' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /explore/{collection}/_shapeaggregate: + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /explore/{collection}/_geoaggregate: get: tags: - - "explore" - summary: "ShapeAggregate" + - explore + summary: GeoAggregate description: "Aggregate the elements in the collection(s) as features, given\ - \ the filters and the aggregation parameters, and returns a shapefile of it." - operationId: "shapeaggregate" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/zip" + \ the filters and the aggregation parameters." + operationId: geoaggregate parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "agg" - in: "query" + schema: + type: string + - name: agg + in: query description: "- The agg parameter should be given in the following formats:\ \ \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries\ \ values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits\ @@ -569,12 +641,12 @@ paths: \ geotile. Every agg parameter specified is a subaggregation of the previous\ \ one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md " required: true - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "f" - in: "query" + schema: + type: array + items: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -606,139 +678,160 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query + description: "Flats the property map: only key/value on one level" + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" + description: Not implemented functionality. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "ShapeAggregate" + - explore + summary: GeoAggregate description: "Aggregate the elements in the collection(s) as features, given\ - \ the filters and the aggregation parameters, and returns a shapefile of it." - operationId: "shapeaggregatePost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/zip" + \ the filters and the aggregation parameters." + operationId: geoaggregatePost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/AggregationsRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/AggregationsRequest' responses: "200": - description: "Successful operation" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" + description: Not implemented functionality. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_geoaggregate/{geohash}: get: tags: - - "explore" - summary: "GeoAggregate on a geohash" + - explore + summary: GeoAggregate on a geohash description: "Aggregate the elements in the collection(s) and localized in the\ \ given geohash as features, given the filters and the aggregation parameters." - operationId: "geohashgeoaggregate" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: geohashgeoaggregate parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "geohash" - in: "path" - description: "geohash" + schema: + type: string + - name: geohash + in: path + description: geohash required: true - type: "string" - - name: "agg" - in: "query" + schema: + type: string + - name: agg + in: query description: "- The agg parameter should be given in the following formats:\ \ \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries\ \ values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits\ @@ -824,13 +917,12 @@ paths: \ parameter is multiple. The first (main) aggregation must be geohash or\ \ geotile. Every agg parameter specified is a subaggregation of the previous\ \ one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "f" - in: "query" + schema: + type: array + items: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -862,111 +954,119 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" + description: Not implemented functionality. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_geoaggregate/{z}/{x}/{y}: get: tags: - - "explore" - summary: "GeoAggregate on a geotile" + - explore + summary: GeoAggregate on a geotile description: "Aggregate the elements in the collection(s) and localized in the\ \ given tile as features, given the filters and the aggregation parameters." - operationId: "geotilegeoaggregate" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: geotilegeoaggregate parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "z" - in: "path" - description: "z" + schema: + type: string + - name: z + in: path + description: z required: true - type: "integer" - format: "int32" - - name: "x" - in: "path" - description: "x" + schema: + type: integer + format: int32 + - name: x + in: path + description: x required: true - type: "integer" - format: "int32" + schema: + type: integer + format: int32 - name: "y" - in: "path" + in: path description: "y" required: true - type: "integer" - format: "int32" - - name: "agg" - in: "query" + schema: + type: integer + format: int32 + - name: agg + in: query description: "- The agg parameter should be given in the following formats:\ \ \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries\ \ values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits\ @@ -1052,13 +1152,12 @@ paths: \ parameter is multiple. The first (main) aggregation must be geohash or\ \ geotile. Every agg parameter specified is a subaggregation of the previous\ \ one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "f" - in: "query" + schema: + type: array + items: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -1090,93 +1189,98 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" - /explore/{collection}/_geoaggregate: + description: Not implemented functionality. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /explore/{collection}/_shapeaggregate: get: tags: - - "explore" - summary: "GeoAggregate" + - explore + summary: ShapeAggregate description: "Aggregate the elements in the collection(s) as features, given\ - \ the filters and the aggregation parameters." - operationId: "geoaggregate" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + \ the filters and the aggregation parameters, and returns a shapefile of it." + operationId: shapeaggregate parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "agg" - in: "query" + schema: + type: string + - name: agg + in: query description: "- The agg parameter should be given in the following formats:\ \ \n \n {type}:{field}:interval-{interval}:format-{format}:collect_field-{collect_field}:collect_fct-{function}:order-{order}:on-{on}:size-{size}:raw_geometries-{raw_geometries\ \ values}:aggregated_geometries-{aggregated_geometries values}:fetch_hits-{fetch_hits\ @@ -1263,12 +1367,12 @@ paths: \ geotile. Every agg parameter specified is a subaggregation of the previous\ \ one : order matters. \n \nFor more details, check https://github.com/gisaia/ARLAS-server/blob/master/docs/arlas-api-exploration.md " required: true - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "f" - in: "query" + schema: + type: array + items: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -1300,155 +1404,153 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" - description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" + description: Not implemented functionality. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "GeoAggregate" + - explore + summary: ShapeAggregate description: "Aggregate the elements in the collection(s) as features, given\ - \ the filters and the aggregation parameters." - operationId: "geoaggregatePost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + \ the filters and the aggregation parameters, and returns a shapefile of it." + operationId: shapeaggregatePost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/AggregationsRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/AggregationsRequest' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "501": - description: "Not implemented functionality." - schema: - $ref: "#/definitions/Error" + description: Not implemented functionality. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_compute: get: tags: - - "explore" - summary: "Compute" + - explore + summary: Compute description: "Computes the given metric on a field in the collection, given\ \ the filters" - operationId: "compute" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: compute parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "field" - in: "query" - description: "The field on which the metric is calculated." + schema: + type: string + - name: field + in: query + description: The field on which the metric is calculated. required: true - type: "string" - - name: "metric" - in: "query" + schema: + type: string + - name: metric + in: query description: "The metric to compute : `max, min, avg, sum, cardinality, spanning,\ \ geobbox, geocentroid`." required: true - type: "string" - - name: "f" - in: "query" + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -1480,130 +1582,136 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/ComputationResponse" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/ComputationResponse' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "Compute" + - explore + summary: Compute description: "Computes the given metric on a field in the collection, given\ \ the filters" - operationId: "computePost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: computePost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/ComputationRequest" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/ComputationRequest' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/ComputationResponse" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/ComputationResponse' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_count: get: tags: - - "explore" - summary: "Count" + - explore + summary: Count description: "Count the number of elements found in the collection(s), given\ \ the filters" - operationId: "count" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: count parameters: - - name: "collection" - in: "path" - description: "collections" + - name: collection + in: path + description: collections required: true - type: "string" - - name: "f" - in: "query" + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -1635,288 +1743,291 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/Hits" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Hits' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "Count" + - explore + summary: Count description: "Count the number of elements found in the collection(s), given\ \ the filters" - operationId: "countPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: countPost parameters: - - name: "collection" - in: "path" - description: "collections" + - name: collection + in: path + description: collections required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/Count" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Count' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/Hits" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Hits' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_describe: get: tags: - - "explore" - summary: "Describe" - description: "Describe the structure and the content of the given collection. " - operationId: "describe" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - explore + summary: Describe + description: Describe the structure and the content of the given collection. + operationId: describe parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/CollectionReferenceDescription" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/CollectionReferenceDescription' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "403": - description: "Collection not authorized." - schema: - $ref: "#/definitions/Error" + description: Collection not authorized. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/_list: get: tags: - - "explore" - summary: "List" - description: "List the collections configured in ARLAS. " - operationId: "list" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - explore + summary: List + description: List the collections configured in ARLAS. + operationId: list parameters: - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - type: "array" - items: - $ref: "#/definitions/CollectionReferenceDescription" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + type: array + items: + $ref: '#/components/schemas/CollectionReferenceDescription' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "403": - description: "Collection not authorized." - schema: - $ref: "#/definitions/Error" + description: Collection not authorized. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/{identifier}: get: tags: - - "explore" - summary: "Get an Arlas document" - description: "Returns a raw indexed document." - operationId: "getArlasHit" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - explore + summary: Get an Arlas document + description: Returns a raw indexed document. + operationId: getArlasHit parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "identifier" - in: "path" - description: "identifier" + schema: + type: string + - name: identifier + in: path + description: identifier required: true - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/ArlasHit" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/ArlasHit' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "404": - description: "Not Found Error." - schema: - $ref: "#/definitions/Error" - /explore/{collection}/_geosearch/{z}/{x}/{y}: + description: Not Found Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /explore/{collection}/_geosearch: get: tags: - - "explore" - summary: "Tiled GeoSearch" - description: "Search and return the elements found in the collection(s) and\ - \ localized in the given tile(x,y,z) as features, given the filters" - operationId: "tiledgeosearch" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - explore + summary: GeoSearch + description: "Search and return the elements found in the collection(s) as features,\ + \ given the filters" + operationId: geosearch parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - name: "x" - in: "path" - description: "x" - required: true - type: "integer" - format: "int32" - - name: "y" - in: "path" - description: "y" - required: true - type: "integer" - format: "int32" - - name: "z" - in: "path" - description: "z" + - name: collection + in: path + description: collection required: true - type: "integer" - format: "int32" - - name: "f" - in: "query" + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -1948,93 +2059,91 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "include" - in: "query" - description: "List the name patterns of the field to be included in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - default: "*" - collectionFormat: "multi" - - name: "exclude" - in: "query" - description: "List the name patterns of the field to be excluded in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "returned_geometries" - in: "query" + schema: + type: boolean + default: false + - name: include + in: query + description: List the name patterns of the field to be included in the result. + Separate patterns with a comma. + style: form + schema: + type: string + default: '*' + - name: exclude + in: query + description: List the name patterns of the field to be excluded in the result. + Separate patterns with a comma. + style: form + schema: + type: string + - name: returned_geometries + in: query description: "Comma separated geometry field_paths to be included in the result.\ \ If not specified, only geometry_path is returned. If geometry_path is\ \ null, then centroid_path is returned" - required: false - type: "string" - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 0 - - name: "sort" - in: "query" + schema: + type: string + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 1 + type: integer + format: int64 + default: 0 + - name: sort + in: query description: "Sorts the resulted hits on the given fields and/or by distance\ \ to a given point:\n \n> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat}\ \ {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'**\ @@ -2047,13 +2156,11 @@ paths: \ sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same\ \ age hits, they are sorted by closest distance to the point(89°,179°)\n\ \ \n" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "after" - in: "query" + style: form + schema: + type: string + - name: after + in: query description: "List of values of fields present in sort param that are used\ \ to search after. \n \n> **What it does**: Retrieve the data placed after\ \ the pointed element, given the provided order (sort).\n \n> __**Restriction\ @@ -2069,53 +2176,106 @@ paths: \ Gets the following hits of the previous search that stopped at date *01/02/2019*\ \ and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be\ \ set to 0 or kept unset\n \n" - required: false - type: "string" - - name: "before" - in: "query" + schema: + type: string + - name: before + in: query description: "Same idea that after param, but to retrieve the data placed\ \ before the pointed element, given the provided order (sort)." - required: false - type: "string" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /explore/{collection}/_geosearch: - get: + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + post: tags: - - "explore" - summary: "GeoSearch" + - explore + summary: GeoSearch description: "Search and return the elements found in the collection(s) as features,\ \ given the filters" - operationId: "geosearch" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: geosearchPost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "f" - in: "query" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Search' + responses: + "200": + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' + "500": + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + "400": + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + /explore/{collection}/_shapesearch: + get: + tags: + - explore + summary: ShapeSearch + description: "Search and return the elements found in the collection(s) as features,\ + \ given the filters, exported as a Shapefile" + operationId: shapesearch + parameters: + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -2147,93 +2307,85 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" - description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "include" - in: "query" - description: "List the name patterns of the field to be included in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - default: "*" - collectionFormat: "multi" - - name: "exclude" - in: "query" - description: "List the name patterns of the field to be excluded in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "returned_geometries" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: include + in: query + description: List the name patterns of the field to be included in the result. + Separate patterns with a comma. + style: form + schema: + type: string + default: '*' + - name: exclude + in: query + description: List the name patterns of the field to be excluded in the result. + Separate patterns with a comma. + style: form + schema: + type: string + - name: returned_geometries + in: query description: "Comma separated geometry field_paths to be included in the result.\ \ If not specified, only geometry_path is returned. If geometry_path is\ \ null, then centroid_path is returned" - required: false - type: "string" - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 0 - - name: "sort" - in: "query" + schema: + type: string + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 1 + type: integer + format: int64 + default: 0 + - name: sort + in: query description: "Sorts the resulted hits on the given fields and/or by distance\ \ to a given point:\n \n> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat}\ \ {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'**\ @@ -2246,13 +2398,11 @@ paths: \ sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same\ \ age hits, they are sorted by closest distance to the point(89°,179°)\n\ \ \n" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "after" - in: "query" + style: form + schema: + type: string + - name: after + in: query description: "List of values of fields present in sort param that are used\ \ to search after. \n \n> **What it does**: Retrieve the data placed after\ \ the pointed element, given the provided order (sort).\n \n> __**Restriction\ @@ -2268,100 +2418,119 @@ paths: \ Gets the following hits of the previous search that stopped at date *01/02/2019*\ \ and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be\ \ set to 0 or kept unset\n \n" - required: false - type: "string" - - name: "before" - in: "query" + schema: + type: string + - name: before + in: query description: "Same idea that after param, but to retrieve the data placed\ \ before the pointed element, given the provided order (sort)." - required: false - type: "string" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "GeoSearch" + - explore + summary: ShapeSearch description: "Search and return the elements found in the collection(s) as features,\ - \ given the filters" - operationId: "geosearchPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + \ given the filters, exported as a Shapefile" + operationId: shapesearchPost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/Search" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Search' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/FeatureCollection" + description: Successful operation "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - /explore/{collection}/_shapesearch: + description: Bad request. + content: + application/zip: + schema: + $ref: '#/components/schemas/Error' + /explore/{collection}/_geosearch/{z}/{x}/{y}: get: tags: - - "explore" - summary: "ShapeSearch" - description: "Search and return the elements found in the collection(s) as features,\ - \ given the filters, exported as a Shapefile" - operationId: "shapesearch" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/zip" + - explore + summary: Tiled GeoSearch + description: "Search and return the elements found in the collection(s) and\ + \ localized in the given tile(x,y,z) as features, given the filters" + operationId: tiledgeosearch parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection + required: true + schema: + type: string + - name: x + in: path + description: x + required: true + schema: + type: integer + format: int32 + - name: "y" + in: path + description: "y" + required: true + schema: + type: integer + format: int32 + - name: z + in: path + description: z required: true - type: "string" - - name: "f" - in: "query" + schema: + type: integer + format: int32 + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -2393,87 +2562,91 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "include" - in: "query" - description: "List the name patterns of the field to be included in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - default: "*" - collectionFormat: "multi" - - name: "exclude" - in: "query" - description: "List the name patterns of the field to be excluded in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "returned_geometries" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query + description: "Flats the property map: only key/value on one level" + schema: + type: boolean + default: false + - name: include + in: query + description: List the name patterns of the field to be included in the result. + Separate patterns with a comma. + style: form + schema: + type: string + default: '*' + - name: exclude + in: query + description: List the name patterns of the field to be excluded in the result. + Separate patterns with a comma. + style: form + schema: + type: string + - name: returned_geometries + in: query description: "Comma separated geometry field_paths to be included in the result.\ \ If not specified, only geometry_path is returned. If geometry_path is\ \ null, then centroid_path is returned" - required: false - type: "string" - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 0 - - name: "sort" - in: "query" + schema: + type: string + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 1 + type: integer + format: int64 + default: 0 + - name: sort + in: query description: "Sorts the resulted hits on the given fields and/or by distance\ \ to a given point:\n \n> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat}\ \ {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'**\ @@ -2486,13 +2659,11 @@ paths: \ sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same\ \ age hits, they are sorted by closest distance to the point(89°,179°)\n\ \ \n" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "after" - in: "query" + style: form + schema: + type: string + - name: after + in: query description: "List of values of fields present in sort param that are used\ \ to search after. \n \n> **What it does**: Retrieve the data placed after\ \ the pointed element, given the provided order (sort).\n \n> __**Restriction\ @@ -2508,97 +2679,56 @@ paths: \ Gets the following hits of the previous search that stopped at date *01/02/2019*\ \ and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be\ \ set to 0 or kept unset\n \n" - required: false - type: "string" - - name: "before" - in: "query" + schema: + type: string + - name: before + in: query description: "Same idea that after param, but to retrieve the data placed\ \ before the pointed element, given the provided order (sort)." - required: false - type: "string" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" - responses: - "200": - description: "Successful operation" - "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" - "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" - post: - tags: - - "explore" - summary: "ShapeSearch" - description: "Search and return the elements found in the collection(s) as features,\ - \ given the filters, exported as a Shapefile" - operationId: "shapesearchPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/zip" - parameters: - - name: "collection" - in: "path" - description: "collection" - required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/Search" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/FeatureCollection' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collection}/_search: get: tags: - - "explore" - summary: "Search" + - explore + summary: Search description: "Search and return the elements found in the collection, given\ \ the filters" - operationId: "search" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" - - "application/atom+xml" + operationId: search parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "f" - in: "query" + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -2630,93 +2760,89 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - default: true - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "flat" - in: "query" + schema: + type: boolean + default: true + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: flat + in: query description: "Flats the property map: only key/value on one level" - required: false - type: "boolean" - default: false - - name: "include" - in: "query" - description: "List the name patterns of the field to be included in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - default: "*" - collectionFormat: "multi" - - name: "exclude" - in: "query" - description: "List the name patterns of the field to be excluded in the result.\ - \ Separate patterns with a comma." - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "returned_geometries" - in: "query" + schema: + type: boolean + default: false + - name: include + in: query + description: List the name patterns of the field to be included in the result. + Separate patterns with a comma. + schema: + type: string + default: '*' + - name: exclude + in: query + description: List the name patterns of the field to be excluded in the result. + Separate patterns with a comma. + schema: + type: string + - name: returned_geometries + in: query description: "Comma separated geometry field_paths to be included in the result.\ \ If not specified, only geometry_path is returned. If geometry_path is\ \ null, then centroid_path is returned" - required: false - type: "string" - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 0 - - name: "sort" - in: "query" + schema: + type: string + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 0 + type: integer + format: int64 + default: 0 + - name: sort + in: query description: "Sorts the resulted hits on the given fields and/or by distance\ \ to a given point:\n \n> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat}\ \ {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'**\ @@ -2729,10 +2855,10 @@ paths: \ sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same\ \ age hits, they are sorted by closest distance to the point(89°,179°)\n\ \ \n" - required: false - type: "string" - - name: "after" - in: "query" + schema: + type: string + - name: after + in: query description: "List of values of fields present in sort param that are used\ \ to search after. \n \n> **What it does**: Retrieve the data placed after\ \ the pointed element, given the provided order (sort).\n \n> __**Restriction\ @@ -2748,99 +2874,114 @@ paths: \ Gets the following hits of the previous search that stopped at date *01/02/2019*\ \ and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be\ \ set to 0 or kept unset\n \n" - required: false - type: "string" - - name: "before" - in: "query" + schema: + type: string + - name: before + in: query description: "Same idea that after param, but to retrieve the data placed\ \ before the pointed element, given the provided order (sort)." - required: false - type: "string" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/Hits" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Hits' + application/atom+xml: + schema: + $ref: '#/components/schemas/Hits' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + application/atom+xml: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' + application/atom+xml: + schema: + $ref: '#/components/schemas/Error' post: tags: - - "explore" - summary: "Search" + - explore + summary: Search description: "Search and return the elements found in the collection, given\ \ the filters" - operationId: "searchPost" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + operationId: searchPost parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/Search" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 + requestBody: + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Search' responses: "200": - description: "Successful operation" - schema: - $ref: "#/definitions/Hits" + description: Successful operation + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Hits' "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" + description: Bad request. + content: + application/json;charset=utf-8: + schema: + $ref: '#/components/schemas/Error' /explore/{collections}/_suggest: get: tags: - - "explore" - summary: "Suggest" - description: "Suggest the the n (n=size) most relevant terms given the filters" - operationId: "suggest" - consumes: - - "application/json;charset=utf-8" - produces: - - "application/json;charset=utf-8" + - explore + summary: Suggest + description: Suggest the the n (n=size) most relevant terms given the filters + operationId: suggest parameters: - - name: "collections" - in: "path" + - name: collections + in: path description: "collections, comma separated" required: true - type: "string" - - name: "f" - in: "query" + schema: + type: string + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided. The order does not matter. \n \n- A triplet is composed of a\ \ field name, a comparison operator and a value. \n \n The possible values\ @@ -2857,93 +2998,93 @@ paths: \ \n \n- If the fieldName starts with - then a must not filter is used\n\ \ \n- If the fieldName starts with - then a must not filter is used\n \n\ For more details, check https://gitlab.com/GISAIA.ARLAS/ARLAS-server/blob/master/doc/api/API-definition.md " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" - description: "A full text search" - required: false - type: "string" - - name: "pretty" - in: "query" - description: "Pretty print" - required: false - type: "boolean" - default: false - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - format: "int32" - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 1 - format: "int32" - - name: "field" - in: "query" - description: "Name of the field to be used for retrieving the most relevant\ - \ terms" - required: false - type: "string" - default: "_all" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + style: form + schema: + type: array + items: + type: string + - name: q + in: query + description: A full text search + schema: + type: string + - name: pretty + in: query + description: Pretty print + schema: + type: boolean + default: false + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 1 + type: integer + format: int64 + default: 0 + - name: field + in: query + description: Name of the field to be used for retrieving the most relevant + terms + schema: + type: string + default: _all + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" + description: Successful operation /explore/{collection}/_tile/{z}/{x}/{y}.png: get: tags: - - "explore" - summary: "Tiled GeoSearch" + - explore + summary: Tiled GeoSearch description: "Search and return the elements found in the collection(s) and\ \ localized in the given tile(x,y,z) as features, given the filters" - operationId: "tiledgeosearch_1" - consumes: - - "application/json;charset=utf-8" - produces: - - "image/png" + operationId: tiledgeosearch_1 parameters: - - name: "collection" - in: "path" - description: "collection" + - name: collection + in: path + description: collection required: true - type: "string" - - name: "x" - in: "path" - description: "x" + schema: + type: string + - name: x + in: path + description: x required: true - type: "integer" - format: "int32" + schema: + type: integer + format: int32 - name: "y" - in: "path" + in: path description: "y" required: true - type: "integer" - format: "int32" - - name: "z" - in: "path" - description: "z" + schema: + type: integer + format: int32 + - name: z + in: path + description: z required: true - type: "integer" - format: "int32" - - name: "f" - in: "query" + schema: + type: integer + format: int32 + - name: f + in: query description: "- A triplet for filtering the result. Multiple filter can be\ \ provided in distinct parameters (AND operator is applied) or in the same\ \ parameter separated by semi-colons (OR operator is applied). The order\ @@ -2975,54 +3116,56 @@ paths: \ \n \n :notintersects: -- {GeofieldName} does not intersect the `{given\ \ WKT string or the given }` -- a WKT string or the BBOX string : `\"west,\ \ south, east, north\"` " - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "q" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: q + in: query description: "A full text search. Optionally, it's possible to search on a\ \ field using this syntax: {fieldname}:{text}" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "dateformat" - in: "query" + style: form + schema: + type: array + items: + type: string + - name: dateformat + in: query description: "The format of dates. This parameter should be set only if a\ \ date field is queried in `f` param; when using `gt`, `lt`, `gte`, `lte`\ \ and `range` operations" - required: false - type: "string" - - name: "righthand" - in: "query" + schema: + type: string + - name: righthand + in: query description: "If righthand = true, the passed WKT should be counter clock-wise;\ \ otherwise, ARLAS-server will attempt to parse it as the \"Complementary\"\ \ Polygon on the other facet of the planet. \n Inversely, If righthand =\ \ false, the passed WKT should be clock-wise; otherwise, ARLAS-server will\ \ attempt to parse it as the \"Complementary\" Polygon on the other facet\ \ of the planet. " - required: false - type: "boolean" - - name: "size" - in: "query" - description: "The maximum number of entries or sub-entries to be returned.\ - \ The default value is 10" - required: false - type: "integer" - default: 10 - minimum: 1 - - name: "from" - in: "query" - description: "From index to start the search from. Defaults to 0." - required: false - type: "integer" - default: 0 - minimum: 0 - - name: "sort" - in: "query" + schema: + type: boolean + - name: size + in: query + description: The maximum number of entries or sub-entries to be returned. + The default value is 10 + schema: + minimum: 1 + type: integer + format: int64 + default: 10 + - name: from + in: query + description: From index to start the search from. Defaults to 0. + schema: + minimum: 1 + type: integer + format: int64 + default: 0 + - name: sort + in: query description: "Sorts the resulted hits on the given fields and/or by distance\ \ to a given point:\n \n> __**Syntax**__: `{field1},{field2},-{field3},geodistance:{lat}\ \ {lon},{field4} ...`.\n \n> **Note 1**: `{field}` can be preceded by **'-'**\ @@ -3035,13 +3178,11 @@ paths: \ sort=`age,geodistance:89 179`. Resulted hits are sorted by age. For same\ \ age hits, they are sorted by closest distance to the point(89°,179°)\n\ \ \n" - required: false - type: "array" - items: - type: "string" - collectionFormat: "multi" - - name: "after" - in: "query" + style: form + schema: + type: string + - name: after + in: query description: "List of values of fields present in sort param that are used\ \ to search after. \n \n> **What it does**: Retrieve the data placed after\ \ the pointed element, given the provided order (sort).\n \n> __**Restriction\ @@ -3057,968 +3198,1032 @@ paths: \ Gets the following hits of the previous search that stopped at date *01/02/2019*\ \ and id *abcd1234*.\n \n> __**Restriction 2**__: **from** param must be\ \ set to 0 or kept unset\n \n" - required: false - type: "string" - - name: "before" - in: "query" + schema: + type: string + - name: before + in: query description: "Same idea that after param, but to retrieve the data placed\ \ before the pointed element, given the provided order (sort)." - required: false - type: "string" - - name: "sampling" - in: "query" + schema: + type: string + - name: sampling + in: query description: "Size of the sampling for testing transparency: 1: test every\ \ pixel, 10: test 1 pixel every 10 pixels, etc." - required: false - type: "integer" - default: 10 - format: "int32" - - name: "coverage" - in: "query" + schema: + type: integer + format: int32 + default: 10 + - name: coverage + in: query description: "Percentage (]0-100]) of acceptable transparent pixels. Higher\ \ the percentage, more tiles could be used for filling the tile" - required: false - type: "integer" - default: 70 - format: "int32" - - name: "max-age-cache" - in: "query" - description: "max-age-cache" - required: false - type: "integer" - format: "int32" + schema: + type: integer + format: int32 + default: 70 + - name: max-age-cache + in: query + description: max-age-cache + schema: + type: integer + format: int32 responses: "200": - description: "Successful operation" + description: Successful operation "500": - description: "Arlas Server Error." - schema: - $ref: "#/definitions/Error" + description: Arlas Server Error. + content: + image/png: + schema: + $ref: '#/components/schemas/Error' "400": - description: "Bad request." - schema: - $ref: "#/definitions/Error" -definitions: - Bbox: - type: "object" - required: - - "east" - - "north" - - "south" - - "west" - properties: - north: - type: "number" - format: "double" - south: - type: "number" - format: "double" - east: - type: "number" - format: "double" - west: - type: "number" - format: "double" - CollectionDisplayNames: - type: "object" - properties: - collection: - type: "string" - fields: - type: "object" - additionalProperties: - type: "string" - shape_columns: - type: "object" - additionalProperties: - type: "string" - CollectionOrganisations: - type: "object" - properties: - owner: - type: "string" - shared: - type: "array" - items: - type: "string" - public: - type: "boolean" - CollectionReference: - type: "object" - required: - - "collection_name" - - "params" - properties: - collection_name: - type: "string" - params: - $ref: "#/definitions/CollectionReferenceParameters" - CollectionReferenceParameters: - type: "object" - required: - - "centroid_path" - - "geometry_path" - - "id_path" - - "index_name" - - "timestamp_path" - properties: - index_name: - type: "string" - id_path: - type: "string" - geometry_path: - type: "string" - centroid_path: - type: "string" - h3_path: - type: "string" - timestamp_path: - type: "string" - exclude_fields: - type: "string" - update_max_hits: - type: "integer" - format: "int32" - taggable_fields: - type: "string" - exclude_wfs_fields: - type: "string" - custom_params: - type: "object" - additionalProperties: - type: "string" - display_names: - $ref: "#/definitions/CollectionDisplayNames" - organisations: - $ref: "#/definitions/CollectionOrganisations" - atom_feed: - $ref: "#/definitions/Feed" - open_search: - $ref: "#/definitions/OpenSearch" - inspire: - $ref: "#/definitions/Inspire" - dublin_core_element_name: - $ref: "#/definitions/DublinCoreElementName" - raster_tile_url: - $ref: "#/definitions/RasterTileURL" - raster_tile_width: - type: "integer" - format: "int32" - raster_tile_height: - type: "integer" - format: "int32" - filter: - $ref: "#/definitions/Filter" - license_name: - type: "string" - license_urls: - type: "array" - items: - type: "string" - DublinCoreElementName: - type: "object" - properties: - title: - type: "string" - creator: - type: "string" - subject: - type: "string" - description: - type: "string" - publisher: - type: "string" - contributor: - type: "string" - type: - type: "string" - format: - type: "string" - identifier: - type: "string" - source: - type: "string" - language: - type: "string" - bbox: - $ref: "#/definitions/Bbox" - date: - type: "string" - coverage: - type: "object" - additionalProperties: - type: "object" - coverage_centroid: - type: "string" - Expression: - type: "object" - properties: - field: - type: "string" - op: - type: "string" - enum: - - "eq" - - "gte" - - "gt" - - "lte" - - "lt" - - "like" - - "ne" - - "range" - - "within" - - "notwithin" - - "intersects" - - "notintersects" - value: - type: "string" - Feed: - type: "object" - properties: - author: - $ref: "#/definitions/Person" - contributor: - $ref: "#/definitions/Person" - icon: - type: "string" - logo: - type: "string" - rights: - type: "string" - subtitle: - type: "string" - generator: - $ref: "#/definitions/Generator" - Filter: - type: "object" - properties: - f: - type: "array" - items: - type: "array" + description: Bad request. + content: + image/png: + schema: + $ref: '#/components/schemas/Error' +components: + schemas: + Success: + type: object + properties: + status: + type: integer + format: int32 + message: + type: string + Error: + type: object + properties: + status: + type: integer + format: int32 + message: + type: string + error: + type: string + Bbox: + required: + - east + - north + - south + - west + type: object + properties: + north: + type: number + format: double + south: + type: number + format: double + east: + type: number + format: double + west: + type: number + format: double + CollectionDisplayNames: + type: object + properties: + collection: + type: string + fields: + type: object + additionalProperties: + type: string + shape_columns: + type: object + additionalProperties: + type: string + CollectionOrganisations: + type: object + properties: + owner: + type: string + shared: + type: array items: - $ref: "#/definitions/Expression" - q: - type: "array" - items: - type: "array" + type: string + public: + type: boolean + CollectionReference: + required: + - collection_name + - params + type: object + properties: + collection_name: + type: string + params: + $ref: '#/components/schemas/CollectionReferenceParameters' + CollectionReferenceParameters: + required: + - centroid_path + - geometry_path + - id_path + - index_name + - timestamp_path + type: object + properties: + index_name: + type: string + id_path: + type: string + geometry_path: + type: string + centroid_path: + type: string + timestamp_path: + type: string + exclude_fields: + type: string + update_max_hits: + type: integer + format: int32 + taggable_fields: + type: string + exclude_wfs_fields: + type: string + custom_params: + type: object + additionalProperties: + type: string + display_names: + $ref: '#/components/schemas/CollectionDisplayNames' + organisations: + $ref: '#/components/schemas/CollectionOrganisations' + atom_feed: + $ref: '#/components/schemas/Feed' + open_search: + $ref: '#/components/schemas/OpenSearch' + inspire: + $ref: '#/components/schemas/Inspire' + dublin_core_element_name: + $ref: '#/components/schemas/DublinCoreElementName' + raster_tile_url: + $ref: '#/components/schemas/RasterTileURL' + raster_tile_width: + type: integer + format: int32 + raster_tile_height: + type: integer + format: int32 + filter: + $ref: '#/components/schemas/Filter' + license_name: + type: string + license_urls: + type: array items: - type: "string" - dateformat: - type: "string" - righthand: - type: "boolean" - Generator: - type: "object" - properties: - name: - type: "string" - version: - type: "string" - uri: - type: "string" - Inspire: - type: "object" - properties: - keywords: - type: "array" - items: - $ref: "#/definitions/Keyword" - topic_categories: - type: "array" - items: - type: "string" - lineage: - type: "string" - languages: - type: "array" - items: - type: "string" - spatial_resolution: - $ref: "#/definitions/InspireSpatialResolution" - inspire_uri: - $ref: "#/definitions/InspireURI" - inspire_limitation_access: - $ref: "#/definitions/InspireLimitationAccess" - inspire_use_conditions: - type: "string" - InspireLimitationAccess: - type: "object" - properties: - access_constraints: - type: "string" - other_constraints: - type: "string" - classification: - type: "string" - InspireSpatialResolution: - type: "object" - properties: - value: - $ref: "#/definitions/Number" - unit_of_measure: - type: "string" - InspireURI: - type: "object" - properties: - code: - type: "string" - namespace: - type: "string" - Keyword: - type: "object" - properties: - value: - type: "string" - vocabulary: - type: "string" - date_of_publication: - type: "string" - Number: - type: "object" - OpenSearch: - type: "object" - properties: - short_name: - type: "string" - description: - type: "string" - contact: - type: "string" - tags: - type: "string" - long_name: - type: "string" - image_height: - type: "string" - image_width: - type: "string" - image_type: - type: "string" - image_url: - type: "string" - developer: - type: "string" - attribution: - type: "string" - syndication_right: - type: "string" - adult_content: - type: "string" - language: - type: "string" - input_encoding: - type: "string" - output_encoding: - type: "string" - Person: - type: "object" - properties: - name: - type: "string" - email: - type: "string" - uri: - type: "string" - RasterTileURL: - type: "object" - required: - - "id_path" - - "url" - properties: - url: - type: "string" - id_path: - type: "string" - min_z: - type: "integer" - format: "int32" - max_z: - type: "integer" - format: "int32" - check_geometry: - type: "boolean" - Error: - type: "object" - properties: - status: - type: "integer" - format: "int32" - message: - type: "string" - error: - type: "string" - Success: - type: "object" - properties: - status: - type: "integer" - format: "int32" - message: - type: "string" - AggregationMetric: - type: "object" - properties: - type: - type: "string" - field: - type: "string" - value: - type: "object" - AggregationResponse: - type: "object" - properties: - query_time: - type: "integer" - format: "int64" - total_time: - type: "integer" - format: "int64" - totalnb: - type: "integer" - format: "int64" - name: - type: "string" - count: - type: "integer" - format: "int64" - sumotherdoccounts: - type: "integer" - format: "int64" - key: - type: "object" - key_as_string: - type: "object" - elements: - type: "array" - items: - $ref: "#/definitions/AggregationResponse" - metrics: - type: "array" - items: - $ref: "#/definitions/AggregationMetric" - hits: - type: "array" - items: - type: "object" - geometries: - type: "array" - items: - $ref: "#/definitions/ReturnedGeometry" - flattened_elements: - type: "object" - additionalProperties: - type: "object" - Crs: - type: "object" - properties: - type: - type: "string" - enum: - - "name" - - "link" + type: string + DublinCoreElementName: + type: object properties: - type: "object" - additionalProperties: - type: "object" - Feature: - type: "object" - properties: - crs: - $ref: "#/definitions/Crs" - bbox: - type: "array" - items: - type: "number" - format: "double" + title: + type: string + creator: + type: string + subject: + type: string + description: + type: string + publisher: + type: string + contributor: + type: string + type: + type: string + format: + type: string + identifier: + type: string + source: + type: string + language: + type: string + bbox: + $ref: '#/components/schemas/Bbox' + date: + type: string + coverage: + type: object + coverage_centroid: + type: string + Expression: + type: object properties: - type: "object" - additionalProperties: - type: "object" - geometry: - $ref: "#/definitions/GeoJsonObject" - id: - type: "string" - FeatureCollection: - type: "object" - properties: - crs: - $ref: "#/definitions/Crs" - bbox: - type: "array" - items: - type: "number" - format: "double" - features: - type: "array" - items: - $ref: "#/definitions/Feature" - GeoJsonObject: - type: "object" - discriminator: "type" - properties: - crs: - $ref: "#/definitions/Crs" - bbox: - type: "array" - items: - type: "number" - format: "double" - GeometryCollection: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + field: + type: string + op: + type: string + enum: + - eq + - gte + - gt + - lte + - lt + - like + - ne + - range + - within + - notwithin + - intersects + - notintersects + value: + type: string + Feed: + type: object properties: - geometries: - type: "array" + author: + $ref: '#/components/schemas/Person' + contributor: + $ref: '#/components/schemas/Person' + icon: + type: string + logo: + type: string + rights: + type: string + subtitle: + type: string + generator: + $ref: '#/components/schemas/Generator' + Filter: + type: object + properties: + f: + type: array + items: + type: array + properties: + empty: + type: boolean + items: + $ref: '#/components/schemas/Expression' + q: + type: array + items: + type: array + properties: + empty: + type: boolean + items: + type: string + dateformat: + type: string + righthand: + type: boolean + Generator: + type: object + properties: + name: + type: string + version: + type: string + uri: + type: string + Inspire: + type: object + properties: + keywords: + type: array + items: + $ref: '#/components/schemas/Keyword' + topic_categories: + type: array + items: + type: string + lineage: + type: string + languages: + type: array items: - $ref: "#/definitions/GeoJsonObject" - LineString: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + type: string + spatial_resolution: + $ref: '#/components/schemas/InspireSpatialResolution' + inspire_uri: + $ref: '#/components/schemas/InspireURI' + inspire_limitation_access: + $ref: '#/components/schemas/InspireLimitationAccess' + inspire_use_conditions: + type: string + InspireLimitationAccess: + type: object + properties: + access_constraints: + type: string + other_constraints: + type: string + classification: + type: string + InspireSpatialResolution: + type: object + properties: + value: + type: number + unit_of_measure: + type: string + InspireURI: + type: object + properties: + code: + type: string + namespace: + type: string + JSONObject: + type: object + Keyword: + type: object + properties: + value: + type: string + vocabulary: + type: string + date_of_publication: + type: string + MultiValueFilterExpression: + type: array + properties: + empty: + type: boolean + items: + $ref: '#/components/schemas/Expression' + MultiValueFilterString: + type: array + properties: + empty: + type: boolean + items: + type: string + OpenSearch: + type: object + properties: + short_name: + type: string + description: + type: string + contact: + type: string + tags: + type: string + long_name: + type: string + image_height: + type: string + image_width: + type: string + image_type: + type: string + image_url: + type: string + developer: + type: string + attribution: + type: string + syndication_right: + type: string + adult_content: + type: string + language: + type: string + input_encoding: + type: string + output_encoding: + type: string + Person: + type: object + properties: + name: + type: string + email: + type: string + uri: + type: string + RasterTileURL: + required: + - id_path + - url + type: object + properties: + url: + type: string + id_path: + type: string + min_z: + type: integer + format: int32 + max_z: + type: integer + format: int32 + check_geometry: + type: boolean + FormDataContentDisposition: + type: object properties: - coordinates: - type: "array" + type: + type: string + parameters: + type: object + additionalProperties: + type: string + fileName: + type: string + creationDate: + type: string + format: date-time + modificationDate: + type: string + format: date-time + readDate: + type: string + format: date-time + size: + type: integer + format: int64 + name: + type: string + CollectionReferenceUpdate: + type: object + properties: + organisations: + $ref: '#/components/schemas/CollectionReferenceUpdateOrg' + CollectionReferenceUpdateOrg: + type: object + properties: + public: + type: boolean + shared: + type: array items: - $ref: "#/definitions/LngLatAlt" - LngLatAlt: - type: "object" - properties: - longitude: - type: "number" - format: "double" - latitude: - type: "number" - format: "double" - altitude: - type: "number" - format: "double" - additionalElements: - type: "array" - items: - type: "number" - format: "double" - MultiLineString: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + type: string + AggregationMetric: + type: object + properties: + type: + type: string + field: + type: string + value: + type: object + AggregationResponse: + type: object properties: - coordinates: - type: "array" + query_time: + type: integer + format: int64 + total_time: + type: integer + format: int64 + totalnb: + type: integer + format: int64 + name: + type: string + count: + type: integer + format: int64 + sumotherdoccounts: + type: integer + format: int64 + key: + type: object + key_as_string: + type: object + elements: + type: array + items: + $ref: '#/components/schemas/AggregationResponse' + metrics: + type: array + items: + $ref: '#/components/schemas/AggregationMetric' + hits: + type: array + items: + type: object + geometries: + type: array items: - type: "array" + $ref: '#/components/schemas/ReturnedGeometry' + flattened_elements: + type: object + additionalProperties: + type: object + Crs: + type: object + properties: + type: + type: string + enum: + - name + - link + properties: + type: object + additionalProperties: + type: object + Feature: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + properties: + type: object + additionalProperties: + type: object + geometry: + $ref: '#/components/schemas/GeoJsonObject' + id: + type: string + FeatureCollection: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + features: + type: array items: - $ref: "#/definitions/LngLatAlt" - MultiPoint: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + $ref: '#/components/schemas/Feature' + GeoJsonObject: + required: + - type + type: object properties: - coordinates: - type: "array" + crs: + $ref: '#/components/schemas/Crs' + bbox: + type: array items: - $ref: "#/definitions/LngLatAlt" - MultiPolygon: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + type: number + format: double + type: + type: string + discriminator: + propertyName: type + GeometryCollection: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + geometries: + type: array + items: + $ref: '#/components/schemas/GeoJsonObject' + LineString: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + type: array + items: + $ref: '#/components/schemas/LngLatAlt' + LngLatAlt: + type: object properties: - coordinates: - type: "array" + longitude: + type: number + format: double + latitude: + type: number + format: double + altitude: + type: number + format: double + additionalElements: + type: array items: - type: "array" + type: number + format: double + MultiLineString: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + type: array + items: + type: array + items: + $ref: '#/components/schemas/LngLatAlt' + MultiPoint: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + type: array + items: + $ref: '#/components/schemas/LngLatAlt' + MultiPolygon: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + type: array + items: + type: array + items: + type: array + items: + $ref: '#/components/schemas/LngLatAlt' + Point: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + $ref: '#/components/schemas/LngLatAlt' + Polygon: + type: object + allOf: + - $ref: '#/components/schemas/GeoJsonObject' + - type: object + properties: + coordinates: + type: array items: - type: "array" + type: array items: - $ref: "#/definitions/LngLatAlt" - Point: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + $ref: '#/components/schemas/LngLatAlt' + ReturnedGeometry: + type: object properties: - coordinates: - $ref: "#/definitions/LngLatAlt" - Polygon: - allOf: - - $ref: "#/definitions/GeoJsonObject" - - type: "object" + reference: + type: string + geometry: + $ref: '#/components/schemas/GeoJsonObject' + sort: + type: string + is_raw: + type: boolean + Aggregation: + type: object properties: - coordinates: - type: "array" + type: + type: string + enum: + - datehistogram + - geohash + - geotile + - histogram + - term + - geohex + field: + type: string + interval: + $ref: '#/components/schemas/Interval' + format: + type: string + metrics: + type: array items: - type: "array" - items: - $ref: "#/definitions/LngLatAlt" - ReturnedGeometry: - type: "object" - properties: - reference: - type: "string" - geometry: - $ref: "#/definitions/GeoJsonObject" - sort: - type: "string" - is_raw: - type: "boolean" - Aggregation: - type: "object" - properties: - type: - type: "string" - enum: - - "datehistogram" - - "geohash" - - "geotile" - - "histogram" - - "term" - - "geohex" - field: - type: "string" - interval: - $ref: "#/definitions/Interval" - format: - type: "string" - metrics: - type: "array" - items: - $ref: "#/definitions/Metric" - order: - type: "string" - enum: - - "asc" - - "desc" - "on": - type: "string" - enum: - - "field" - - "count" - - "result" - size: - type: "string" - include: - type: "string" - raw_geometries: - type: "array" - items: - $ref: "#/definitions/RawGeometry" - aggregated_geometries: - type: "array" - items: - type: "string" + $ref: '#/components/schemas/Metric' + order: + type: string + enum: + - asc + - desc + "on": + type: string + enum: + - field + - count + - result + size: + type: string + include: + type: string + raw_geometries: + type: array + items: + $ref: '#/components/schemas/RawGeometry' + aggregated_geometries: + type: array + items: + type: string + enum: + - BBOX + - CENTROID + - CELL + - CELLCENTER + - GEOHASH + - GEOHASH_CENTER + fetch_hits: + $ref: '#/components/schemas/HitsFetcher' + AggregationsRequest: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + aggregations: + type: array + items: + $ref: '#/components/schemas/Aggregation' + Form: + type: object + properties: + pretty: + type: boolean + flat: + type: boolean + HitsFetcher: + type: object + properties: + size: + type: integer + format: int32 + include: + type: array + items: + type: string + Interval: + type: object + properties: + value: + type: number + unit: + type: string + enum: + - year + - quarter + - month + - week + - day + - hour + - minute + - second + Metric: + type: object + properties: + collect_field: + type: string + collect_fct: + type: string + enum: + - AVG + - CARDINALITY + - MAX + - MIN + - SUM + - GEOCENTROID + - GEOBBOX + RawGeometry: + type: object + properties: + geometry: + type: string + sort: + type: string + signedSort: + type: string + include: + type: array + items: + type: string + ComputationResponse: + type: object + properties: + query_time: + type: integer + format: int64 + total_time: + type: integer + format: int64 + totalnb: + type: integer + format: int64 + field: + type: string + metric: + type: string + enum: + - AVG + - MAX + - MIN + - SUM + - CARDINALITY + - SPANNING + - GEOBBOX + - GEOCENTROID + value: + type: number + format: double + geometry: + $ref: '#/components/schemas/GeoJsonObject' + ComputationRequest: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + field: + type: string + metric: + type: string enum: - - "BBOX" - - "CENTROID" - - "CELL" - - "CELLCENTER" - - "GEOHASH" - - "GEOHASH_CENTER" - fetch_hits: - $ref: "#/definitions/HitsFetcher" - AggregationsRequest: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - aggregations: - type: "array" - items: - $ref: "#/definitions/Aggregation" - Form: - type: "object" - properties: - pretty: - type: "boolean" - flat: - type: "boolean" - HitsFetcher: - type: "object" - properties: - size: - type: "integer" - format: "int32" - include: - type: "array" - items: - type: "string" - Interval: - type: "object" - properties: - value: - $ref: "#/definitions/Number" - unit: - type: "string" - enum: - - "year" - - "quarter" - - "month" - - "week" - - "day" - - "hour" - - "minute" - - "second" - Metric: - type: "object" - properties: - collect_field: - type: "string" - collect_fct: - type: "string" - enum: - - "AVG" - - "CARDINALITY" - - "MAX" - - "MIN" - - "SUM" - - "GEOCENTROID" - - "GEOBBOX" - RawGeometry: - type: "object" - properties: - geometry: - type: "string" - sort: - type: "string" - signedSort: - type: "string" - include: - type: "array" - items: - type: "string" - ComputationResponse: - type: "object" - properties: - query_time: - type: "integer" - format: "int64" - total_time: - type: "integer" - format: "int64" - totalnb: - type: "integer" - format: "int64" - field: - type: "string" - metric: - type: "string" - enum: - - "AVG" - - "MAX" - - "MIN" - - "SUM" - - "CARDINALITY" - - "SPANNING" - - "GEOBBOX" - - "GEOCENTROID" - value: - type: "number" - format: "double" - geometry: - $ref: "#/definitions/GeoJsonObject" - ComputationRequest: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - field: - type: "string" - metric: - type: "string" - enum: - - "AVG" - - "MAX" - - "MIN" - - "SUM" - - "CARDINALITY" - - "SPANNING" - - "GEOBBOX" - - "GEOCENTROID" - ArlasHit: - type: "object" - properties: - md: - $ref: "#/definitions/MD" - data: - type: "object" - Geo: - type: "object" - properties: - path: - type: "string" - geometry: - $ref: "#/definitions/GeoJsonObject" - Hits: - type: "object" - properties: - collection: - type: "string" - hits: - type: "array" - items: - $ref: "#/definitions/ArlasHit" - nbhits: - type: "integer" - format: "int64" - totalnb: - type: "integer" - format: "int64" - links: - type: "object" - additionalProperties: - $ref: "#/definitions/Link" - Link: - type: "object" - required: - - "href" - - "method" - properties: - href: - type: "string" - method: - type: "string" - body: - type: "object" - MD: - type: "object" - properties: - id: - type: "string" - timestamp: - type: "integer" - format: "int64" - geometry: - $ref: "#/definitions/GeoJsonObject" - centroid: - $ref: "#/definitions/GeoJsonObject" - returned_geometries: - type: "array" - items: - $ref: "#/definitions/Geo" - Count: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - CollectionReferenceDescription: - type: "object" - required: - - "collection_name" - - "params" - properties: + - AVG + - MAX + - MIN + - SUM + - CARDINALITY + - SPANNING + - GEOBBOX + - GEOCENTROID + ArlasHit: + type: object + properties: + md: + $ref: '#/components/schemas/MD' + data: + type: object + Geo: + type: object + properties: + path: + type: string + geometry: + $ref: '#/components/schemas/GeoJsonObject' + Hits: + type: object + properties: + collection: + type: string + hits: + type: array + items: + $ref: '#/components/schemas/ArlasHit' + nbhits: + type: integer + format: int64 + totalnb: + type: integer + format: int64 + links: + type: object + additionalProperties: + $ref: '#/components/schemas/Link' + Link: + required: + - href + - method + type: object + properties: + href: + type: string + method: + type: string + body: + type: object + MD: + type: object + properties: + id: + type: string + timestamp: + type: integer + format: int64 + geometry: + $ref: '#/components/schemas/GeoJsonObject' + centroid: + $ref: '#/components/schemas/GeoJsonObject' + returned_geometries: + type: array + items: + $ref: '#/components/schemas/Geo' + Count: + type: object + properties: + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + CollectionReferenceDescription: + required: + - collection_name + - params + type: object + properties: + properties: + type: object + additionalProperties: + $ref: '#/components/schemas/CollectionReferenceDescriptionProperty' + collection_name: + type: string + params: + $ref: '#/components/schemas/CollectionReferenceParameters' + CollectionReferenceDescriptionProperty: + type: object + properties: + type: + type: string + enum: + - TEXT + - KEYWORD + - LONG + - INTEGER + - SHORT + - BYTE + - DOUBLE + - FLOAT + - DATE + - BOOLEAN + - BINARY + - INT_RANGE + - FLOAT_RANGE + - LONG_RANGE + - DOUBLE_RANGE + - DATE_RANGE + - OBJECT + - NESTED + - GEO_POINT + - GEO_SHAPE + - IP + - COMPLETION + - TOKEN_COUNT + - MAPPER_MURMUR3 + - UNKNOWN + - VARCHAR + - CHAR + - CHARACTER + - BIT + - TINYINT + - SMALLINT + - INT + - BIGINT + - DECIMAL + - NUMERIC + - REAL + - DOUBLEPRECISION + - TIMESTAMP + - TIME + - INTERVAL + - GEOMETRY + - GEOGRAPHY + - POINT + - LINESTRING + - POLYGON + - MULTIPOINT + - MULTILINESTRING + - MULTIPOLYGON + - GEOMETRYCOLLECTION + - MURMUR3 + format: + type: string + hash_field: + type: string + properties: + type: object + additionalProperties: + $ref: '#/components/schemas/CollectionReferenceDescriptionProperty' + taggable: + type: boolean + indexed: + type: boolean + Page: + type: object + properties: + size: + type: integer + format: int32 + from: + type: integer + format: int32 + sort: + type: string + after: + type: string + before: + type: string + Projection: + type: object properties: - type: "object" - additionalProperties: - $ref: "#/definitions/CollectionReferenceDescriptionProperty" - collection_name: - type: "string" - params: - $ref: "#/definitions/CollectionReferenceParameters" - CollectionReferenceDescriptionProperty: - type: "object" - properties: - type: - type: "string" - enum: - - "TEXT" - - "KEYWORD" - - "LONG" - - "INTEGER" - - "SHORT" - - "BYTE" - - "DOUBLE" - - "FLOAT" - - "DATE" - - "BOOLEAN" - - "BINARY" - - "INT_RANGE" - - "FLOAT_RANGE" - - "LONG_RANGE" - - "DOUBLE_RANGE" - - "DATE_RANGE" - - "OBJECT" - - "NESTED" - - "GEO_POINT" - - "GEO_SHAPE" - - "IP" - - "COMPLETION" - - "TOKEN_COUNT" - - "MAPPER_MURMUR3" - - "UNKNOWN" - - "VARCHAR" - - "CHAR" - - "CHARACTER" - - "BIT" - - "TINYINT" - - "SMALLINT" - - "INT" - - "BIGINT" - - "DECIMAL" - - "NUMERIC" - - "REAL" - - "DOUBLEPRECISION" - - "TIMESTAMP" - - "TIME" - - "INTERVAL" - - "GEOMETRY" - - "GEOGRAPHY" - - "POINT" - - "LINESTRING" - - "POLYGON" - - "MULTIPOINT" - - "MULTILINESTRING" - - "MULTIPOLYGON" - - "GEOMETRYCOLLECTION" - - "MURMUR3" - format: - type: "string" - hash_field: - type: "string" + includes: + type: string + excludes: + type: string + Search: + type: object properties: - type: "object" - additionalProperties: - $ref: "#/definitions/CollectionReferenceDescriptionProperty" - taggable: - type: "boolean" - indexed: - type: "boolean" - Page: - type: "object" - properties: - size: - type: "integer" - format: "int32" - from: - type: "integer" - format: "int32" - sort: - type: "string" - after: - type: "string" - before: - type: "string" - Projection: - type: "object" - properties: - includes: - type: "string" - excludes: - type: "string" - Search: - type: "object" - properties: - filter: - $ref: "#/definitions/Filter" - form: - $ref: "#/definitions/Form" - page: - $ref: "#/definitions/Page" - projection: - $ref: "#/definitions/Projection" - returned_geometries: - type: "string" + filter: + $ref: '#/components/schemas/Filter' + form: + $ref: '#/components/schemas/Form' + page: + $ref: '#/components/schemas/Page' + projection: + $ref: '#/components/schemas/Projection' + returned_geometries: + type: string diff --git a/pom.xml b/pom.xml index 62237b1c9..17176c7dc 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ - 2.19.0 + 2.23.0 UTF-8 true 2.22.2 @@ -53,13 +53,13 @@ 5.4.0 - 2.1.10 - 2.0.12-1 - 2.2.15 - 2.3.8 - 2.41 - 2.1.2 - 2.15.2 + 4.0.7 + + 2.16.1 + 4.0.5-1 + 4.0.4 + + 3.0.12 5.3.6 @@ -82,15 +82,6 @@ 1.29 1.7.3 - - - - 1.3.4 - 1.3.7 - 1.3.3 - - openapi/swagger.json - target/generated-docs/ @@ -141,62 +132,6 @@ ${maven.surefire.version} - - - io.github.swagger2markup - swagger2markup-maven-plugin - ${swagger2markup.plugin.version} - - - io.github.swagger2markup - swagger2markup-import-files-ext - ${swagger2markup.extension.version} - - - io.github.swagger2markup - swagger2markup - ${swagger2markup.version} - - - - ${swagger.input} - ${swagger.output} - - ASCIIDOC - TAGS - ${project.basedir}/src/docs/asciidoc/extensions/overview - ${project.basedir}/src/docs/asciidoc/extensions/definitions - ${project.basedir}/src/docs/asciidoc/extensions/paths - ${project.basedir}src/docs/asciidoc/extensions/security - - - - - - io.github.swagger2markup - swagger2markup-maven-plugin - ${swagger2markup.plugin.version} - - - io.github.swagger2markup - swagger2markup-import-files-ext - ${swagger2markup.extension.version} - - - io.github.swagger2markup - swagger2markup - ${swagger2markup.version} - - - - ${swagger.input} - ${swagger.output} - - MARKDOWN - - - - org.apache.maven.plugins maven-site-plugin diff --git a/release.sh b/release.sh index 7bb0f1173..627ca9e70 100755 --- a/release.sh +++ b/release.sh @@ -171,15 +171,20 @@ i=1; until nc -w 2 ${DOCKER_IP} 19999; do if [ $i -lt 30 ]; then sleep 1; else b echo "=> Get swagger documentation" mkdir -p target/tmp || echo "target/tmp exists" -i=1; until curl -XGET http://${DOCKER_IP}:19999/arlas/swagger.json -o target/tmp/swagger.json; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done -i=1; until curl -XGET http://${DOCKER_IP}:19999/arlas/swagger.yaml -o target/tmp/swagger.yaml; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done +i=1; until curl -XGET http://${DOCKER_IP}:19999/arlas/openapi.json -o target/tmp/openapi.json; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done +i=1; until curl -XGET http://${DOCKER_IP}:19999/arlas/openapi.yaml -o target/tmp/openapi.yaml; do if [ $i -lt 60 ]; then sleep 1; else break; fi; i=$(($i + 1)); done mkdir -p openapi -cp target/tmp/swagger.yaml openapi -cp target/tmp/swagger.json openapi +cp target/tmp/openapi.yaml openapi +cp target/tmp/openapi.json openapi echo "=> Generate API documentation" -mvn "-Dswagger.output=docs/api" swagger2markup:convertSwagger2markup +mkdir -p docs/api +docker run --rm \ + --mount dst=/input/api.json,src="$PWD/openapi/openapi.json",type=bind,ro \ + --mount dst=/input/env.json,src="$PWD/conf/doc/widdershins.json",type=bind,ro \ + --mount dst=/output,src="$PWD/docs/api",type=bind \ + gisaia/widdershins:4.0.1 echo "=> Stop arlas-server stack" docker-compose -f docker-compose.yml -f docker-compose-elasticsearch.yml --project-name arlas down -v @@ -201,19 +206,19 @@ else docker run --rm \ -e GROUP_ID="$(id -g)" \ -e USER_ID="$(id -u)" \ - --mount dst=/input/api.json,src="$PWD/target/tmp/swagger.json",type=bind,ro \ + --mount dst=/input/api.json,src="$PWD/target/tmp/openapi.json",type=bind,ro \ --mount dst=/input/config.json,src="$PWD/conf/swagger/java-config.json",type=bind,ro \ --mount dst=/output,src="$PWD/target/tmp/java-api",type=bind \ - gisaia/swagger-codegen-3.0.35 \ + gisaia/swagger-codegen-3.0.42 \ -l java --type-mappings GeoJsonObject=Object mkdir -p target/tmp/typescript-fetch docker run --rm \ -e GROUP_ID="$(id -g)" \ -e USER_ID="$(id -u)" \ - --mount dst=/input/api.json,src="$PWD/target/tmp/swagger.json",type=bind,ro \ + --mount dst=/input/api.json,src="$PWD/target/tmp/openapi.json",type=bind,ro \ --mount dst=/output,src="$PWD/target/tmp/typescript-fetch",type=bind \ - gisaia/swagger-codegen-2.4.14 \ + gisaia/swagger-codegen-3.0.42 \ -l typescript-fetch --additional-properties modelPropertyNaming=snake_case echo "=> Build Typescript API "${FULL_API_VERSION} @@ -288,8 +293,8 @@ if [ "$SIMULATE" == "NO" ]; then git tag -d v${ARLAS_VERSION} git push origin :v${ARLAS_VERSION} echo "=> Commit release version" - git add openapi/swagger.json - git add openapi/swagger.yaml + git add openapi/openapi.json + git add openapi/openapi.yaml git add docs/api git commit -a -m "release version ${ARLAS_VERSION}" git tag v${ARLAS_VERSION} @@ -315,10 +320,10 @@ echo "=> Update REST API version in JAVA source code" sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"API_VERSION\"/' arlas-rest/src/main/java/io/arlas/server/rest/explore/ExploreRESTServices.java if [ "$SIMULATE" == "NO" ]; then - sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/swagger.yaml - sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/swagger.json - git add openapi/swagger.json - git add openapi/swagger.yaml + sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/openapi.yaml + sed -i.bak 's/\"'${FULL_API_VERSION}'\"/\"'${API_DEV_VERSION}-SNAPSHOT'\"/' openapi/openapi.json + git add openapi/openapi.json + git add openapi/openapi.yaml git commit -a -m "development version ${ARLAS_DEV_VERSION}-SNAPSHOT" git push origin develop else echo "=> Skip git push develop"; fi diff --git a/stac-api/pom.xml b/stac-api/pom.xml index d952fe810..7c5eb0176 100644 --- a/stac-api/pom.xml +++ b/stac-api/pom.xml @@ -20,17 +20,13 @@ arlas-core 24.1.2-SNAPSHOT + com.ethlo.time itu ${itu.version} - - io.swagger.core.v3 - swagger-annotations - ${swaggerv3.version} - diff --git a/stac-api/src/main/java/io/arlas/server/stac/api/StacCollectionsRESTService.java b/stac-api/src/main/java/io/arlas/server/stac/api/StacCollectionsRESTService.java index 7c2838337..378e4c0e4 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/api/StacCollectionsRESTService.java +++ b/stac-api/src/main/java/io/arlas/server/stac/api/StacCollectionsRESTService.java @@ -31,21 +31,21 @@ import io.arlas.server.core.services.ExploreService; import io.arlas.server.stac.model.*; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.Explode; import io.swagger.v3.oas.annotations.enums.ParameterStyle; import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; 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 jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -65,12 +65,13 @@ public StacCollectionsRESTService(STACConfiguration configuration, @Path("/collections") @GET @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "The feature collections in the dataset", - notes = "A body of Feature Collections that belong or are used together with additional links.\n" + - "Request may not return the full set of metadata per Feature Collection.") + @Operation( + summary = "The feature collections in the dataset", + description = """ + A body of Feature Collections that belong or are used together with additional links. + Request may not return the full set of metadata per Feature Collection.""") @ApiResponses(value = { - @ApiResponse(code = 200, message = """ + @ApiResponse(responseCode = "200", description = """ The feature collections shared by this API. The dataset is organized as one or more feature collections. This resource provides information about and access to the collections. @@ -82,13 +83,15 @@ For each collection, a link to the items in the collection (path `/collections/{ * An optional title and description for the collection; * An optional extent that can be used to provide an indication of the spatial and temporal extent of the collection - typically derived from the data; * An optional indicator about the type of the items in the collection (the default value, if the indicator is not provided, is 'feature').""", - response = CollectionList.class, responseContainer = "CollectionList"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + content = @Content(schema = @Schema(implementation = CollectionList.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getCollections(@Context UriInfo uriInfo, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { @@ -116,11 +119,11 @@ public Response getCollections(@Context UriInfo uriInfo, @Path("/collections/{collectionId}") @GET @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Describe the feature collection with id `collectionId`", - notes = "A single Feature Collection for the given id `collectionId`. Request this endpoint to get a full list of metadata for the Feature Collection.") + @Operation( + summary = "Describe the feature collection with id `collectionId`", + description = "A single Feature Collection for the given id `collectionId`. Request this endpoint to get a full list of metadata for the Feature Collection.") @ApiResponses(value = { - @ApiResponse(code = 200, message = """ + @ApiResponse(responseCode = "200", description = """ Information about the feature collection with id `collectionId`. The response contains a link to the items in the collection (path `/collections/{collectionId}/items`, link relation `items`) as well as key information about the collection. This information includes: @@ -129,14 +132,17 @@ The response contains a link to the items in the collection (path `/collections/ * An optional title and description for the collection; * An optional extent that can be used to provide an indication of the spatial and temporal extent of the collection - typically derived from the data; * An optional indicator about the type of the items in the collection (the default value, if the indicator is not provided, is 'feature').""", - response = Collection.class, responseContainer = "Collection"), - @ApiResponse(code = 404, message = "The requested URI was not found.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + content = @Content(schema = @Schema(implementation = Collection.class))), + @ApiResponse(responseCode = "404", description = "The requested URI was not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response describeCollection(@Context UriInfo uriInfo, - @ApiParam(name = "collectionId", value = "Local identifier of a collection", required = true) + @Parameter(name = "collectionId", description = "Local identifier of a collection", required = true) @PathParam(value = "collectionId") String collectionId, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { @@ -147,14 +153,14 @@ public Response describeCollection(@Context UriInfo uriInfo, @Path("/collections/{collectionId}/items") @GET @Produces({ "application/geo+json", MediaType.APPLICATION_JSON }) - @ApiOperation( - value = "Fetch features", - notes = """ + @Operation( + summary = "Fetch features", + description = """ Fetch features of the feature collection with id `collectionId`. Every feature in a dataset belongs to a collection. A dataset may consist of multiple feature collections. A feature collection is often a collection of features of a similar type, based on a common schema.""") @ApiResponses(value = { - @ApiResponse(code = 200, message = """ + @ApiResponse(responseCode = "200", description = """ The response is a document consisting of features in the collection. The features included in the response are determined by the server based on the query parameters of the request. To support access to larger collections without overloading the client, the API supports paged access with links to the next page, if more features are selected than the page size. @@ -163,27 +169,31 @@ public Response describeCollection(@Context UriInfo uriInfo, The `datetime` parameter matches all features in the collection that are not associated with a time stamp or interval, too. The `limit` parameter may be used to control the subset of the selected features that should be returned in the response, the page size. Each page may include information about the number of selected and returned features (`numberMatched` and `numberReturned`) as well as links to support paging (link relation `next`).""", - response = StacFeatureCollection.class, responseContainer = "StacFeatureCollection"), - @ApiResponse(code = 400, message = "A query parameter has an invalid value.", response = Error.class), - @ApiResponse(code = 404, message = "The requested URI was not found.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + content = @Content(schema = @Schema(implementation = StacFeatureCollection.class))), + @ApiResponse(responseCode = "400", description = "A query parameter has an invalid value.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "404", description = "The requested URI was not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getFeatures(@Context UriInfo uriInfo, - @ApiParam(name = "collectionId", value = "Local identifier of a collection", required = true) + @Parameter(name = "collectionId", description = "Local identifier of a collection", required = true) @PathParam(value = "collectionId") String collectionId, - @Parameter(name = "limit", style = ParameterStyle.FORM, - schema = @Schema(maximum="10000", defaultValue = "10", minimum = "1", type="integer")) - @ApiParam(name = "limit", defaultValue = "10", allowableValues = "range[1,10000]", value = """ + @Parameter(name = "limit", + description = """ The optional limit parameter limits the number of items that are presented in the response document. Only items are counted that are on the first level of the collection in the response document. Nested objects contained within the explicitly requested items shall not be counted. - Minimum = 1. Maximum = 10000. Default = 10.""") + Minimum = 1. Maximum = 10000. Default = 10.""", + style = ParameterStyle.FORM, + schema = @Schema(type="integer", minimum = "1", maximum="10000", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "limit") IntParam limit, - @Parameter(name = "bbox", style = ParameterStyle.FORM, explode = Explode.FALSE, - array = @ArraySchema(schema = @Schema(type="number"), maxItems = 6, minItems = 4)) - @ApiParam(name = "bbox", value = """ + @Parameter(name = "bbox", + description = """ Only features that have a geometry that intersects the bounding box are selected. The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or depth): * Lower left corner, coordinate axis 1 * Lower left corner, coordinate axis 2 @@ -196,48 +206,51 @@ Only features that have a geometry that intersects the bounding box are selected For WGS 84 longitude/latitude the values are in most cases the sequence of minimum longitude, minimum latitude, maximum longitude and maximum latitude. However, in cases where the box spans the antimeridian the first value (west-most box edge) is larger than the third value (east-most box edge). If the vertical axis is included, the third and the sixth number are the bottom and the top of the 3-dimensional bounding box. - If a feature has multiple spatial geometry properties, it is the decision of the server whether only a single spatial geometry property is used to determine the extent or all relevant geometries.""") + If a feature has multiple spatial geometry properties, it is the decision of the server whether only a single spatial geometry property is used to determine the extent or all relevant geometries.""", + style = ParameterStyle.FORM, + explode = Explode.FALSE, + array = @ArraySchema(schema = @Schema(type="number"), minItems = 4, maxItems = 6)) @QueryParam(value = "bbox") String bbox, - @Parameter(name = "datetime", style = ParameterStyle.FORM) - @ApiParam(name = "datetime", value = """ + @Parameter(name = "datetime", + description = """ Either a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots. Examples: * A date-time: "2018-02-12T23:20:50Z" * A closed interval: "2018-02-12T00:00:00Z/2018-03-18T12:31:12Z" * Open intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z" Only features that have a temporal property that intersects the value of `datetime` are selected. - If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.""") + If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.""", + style = ParameterStyle.FORM) @QueryParam(value = "datetime") String datetime, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - @ApiParam(name = "sortby", value = "**Optional Extension:** Sort An array of property names, prefixed by either \"+\" for ascending " + - "or \"-\" for descending. If no prefix is provided, \"+\" is assumed.") + @Parameter(name = "sortby", description = """ + **Optional Extension:** Sort An array of property names, prefixed by either "+" + for ascending or "-" for descending. If no prefix is provided, "+" is assumed.""") @QueryParam(value = "sortby") String sortBy, - @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "0", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "after", value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { @@ -264,30 +277,32 @@ However, in cases where the box spans the antimeridian the first value (west-mos @Path("/collections/{collectionId}/items/{featureId}") @GET @Produces({ "application/geo+json", MediaType.APPLICATION_JSON }) - @ApiOperation( - value = "Fetch a single feature", - notes = "Fetch the feature with id `featureId` in the feature collection with id `collectionId`.") + @Operation( + summary = "Fetch a single feature", + description = "Fetch the feature with id `featureId` in the feature collection with id `collectionId`.") @ApiResponses(value = { - @ApiResponse(code = 200, message = "Fetch the feature with id `featureId` in the feature collection with id `collectionId`.", - response = Item.class, responseContainer = "Item"), - @ApiResponse(code = 404, message = "The requested URI was not found.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponse(responseCode = "200", description = "Fetch the feature with id `featureId` in the feature collection with id `collectionId`.", + content = @Content(schema = @Schema(implementation = Item.class))), + @ApiResponse(responseCode = "404", description = "The requested URI was not found.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getFeature(@Context UriInfo uriInfo, - @ApiParam(name = "collectionId", value = "Local identifier of a collection", required = true) + @Parameter(name = "collectionId", description = "Local identifier of a collection", required = true) @PathParam(value = "collectionId") String collectionId, - @ApiParam(name = "featureId", value = "Local identifier of a feature", required = true) + @Parameter(name = "featureId", description = "Local identifier of a feature", required = true) @PathParam(value = "featureId") String featureId, - @ApiParam(hidden = true) - @HeaderParam(value = PARTITION_FILTER) String partitionFilter, + @Parameter(hidden = true) + @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations - ) throws ArlasException { CollectionReference collectionReference = collectionReferenceService.getCollectionReference(collectionId, Optional.ofNullable(organisations)); diff --git a/stac-api/src/main/java/io/arlas/server/stac/api/StacConformanceRESTService.java b/stac-api/src/main/java/io/arlas/server/stac/api/StacConformanceRESTService.java index 32bd12020..d83840218 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/api/StacConformanceRESTService.java +++ b/stac-api/src/main/java/io/arlas/server/stac/api/StacConformanceRESTService.java @@ -20,20 +20,22 @@ package io.arlas.server.stac.api; import com.codahale.metrics.annotation.Timed; -import io.arlas.server.core.app.STACConfiguration; import io.arlas.commons.rest.response.Error; +import io.arlas.server.core.app.STACConfiguration; import io.arlas.server.core.services.CollectionReferenceService; import io.arlas.server.core.services.ExploreService; import io.arlas.server.stac.model.ConformanceClasses; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; public class StacConformanceRESTService extends StacRESTService { @@ -48,14 +50,18 @@ public StacConformanceRESTService(STACConfiguration configuration, @Path("/conformance") @GET @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Conformance", - notes = "The URIs of all conformance classes supported by the server.\n" + - "To support \"generic\" clients that want to access multiple OGC API Features implementations - " + - "and not \"just\" a specific API / server, the server declares the conformance classes it implements and conforms to.") + @Operation( + summary = "Conformance", + description = """ + The URIs of all conformance classes supported by the server. + To support "generic" clients that want to access multiple OGC API Features implementations - + and not "just" a specific API / server, the server declares the conformance classes it implements and conforms to.""") @ApiResponses(value = { - @ApiResponse(code = 200, message = "Successful operation", response = ConformanceClasses.class, responseContainer = "ConformanceClasses"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponse(responseCode = "200", description = "Successful operation", + content = @Content(schema = @Schema(implementation = ConformanceClasses.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getConformanceDeclaration() { return cache(Response.ok(new ConformanceClasses().conformsTo(configuration.conformsTo)), 0); } diff --git a/stac-api/src/main/java/io/arlas/server/stac/api/StacCoreRESTService.java b/stac-api/src/main/java/io/arlas/server/stac/api/StacCoreRESTService.java index 15a00d77e..9dca1561b 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/api/StacCoreRESTService.java +++ b/stac-api/src/main/java/io/arlas/server/stac/api/StacCoreRESTService.java @@ -20,72 +20,70 @@ package io.arlas.server.stac.api; import com.codahale.metrics.annotation.Timed; -import io.arlas.server.core.app.STACConfiguration; import io.arlas.commons.exceptions.ArlasException; import io.arlas.commons.rest.response.Error; +import io.arlas.server.core.app.STACConfiguration; import io.arlas.server.core.services.CollectionReferenceService; import io.arlas.server.core.services.ExploreService; -import io.arlas.server.core.utils.UriInfoWrapper; import io.arlas.server.stac.model.LandingPage; import io.arlas.server.stac.model.StacLink; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +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 jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import java.util.ArrayList; import java.util.List; import java.util.Optional; import static io.arlas.commons.rest.utils.ServerConstants.ARLAS_ORGANISATION; import static io.arlas.commons.rest.utils.ServerConstants.COLUMN_FILTER; -import static javax.ws.rs.core.UriBuilder.fromUri; public class StacCoreRESTService extends StacRESTService { - private final Client client; - + private final String openAPIjson; public StacCoreRESTService(STACConfiguration configuration, int arlasRestCacheTimeout, CollectionReferenceService collectionReferenceService, - ExploreService exploreService, String baseUri) { - super(configuration, arlasRestCacheTimeout, collectionReferenceService, exploreService,baseUri); - this.client = ClientBuilder.newClient(); + ExploreService exploreService, String baseUri, String openAPIjson) { + super(configuration, arlasRestCacheTimeout, collectionReferenceService, exploreService, baseUri); + this.openAPIjson = openAPIjson; } @Timed @Path("/") @GET @Produces(MediaType.APPLICATION_JSON) - @ApiOperation( - value = "Landing page", - notes = "Returns the root STAC Catalog or STAC Collection that is the entry point for " + - "users to browse with STAC Browser or for search engines to crawl.\n" + - "This can either return a single STAC Collection or more commonly a STAC catalog.\n" + - "The landing page provides links to the API definition (link relations `service-desc` and `service-doc`) " + - "and the STAC records such as collections/catalogs (link relation `child`) or items (link relation `item`).\n" + - "Extensions may add additional links with new relation types.", - response = LandingPage.class) + @Operation( + summary = "Landing page", + description = """ + Returns the root STAC Catalog or STAC Collection that is the entry point for users to browse with STAC Browser or for search engines to crawl. + This can either return a single STAC Collection or more commonly a STAC catalog. + The landing page provides links to the API definition (link relations `service-desc` and `service-doc`) and the STAC records such as collections/catalogs (link relation `child`) or items (link relation `item`). + Extensions may add additional links with new relation types.""") @ApiResponses(value = { - @ApiResponse(code = 200, message = "The landing page provides links to the API definition (link relations " + - "`service-desc` and `service-doc`) and the Feature Collection (path `/collections`, link relation " + - "`data`).", response = LandingPage.class, responseContainer = "LandingPage"), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponse(responseCode = "200", description = """ + The landing page provides links to the API definition (link relations `service-desc` and `service-doc`) and the Feature Collection (path `/collections`, link relation `data`).""", + content = @Content(schema = @Schema(implementation = LandingPage.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getLandingPage(@Context UriInfo uriInfo, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { @@ -120,15 +118,12 @@ public Response getLandingPage(@Context UriInfo uriInfo, @Path("/api") @GET @Produces("application/vnd.oai.openapi+json;version=3.0") - @ApiOperation( - value = "OpenAPI", - response = String.class) + @Operation(summary = "OpenAPI") @ApiResponses(value = { - @ApiResponse(code = 200, message = "OpenAPI specification", response = String.class, responseContainer = "OpenAPI")}) + @ApiResponse(responseCode = "200", description = "OpenAPI specification", + content = @Content(schema = @Schema(implementation = String.class))) + }) public Response getApi(@Context UriInfo uriInfo) { - return Response.ok(client - .target(fromUri(new UriInfoWrapper(uriInfo,baseUri).getBaseUri()).path("openapi.json").build()) - .request() - .get().getEntity()).type("application/vnd.oai.openapi+json;version=3.0").build(); + return Response.ok(openAPIjson).type("application/vnd.oai.openapi+json;version=3.0").build(); } } diff --git a/stac-api/src/main/java/io/arlas/server/stac/api/StacRESTService.java b/stac-api/src/main/java/io/arlas/server/stac/api/StacRESTService.java index 44d4da908..0e90e82a2 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/api/StacRESTService.java +++ b/stac-api/src/main/java/io/arlas/server/stac/api/StacRESTService.java @@ -41,7 +41,13 @@ import io.arlas.server.stac.model.Collection; import io.arlas.server.stac.model.*; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.Api; +import io.swagger.v3.oas.annotations.OpenAPIDefinition; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriBuilder; +import jakarta.ws.rs.core.UriInfo; import org.geojson.Feature; import org.geojson.FeatureCollection; import org.geojson.GeoJsonObject; @@ -50,11 +56,6 @@ import org.locationtech.jts.io.ParseException; import org.locationtech.jts.io.geojson.GeoJsonReader; -import javax.ws.rs.Path; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriBuilder; -import javax.ws.rs.core.UriInfo; import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneOffset; @@ -65,11 +66,11 @@ import java.util.stream.Stream; import static io.arlas.server.core.utils.TimestampTypeMapper.formatDate; -import static javax.ws.rs.core.UriBuilder.fromUri; +import static jakarta.ws.rs.core.UriBuilder.fromUri; @Path("/stac") -@Api(value = "/stac") - +@Tag(name="stac", description="STAC API") +@OpenAPIDefinition public abstract class StacRESTService { protected ExploreService exploreService; protected CollectionReferenceService collectionReferenceService; @@ -117,10 +118,6 @@ protected StacLink getRawLink(String url, String rel) { return getRawLink(url, rel, MediaType.APPLICATION_JSON); } - protected StacLink getRawLink(String url, String rel, String type) { - return new StacLink().rel(rel).type(type).href(url); - } - protected StacLink getRawLink(String url, String rel, Object body) { return new StacLink().method("POST").rel(rel).type(MediaType.APPLICATION_JSON).href(url).body(body); } @@ -130,9 +127,8 @@ protected StacLink getLink(UriInfo uriInfo, String path, String rel, String type } protected StacLink getLink(UriInfo uriInfo, String path, String method, String rel, String type) { - StacLink link = new StacLink().method(method).rel(rel).type(type) + return new StacLink().method(method).rel(rel).type(type) .href(fromUri(new UriInfoWrapper(uriInfo,baseUri).getBaseUri()).path(StacRESTService.class).path(path).build().toString()); - return link; } protected String getAggregateUrl(UriInfo uriInfo, CollectionReference collection, String type, String id) { @@ -151,9 +147,7 @@ protected Collection getCollection(CollectionReference collectionReference, UriI List cLinks = new ArrayList<>(); cLinks.add(getRootLink(uriInfo)); if(collectionReference.params.licenseUrls != null && !collectionReference.params.licenseUrls.isEmpty()){ - collectionReference.params.licenseUrls.forEach(l->{ - cLinks.add(getRawLink(l, "licence")); - }); + collectionReference.params.licenseUrls.forEach(l -> cLinks.add(getRawLink(l, "licence"))); } String licenseName = collectionReference.params.licenseName; if(licenseName == null){ @@ -200,7 +194,7 @@ protected Item getItem(Feature feature, CollectionReference collection, UriInfo assets.put("shapefile", getAggregateUrl(uriInfo, collection, "_shapesearch", md.id)); // https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#item-fields - Item item = new Item() + return new Item() .stacVersion(configuration.stacVersion) .stacExtensions(new ArrayList<>()) .id(md.id) @@ -209,9 +203,7 @@ protected Item getItem(Feature feature, CollectionReference collection, UriInfo .properties(feature.getProperties()) .links(links) .assets(assets) - .collection(collection.collectionName) - ; - return item; + .collection(collection.collectionName); } private static String getCleanSortBy(String idPath, String sortByParam) { @@ -257,7 +249,7 @@ protected StacFeatureCollection getStacFeatureCollection(CollectionReference col MixedRequest request = new MixedRequest(); request.basicRequest = search; request.headerRequest = searchHeader; - request.columnFilter = ColumnFilterUtil.getCollectionRelatedColumnFilter(columnFilter, collectionReference);; + request.columnFilter = ColumnFilterUtil.getCollectionRelatedColumnFilter(columnFilter, collectionReference); HashMap context = new HashMap<>(); FeatureCollection features = exploreService.getFeatures(request, collectionReference, false, @@ -271,6 +263,7 @@ protected StacFeatureCollection getStacFeatureCollection(CollectionReference col Arrays.asList("self", "next", "previous").forEach(rel -> { if (context.containsKey(rel)) { if (method.equals("POST")) { + // TODO : fix when body is null!! links.add(getRawLink(((Link)context.get(rel)).href, rel, getSearchBody(body, (Search) ((Link)context.get(rel)).body))); } else { links.add(getRawLink(((Link)context.get(rel)).href, rel)); @@ -292,9 +285,9 @@ protected StacFeatureCollection getStacFeatureCollection(CollectionReference col response.setTimeStamp(ITU.formatUtc(OffsetDateTime.now())); } else { Map ctx = new HashMap<>(); - ctx.put("returned", Long.valueOf(items.size())); - ctx.put("limit", body.getLimit()); - ctx.put("matched", (Long)context.get("matched")); + ctx.put("returned", (long) items.size()); + ctx.put("limit", body == null ? 10 : body.getLimit()); + ctx.put("matched", context.get("matched")); response.setContext(ctx); } return response; @@ -338,7 +331,7 @@ protected String getDateFilter(String datetime, CollectionReference collectionRe String[] parts = datetime.split("/"); if (parts.length == 1) { try { - Long millisecondValue = Long.valueOf(OffsetDateTime.parse(datetime).toInstant().toEpochMilli()); + Long millisecondValue = OffsetDateTime.parse(datetime).toInstant().toEpochMilli(); dateFormatted = formatDate(millisecondValue,format); } catch (DateTimeParseException e) { throw new InvalidParameterException("Datetime value is not RFC 3339 compatible: " + datetime); @@ -350,8 +343,8 @@ protected String getDateFilter(String datetime, CollectionReference collectionRe } else if (parts[1].equals("..")) { return StringUtil.concat(dateField, ":", OperatorEnum.gte.name(), ":", getTimestamp(parts[0])); } else { - if (Long.valueOf(OffsetDateTime.parse(parts[0]).toInstant().toEpochMilli()) > - Long.valueOf(OffsetDateTime.parse(parts[1]).toInstant().toEpochMilli())) { + if (OffsetDateTime.parse(parts[0]).toInstant().toEpochMilli() > + OffsetDateTime.parse(parts[1]).toInstant().toEpochMilli()) { throw new InvalidParameterException("Interval dates cannot be the same: " + datetime ); } return StringUtil.concat(dateField, ":", OperatorEnum.range.name(), ":[", getTimestamp(parts[0]), "<", getTimestamp(parts[1]), "]"); @@ -364,7 +357,7 @@ protected String getDateFilter(String datetime, CollectionReference collectionRe protected String getGeoFilter(GeoJsonObject geojson, CollectionReference collectionReference) throws ArlasException { if (geojson != null) { try { - /** righthand parameter is forced for STAC; therefore, passed righthand WKTs will be used correctly; **/ + // righthand parameter is forced for STAC; therefore, passed righthand WKTs will be used correctly; Geometry geometry = reader.read(writer.writeValueAsString(geojson)); return StringUtil.concat(collectionReference.params.centroidPath, ":", OperatorEnum.intersects.name(), ":", geometry.toText()); @@ -379,7 +372,7 @@ protected List getBboxAsList(String bbox) throws InvalidParameterExcepti List bboxList = null; try { if (bbox != null) { - bboxList = Stream.of(bbox.split(",")).map(e -> Double.valueOf(e)).collect(Collectors.toList()); + bboxList = Stream.of(bbox.split(",")).map(Double::valueOf).collect(Collectors.toList()); } } catch (NumberFormatException e) { throw new InvalidParameterException("Invalid bbox definition: " + bbox); @@ -403,9 +396,9 @@ protected String getGeoFilter(List bbox, CollectionReference collectionR } return StringUtil.concat(collectionReference.params.centroidPath, ":within:", - String.join(",", bbox.stream() - .map(d -> d.toString()) - .collect(Collectors.toList()))); + bbox.stream() + .map(Object::toString) + .collect(Collectors.joining(","))); } protected String getIdFilter(String id, CollectionReference collectionReference) { @@ -413,7 +406,7 @@ protected String getIdFilter(String id, CollectionReference collectionReference) } protected String getIdFilter(List ids, CollectionReference collectionReference) { - if (ids != null && ids.size() > 0) { + if (ids != null && !ids.isEmpty()) { return StringUtil.concat(collectionReference.params.idPath, ":", OperatorEnum.eq.name(), ":", String.join(",", ids)); } diff --git a/stac-api/src/main/java/io/arlas/server/stac/api/StacSearchRESTService.java b/stac-api/src/main/java/io/arlas/server/stac/api/StacSearchRESTService.java index aec606fe0..05220835d 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/api/StacSearchRESTService.java +++ b/stac-api/src/main/java/io/arlas/server/stac/api/StacSearchRESTService.java @@ -34,22 +34,22 @@ import io.arlas.server.stac.model.SearchBody; import io.arlas.server.stac.model.StacFeatureCollection; import io.dropwizard.jersey.params.IntParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.enums.Explode; import io.swagger.v3.oas.annotations.enums.ParameterStyle; import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; 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 jakarta.validation.Valid; +import jakarta.ws.rs.*; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; -import javax.validation.Valid; -import javax.ws.rs.*; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -71,19 +71,21 @@ public StacSearchRESTService(STACConfiguration configuration, @Path("/search") @GET @Produces({ "application/geo+json", MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) - @ApiOperation( - value = "Search STAC items with simple filtering.", - notes = "Retrieve Items matching filters. Intended as a shorthand API for simple queries.") + @Operation( + summary = "Search STAC items with simple filtering.", + description = "Retrieve Items matching filters. Intended as a shorthand API for simple queries.") @ApiResponses(value = { - @ApiResponse(code = 200, message = "A feature collection.", response = StacFeatureCollection.class, - responseContainer = "StacFeatureCollection"), - @ApiResponse(code = 400, message = "Invalid query parameter.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponse(responseCode = "200", description = "A feature collection.", + content = @Content(schema = @Schema(implementation = StacFeatureCollection.class))), + @ApiResponse(responseCode = "400", description = "Invalid query parameter.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response getItemSearch(@Context UriInfo uriInfo, - @Parameter(name = "bbox", style = ParameterStyle.FORM, explode = Explode.FALSE, - array = @ArraySchema(schema = @Schema(type="number"), maxItems = 6, minItems = 4)) - @ApiParam(name = "bbox", value = """ + @Parameter(name = "bbox", + description = """ Only features that have a geometry that intersects the bounding box are selected. The bounding box is provided as four or six numbers, depending on whether the coordinate reference system includes a vertical axis (height or depth): * Lower left corner, coordinate axis 1 @@ -99,15 +101,17 @@ However, in cases where the box spans the antimeridian the first value (west-mos If the vertical axis is included, the third and the sixth number are the bottom and the top of the 3-dimensional bounding box. If a feature has multiple spatial geometry properties, it is the decision of the server whether only a single spatial geometry property is used to determine the extent or all relevant geometries. - Example: The bounding box of the New Zealand Exclusive Economic Zone in WGS 84 (from 160.6°E to 170°W and from 55.95°S to 25.89°S) would be represented in JSON as `[160.6, -55.95, -170, -25.89]` and in a query as `bbox=160.6,-55.95,-170,-25.89`.""") + Example: The bounding box of the New Zealand Exclusive Economic Zone in WGS 84 (from 160.6°E to 170°W and from 55.95°S to 25.89°S) would be represented in JSON as `[160.6, -55.95, -170, -25.89]` and in a query as `bbox=160.6,-55.95,-170,-25.89`.""", + style = ParameterStyle.FORM, + explode = Explode.FALSE, + array = @ArraySchema(schema = @Schema(type="number"), minItems = 4, maxItems = 6)) @QueryParam(value = "bbox") String bbox, - @ApiParam(name = "intersects", value = "The optional intersects parameter filters the result Items in the same way as bbox, " + + @Parameter(name = "intersects", description = "The optional intersects parameter filters the result Items in the same way as bbox, " + "only with a GeoJSON Geometry rather than a bbox.") @QueryParam(value = "intersects") String intersects, - @Parameter(name = "datetime", style = ParameterStyle.FORM) - @ApiParam(name = "datetime", value = """ + @Parameter(name = "datetime", description = """ Either a date-time or an interval, open or closed. Date and time expressions adhere to RFC 3339. Open intervals are expressed using double-dots. Examples: * A date-time: "2018-02-12T23:20:50Z" @@ -115,60 +119,59 @@ However, in cases where the box spans the antimeridian the first value (west-mos * Open intervals: "2018-02-12T00:00:00Z/.." or "../2018-03-18T12:31:12Z" Only features that have a temporal property that intersects the value of `datetime` are selected. - If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.""") + If a feature has multiple temporal properties, it is the decision of the server whether only a single temporal property is used to determine the extent or all relevant temporal properties.""", + style = ParameterStyle.FORM) @QueryParam(value = "datetime") String datetime, - @Parameter(name = "limit", style = ParameterStyle.FORM, schema = @Schema(maximum="10000", defaultValue = "10", minimum = "1")) - @ApiParam(name = "limit", defaultValue = "10", allowableValues = "range[1,10000]", - value = """ + @Parameter(name = "limit", + description = """ The optional limit parameter limits the number of items that are presented in the response document. Only items are counted that are on the first level of the collection in the response document. Nested objects contained within the explicitly requested items shall not be counted.\s - Minimum = 1. Maximum = 10000. Default = 10.""") + Minimum = 1. Maximum = 10000. Default = 10.""", + style = ParameterStyle.FORM, + schema = @Schema(type="integer", minimum = "1", maximum="10000", defaultValue = "10")) @DefaultValue("10") @QueryParam(value = "limit") IntParam limit, - @ApiParam(name = "ids", value = "Array of Item ids to return.") + @Parameter(name = "ids", description = "Array of Item ids to return.") @QueryParam(value = "ids") List ids, - @ApiParam(name = "collections", value = "Array of Collection IDs to include in the search for items. " + + @Parameter(name = "collections", description = "Array of Collection IDs to include in the search for items. " + "Only Item objects in one of the provided collections will be searched ") @QueryParam(value = "collections") List collections, -// @ApiParam(name = "fields", value = "**Optional Extension:** Fields Determines the shape of the features in the response") +// @Parameter(name = "fields", description = "**Optional Extension:** Fields Determines the shape of the features in the response") // @QueryParam(value = "fields") String fields, -// @ApiParam(name = "filter", required = true, value = "**Extension:** Filter A CQL filter expression for filtering items.") +// @Parameter(name = "filter", required = true, description = "**Extension:** Filter A CQL filter expression for filtering items.") // @QueryParam(value = "filter") Filter filter, - @ApiParam(name = "sortby", value = "**Optional Extension:** Sort An array of property names, prefixed by either \"+\" for ascending " + - "or \"-\" for descending. If no prefix is provided, \"+\" is assumed.") + @Parameter(name = "sortby", description = """ + **Optional Extension:** Sort An array of property names, prefixed by either "+" for ascending or "-" for descending. If no prefix is provided, "+" is assumed.""") @QueryParam(value = "sortby") String sortBy, // -------------------------------------------------------- // ----------------------- PAGE ----------------------- // -------------------------------------------------------- - - @ApiParam(name = "from", value = Documentation.PAGE_PARAM_FROM, - defaultValue = "0", - allowableValues = "range[0, infinity]", - type = "integer") + @Parameter(name = "from", description = Documentation.PAGE_PARAM_FROM, + schema = @Schema(type="integer", minimum = "0", defaultValue = "0")) @DefaultValue("0") @QueryParam(value = "from") IntParam from, - @ApiParam(name = "after", value = Documentation.PAGE_PARAM_AFTER) + @Parameter(name = "after", description = Documentation.PAGE_PARAM_AFTER) @QueryParam(value = "after") String after, - @ApiParam(name = "before", value = Documentation.PAGE_PARAM_BEFORE) + @Parameter(name = "before", description = Documentation.PAGE_PARAM_BEFORE) @QueryParam(value = "before") String before, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException, JsonProcessingException { @@ -196,25 +199,28 @@ However, in cases where the box spans the antimeridian the first value (west-mos @Path("/search") @POST @Consumes(MediaType.APPLICATION_JSON) - @Produces({ "application/geo+json", MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) - @ApiOperation( - value = "Search STAC items with full-featured filtering.", - notes = "Retrieve items matching filters. Intended as the standard, full-featured query API.") + @Produces({ "application/geo+json" }) + @Operation( + summary = "Search STAC items with full-featured filtering.", + description = "Retrieve items matching filters. Intended as the standard, full-featured query API.") @ApiResponses(value = { - @ApiResponse(code = 200, message = "A feature collection.", response = StacFeatureCollection.class, - responseContainer = "StacFeatureCollection"), - @ApiResponse(code = 400, message = "Invalid query parameter.", response = Error.class), - @ApiResponse(code = 500, message = "Arlas Server Error.", response = Error.class)}) + @ApiResponse(responseCode = "200", description = "A feature collection.", + content = @Content(schema = @Schema(implementation = StacFeatureCollection.class))), + @ApiResponse(responseCode = "400", description = "Invalid query parameter.", + content = @Content(schema = @Schema(implementation = Error.class))), + @ApiResponse(responseCode = "500", description = "Arlas Server Error.", + content = @Content(schema = @Schema(implementation = Error.class))) + }) public Response postItemSearch(@Context UriInfo uriInfo, @Valid SearchBody body, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = PARTITION_FILTER) String partitionFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = COLUMN_FILTER) String columnFilter, - @ApiParam(hidden = true) + @Parameter(hidden = true) @HeaderParam(value = ARLAS_ORGANISATION) String organisations ) throws ArlasException { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/Catalog.java b/stac-api/src/main/java/io/arlas/server/stac/model/Catalog.java index b7a0cd0ab..05f338c3a 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/Catalog.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/Catalog.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.List; import java.util.Objects; @@ -52,7 +52,7 @@ public Catalog stacVersion(String stacVersion) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("stac_version") @NotNull @@ -71,7 +71,7 @@ public Catalog stacExtensions(List stacExtensions) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("stac_extensions") public List getStacExtensions() { @@ -89,7 +89,7 @@ public Catalog type(String type) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("type") @NotNull @@ -108,7 +108,7 @@ public Catalog id(String id) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("id") @NotNull @@ -127,7 +127,7 @@ public Catalog title(String title) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("title") public String getTitle() { @@ -145,7 +145,7 @@ public Catalog description(String description) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("description") @NotNull @@ -164,7 +164,7 @@ public Catalog links(List links) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("links") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/Collection.java b/stac-api/src/main/java/io/arlas/server/stac/model/Collection.java index f94c7b359..8e44e4894 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/Collection.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/Collection.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.*; @@ -53,7 +53,7 @@ public Collection stacVersion(String stacVersion) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("stac_version") @NotNull @@ -72,7 +72,7 @@ public Collection stacExtensions(List stacExtensions) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("stac_extensions") public List getStacExtensions() { @@ -90,7 +90,7 @@ public Collection type(String type) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("type") @NotNull @@ -110,7 +110,7 @@ public Collection id(String id) { } - @ApiModelProperty(required = true, value = "identifier of the collection used, for example, in URIs") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "identifier of the collection used, for example, in URIs") @JsonProperty("id") @NotNull @@ -130,7 +130,7 @@ public Collection title(String title) { } - @ApiModelProperty(value = "human readable title of the collection") + @Schema(description = "human readable title of the collection") @JsonProperty("title") public String getTitle() { @@ -149,7 +149,7 @@ public Collection description(String description) { } - @ApiModelProperty(required = true, value = "Detailed multi-line description to fully explain the catalog or collection. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Detailed multi-line description to fully explain the catalog or collection. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation.") @JsonProperty("description") @NotNull @@ -169,7 +169,7 @@ public Collection keywords(List keywords) { } - @ApiModelProperty(value = "List of keywords describing the collection.") + @Schema(description = "List of keywords describing the collection.") @JsonProperty("keywords") public List getKeywords() { @@ -188,7 +188,7 @@ public Collection crs(List crs) { } - @ApiModelProperty(value = "List of crs describing the collection.") + @Schema(description = "List of crs describing the collection.") @JsonProperty("crs") public List getCrs() { @@ -206,7 +206,7 @@ public Collection license(String license) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("license") @NotNull @@ -225,7 +225,7 @@ public Collection extent(Extent extent) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("extent") @NotNull @@ -244,7 +244,7 @@ public Collection providers(List providers) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("providers") public List getProviders() { @@ -262,7 +262,7 @@ public Collection links(List links) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("links") @NotNull @@ -282,7 +282,7 @@ public Collection summaries(Map summaries) { } - @ApiModelProperty(value = "Summaries are either a unique set of all available values *or* statistics. Statistics by default only specify the range (minimum and maximum values), but can optionally be accompanied by additional statistical values. The range can specify the potential range of values, but it is recommended to be as precise as possible. The set of values must contain at least one element and it is strongly recommended to list all values. It is recommended to list as many properties as reasonable so that consumers get a full overview of the Collection. Properties that are covered by the Collection specification (e.g. `providers` and `license`) may not be repeated in the summaries.") + @Schema(description = "Summaries are either a unique set of all available values *or* statistics. Statistics by default only specify the range (minimum and maximum values), but can optionally be accompanied by additional statistical values. The range can specify the potential range of values, but it is recommended to be as precise as possible. The set of values must contain at least one element and it is strongly recommended to list all values. It is recommended to list as many properties as reasonable so that consumers get a full overview of the Collection. Properties that are covered by the Collection specification (e.g. `providers` and `license`) may not be repeated in the summaries.") @JsonProperty("summaries") public Map getSummaries() { @@ -302,7 +302,7 @@ public Collection assets(Map assets) { } - @ApiModelProperty(value = "This provides an optional mechanism to expose assets that don't make sense at the Item level.") + @Schema(description = "This provides an optional mechanism to expose assets that don't make sense at the Item level.") @JsonProperty("assets") public Map getAssets() { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/CollectionList.java b/stac-api/src/main/java/io/arlas/server/stac/model/CollectionList.java index 88f9e84fb..4e9edf810 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/CollectionList.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/CollectionList.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -43,7 +43,7 @@ public CollectionList links(List links) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("links") @NotNull @@ -62,7 +62,7 @@ public CollectionList collections(List collections) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("collections") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/ConformanceClasses.java b/stac-api/src/main/java/io/arlas/server/stac/model/ConformanceClasses.java index 3faff5114..676eda7e2 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/ConformanceClasses.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/ConformanceClasses.java @@ -20,15 +20,14 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Objects; - public class ConformanceClasses { private @Valid List conformsTo = new ArrayList<>(); @@ -42,7 +41,7 @@ public ConformanceClasses conformsTo(List conformsTo) { } - @ApiModelProperty(required = true, value = "A list of all conformance classes implemented by the server. In addition to the STAC-specific conformance classes, all OGC-related conformance classes listed at `GET /conformances` must be listed here. This entry should mirror what `GET /conformances` returns, if implemented.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A list of all conformance classes implemented by the server. In addition to the STAC-specific conformance classes, all OGC-related conformance classes listed at `GET /conformances` must be listed here. This entry should mirror what `GET /conformances` returns, if implemented.") @JsonProperty("conformsTo") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/Extent.java b/stac-api/src/main/java/io/arlas/server/stac/model/Extent.java index a0e7ca682..f188ff61d 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/Extent.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/Extent.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.Objects; public class Extent { @@ -42,7 +42,7 @@ public Extent spatial(ExtentSpatial spatial) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("spatial") @NotNull @@ -61,7 +61,7 @@ public Extent temporal(ExtentTemporal temporal) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("temporal") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/ExtentSpatial.java b/stac-api/src/main/java/io/arlas/server/stac/model/ExtentSpatial.java index 2c90d0782..dd914a69d 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/ExtentSpatial.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/ExtentSpatial.java @@ -22,11 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -77,7 +77,7 @@ public ExtentSpatial bbox(List> bbox) { } - @ApiModelProperty(required = true, value = "One or more bounding boxes that describe the spatial extent of the dataset. The first bounding box describes the overall spatial extent of the data. All subsequent bounding boxes describe more precise bounding boxes, e.g., to identify clusters of data. Clients only interested in the overall spatial extent will only need to access the first item in each array.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "One or more bounding boxes that describe the spatial extent of the dataset. The first bounding box describes the overall spatial extent of the data. All subsequent bounding boxes describe more precise bounding boxes, e.g., to identify clusters of data. Clients only interested in the overall spatial extent will only need to access the first item in each array.") @JsonProperty("bbox") @NotNull @Size(min=1) @@ -97,7 +97,7 @@ public ExtentSpatial crs(CrsEnum crs) { } - @ApiModelProperty(value = "Coordinate reference system of the coordinates in the spatial extent (property `bbox`). The default reference system is WGS 84 longitude/latitude. In the Core this is the only supported coordinate reference system. Extensions may support additional coordinate reference systems and add additional enum values.") + @Schema(description = "Coordinate reference system of the coordinates in the spatial extent (property `bbox`). The default reference system is WGS 84 longitude/latitude. In the Core this is the only supported coordinate reference system. Extensions may support additional coordinate reference systems and add additional enum values.") @JsonProperty("crs") public CrsEnum getCrs() { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/ExtentTemporal.java b/stac-api/src/main/java/io/arlas/server/stac/model/ExtentTemporal.java index cfc34aa96..079df39d8 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/ExtentTemporal.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/ExtentTemporal.java @@ -22,11 +22,11 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -77,7 +77,7 @@ public ExtentTemporal interval(List> interval) { } - @ApiModelProperty(required = true, value = "One or more time intervals that describe the temporal extent of the dataset. The first time interval describes the overall temporal extent of the data. All subsequent time intervals describe more precise time intervals, e.g., to identify clusters of data. Clients only interested in the overall extent will only need to access the first item in each array.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "One or more time intervals that describe the temporal extent of the dataset. The first time interval describes the overall temporal extent of the data. All subsequent time intervals describe more precise time intervals, e.g., to identify clusters of data. Clients only interested in the overall extent will only need to access the first item in each array.") @JsonProperty("interval") @NotNull @Size(min=1) @@ -97,7 +97,7 @@ public ExtentTemporal trs(TrsEnum trs) { } - @ApiModelProperty(value = "Coordinate reference system of the coordinates in the temporal extent (property `interval`). The default reference system is the Gregorian calendar. In the Core this is the only supported temporal reference system. Extensions may support additional temporal reference systems and add additional enum values.") + @Schema(description = "Coordinate reference system of the coordinates in the temporal extent (property `interval`). The default reference system is the Gregorian calendar. In the Core this is the only supported temporal reference system. Extensions may support additional temporal reference systems and add additional enum values.") @JsonProperty("trs") public TrsEnum getTrs() { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/Item.java b/stac-api/src/main/java/io/arlas/server/stac/model/Item.java index 6d8e7e616..23db263f3 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/Item.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/Item.java @@ -20,12 +20,12 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; import org.geojson.Feature; import org.geojson.GeoJsonObject; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.List; import java.util.Map; import java.util.Objects; @@ -53,7 +53,7 @@ public Item stacVersion(String stacVersion) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("stac_version") @NotNull @@ -72,7 +72,7 @@ public Item stacExtensions(List stacExtensions) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("stac_extensions") public List getStacExtensions() { @@ -112,7 +112,7 @@ public Item type(String type) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("type") @NotNull @@ -131,7 +131,7 @@ public Item links(List links) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("links") @NotNull @@ -150,7 +150,7 @@ public Item collection(String collection) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("collection") public String getCollection() { @@ -175,7 +175,7 @@ public Item assets(Map assets) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("assets") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/LandingPage.java b/stac-api/src/main/java/io/arlas/server/stac/model/LandingPage.java index cff52da9a..af9bee480 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/LandingPage.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/LandingPage.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -42,7 +42,7 @@ public LandingPage conformsTo(List conformsTo) { } - @ApiModelProperty(required = true, value = "A list of all conformance classes implemented by the server. In addition to the STAC-specific conformance classes, all OGC-related conformance classes listed at `GET /conformances` must be listed here. This entry should mirror what `GET /conformances` returns, if implemented.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "A list of all conformance classes implemented by the server. In addition to the STAC-specific conformance classes, all OGC-related conformance classes listed at `GET /conformances` must be listed here. This entry should mirror what `GET /conformances` returns, if implemented.") @JsonProperty("conformsTo") @NotNull diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/Provider.java b/stac-api/src/main/java/io/arlas/server/stac/model/Provider.java index 921c6a8af..2fd80ef47 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/Provider.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/Provider.java @@ -22,10 +22,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -81,7 +81,7 @@ public Provider name(String name) { } - @ApiModelProperty(required = true, value = "The name of the organization or the individual.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "The name of the organization or the individual.") @JsonProperty("name") @NotNull @@ -101,7 +101,7 @@ public Provider description(String description) { } - @ApiModelProperty(value = "Multi-line description to add further provider information such as processing details for processors and producers, hosting details for hosts or basic contact information. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation.") + @Schema(description = "Multi-line description to add further provider information such as processing details for processors and producers, hosting details for hosts or basic contact information. [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation.") @JsonProperty("description") public String getDescription() { @@ -120,7 +120,7 @@ public Provider roles(List roles) { } - @ApiModelProperty(value = "Roles of the provider. The provider's role(s) can be one or more of the following elements: * licensor: The organization that is licensing the dataset under the license specified in the collection's license field. * producer: The producer of the data is the provider that initially captured and processed the source data, e.g. ESA for Sentinel-2 data. * processor: A processor is any provider who processed data to a derived product. * host: The host is the actual provider offering the data on their storage. There should be no more than one host, specified as last element of the list.") + @Schema(description = "Roles of the provider. The provider's role(s) can be one or more of the following elements: * licensor: The organization that is licensing the dataset under the license specified in the collection's license field. * producer: The producer of the data is the provider that initially captured and processed the source data, e.g. ESA for Sentinel-2 data. * processor: A processor is any provider who processed data to a derived product. * host: The host is the actual provider offering the data on their storage. There should be no more than one host, specified as last element of the list.") @JsonProperty("roles") public List getRoles() { @@ -139,7 +139,7 @@ public Provider url(String url) { } - @ApiModelProperty(value = "Homepage on which the provider describes the dataset and publishes contact information.") + @Schema(description = "Homepage on which the provider describes the dataset and publishes contact information.") @JsonProperty("url") public String getUrl() { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/SearchBody.java b/stac-api/src/main/java/io/arlas/server/stac/model/SearchBody.java index 2c614aa75..7010351b7 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/SearchBody.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/SearchBody.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; import org.geojson.GeoJsonObject; -import javax.validation.Valid; import java.util.List; import java.util.Objects; @@ -56,7 +56,7 @@ public SearchBody datetime(String datetime) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("datetime") public String getDatetime() { @@ -74,7 +74,7 @@ public SearchBody intersects(GeoJsonObject intersects) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("intersects") public GeoJsonObject getIntersects() { @@ -92,7 +92,7 @@ public SearchBody bbox(List bbox) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("bbox") public List getBbox() { @@ -110,7 +110,7 @@ public SearchBody collections(List collections) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("collections") public List getCollections() { @@ -128,7 +128,7 @@ public SearchBody ids(List ids) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("ids") public List getIds() { @@ -146,7 +146,7 @@ public SearchBody limit(Integer limit) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("limit") public Integer getLimit() { @@ -164,7 +164,7 @@ public SearchBody from(Integer from) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("from") public Integer getFrom() { return from; } @@ -178,7 +178,7 @@ public SearchBody sortBy(String sortBy) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("sortby") public String getSortBy() { @@ -196,7 +196,7 @@ public SearchBody after(String after) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("after") public String getAfter() { @@ -214,7 +214,7 @@ public SearchBody before(String before) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("before") public String getBefore() { diff --git a/stac-api/src/main/java/io/arlas/server/stac/model/StacFeatureCollection.java b/stac-api/src/main/java/io/arlas/server/stac/model/StacFeatureCollection.java index 0a9e1ce03..0fe0e8859 100644 --- a/stac-api/src/main/java/io/arlas/server/stac/model/StacFeatureCollection.java +++ b/stac-api/src/main/java/io/arlas/server/stac/model/StacFeatureCollection.java @@ -20,10 +20,10 @@ package io.arlas.server.stac.model; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; -import javax.validation.Valid; -import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -58,7 +58,7 @@ public StacFeatureCollection stacVersion(String stacVersion) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("stac_version") @NotNull @@ -77,7 +77,7 @@ public StacFeatureCollection stacExtensions(List stacExtensions) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("stac_extensions") public List getStacExtensions() { @@ -95,7 +95,7 @@ public StacFeatureCollection type(String type) { } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("type") @NotNull @@ -114,7 +114,7 @@ public StacFeatureCollection featureCollectionGeoJSONFeatures(List feature } - @ApiModelProperty(required = true, value = "") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("features") @NotNull @@ -133,7 +133,7 @@ public StacFeatureCollection links(List links) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("links") public List getLinks() { @@ -151,7 +151,7 @@ public StacFeatureCollection timeStamp(String timeStamp) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("timeStamp") public String getTimeStamp() { @@ -169,7 +169,7 @@ public StacFeatureCollection numberMatched(Integer numberMatched) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("numberMatched") public Integer getNumberMatched() { @@ -187,7 +187,7 @@ public StacFeatureCollection numberReturned(Integer numberReturned) { } - @ApiModelProperty(value = "") + @Schema() @JsonProperty("numberReturned") public Integer getNumberReturned() { @@ -204,7 +204,7 @@ public StacFeatureCollection context(Map context) { } - @ApiModelProperty(value = "Augments lists of resources with the number of returned and matches resource and the given limit for the request.") + @Schema(description = "Augments lists of resources with the number of returned and matches resource and the given limit for the request.") @JsonProperty("context") public Map getContext() {