Sortingspecdraftimplproposal
Sort features in a response.
Scope
Conformance Classes
Sorting implements the conformance class "Sorting" of the draft OGC API - Records - Part 1: Core.
Operations
Resource | Path | Methods | Media Types | Description |
---|---|---|---|---|
Sortables | collections/{collectionId}/sortables | GET | HTML, JSON | The Sortables resource identifies the properties that can be referenced in the "sortby" parameter to order the features of the collection in the response to a query. The response is returned as a JSON Schema document that describes a single JSON object where each property is a sortable. Note that the Sortables schema does not specify a schema of any object that can be retrieved from the API. JSON Schema is used for the Sortables to have a consistent approach for describing schema information. JSON Schema is used in other parts of the API to describe schemas for JSON responses including in OpenAPI documents. |
Query Parameters
Name | Resources | Description |
---|---|---|
sortby | Features | If the parameter is specified, the features are returned sorted according to the attributes specified in a comma-separated list. The attribute name can be preceded by + (ascending, the default behavior) or - (descending). Example: sortby=type,-name . |
f | Sortables | Select the output format of the response. If no value is provided, the standard HTTP rules apply, i.e., the "Accept" header will be used to determine the format. |
Configuration
Options
Name | Default | Description | Type | Since |
---|---|---|---|---|
buildingBlock | Always SORTING . | string | v2.0 | |
extensionType | Deprecated See buildingBlock . | string | v2.0 | |
enabled | false | Enable the building block? | boolean | v2.0 |
sortables | {} | Controls which of the attributes in queries can be used for sorting data. Only direct attributes of the data types STRING , DATETIME , INTEGER and FLOAT are allowed (no attributes from arrays or embedded objects). | array | v2.0 |
Examples
- buildingBlock: SORTING
enabled: true
sortables:
- name
- function
- height