Skip to content

Commit fd66147

Browse files
committed
First stab at pagination. #103
1 parent a7e8f23 commit fd66147

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- `GET /conformance` has been added for OCG API compliance. Back-ends may implement it for compatibility with OGC API clients.
2121
- `POST /result`: May add a link to a log file in the header. [#214](https://github.com/Open-EO/openeo-api/issues/214)
2222
- `GET /jobs/{job_id}/logs` and `GET /services/{service_id}/logs`: Endpoints that publish logging information. [#214](https://github.com/Open-EO/openeo-api/issues/214)
23+
- `GET /files`, `GET /jobs`, `GET /process_graphs`, `GET /services`: Added `limit` parameter for pagination and clarified how to use links for pagination. [#103](https://github.com/Open-EO/openeo-api/issues/103)
2324

2425
### Changed
2526

@@ -68,7 +69,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6869

6970
- Service parameters and attributes in `GET /service_types` and output format parameters in `GET /file_formats` (previously `GET /output_formats`) now have a `type`, which was previously only mentioned in examples.
7071
- `GET /processes`: Parameters `arguments` and `process_graph` can't be used together in process examples.
71-
- Clarified how clients and back-ends should implement well-known discovery for `GET ./well-known/openeo`. [#202](https://github.com/Open-EO/openeo-api/issues/202)
72+
- `GET /collections`, `GET /processes`: Clarified that pagination is not supported. [#103](https://github.com/Open-EO/openeo-api/issues/103)
73+
- `GET ./well-known/openeo`: Clarified how clients and back-ends should implement well-known discovery. [#202](https://github.com/Open-EO/openeo-api/issues/202)
7274

7375
## [0.4.2] - 2019-06-11
7476

openapi.yaml

+52-9
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ paths:
11741174
items:
11751175
$ref: '#/components/schemas/collection'
11761176
links:
1177-
$ref: '#/components/schemas/links_pagination'
1177+
$ref: '#/components/schemas/links_discovery'
11781178
example:
11791179
collections:
11801180
- stac_version: 0.9.0
@@ -1786,7 +1786,7 @@ paths:
17861786
items:
17871787
$ref: '#/components/schemas/process'
17881788
links:
1789-
$ref: '#/components/schemas/links_pagination'
1789+
$ref: '#/components/schemas/links_discovery'
17901790
example:
17911791
processes:
17921792
- id: round
@@ -2428,6 +2428,8 @@ paths:
24282428
- Process Graphs
24292429
security:
24302430
- Bearer: []
2431+
parameters:
2432+
- $ref: '#/components/parameters/pagination_limit'
24312433
responses:
24322434
'200':
24332435
description: JSON array with stored process graph meta data
@@ -2741,6 +2743,8 @@ paths:
27412743
- Secondary Services
27422744
security:
27432745
- Bearer: []
2746+
parameters:
2747+
- $ref: '#/components/parameters/pagination_limit'
27442748
responses:
27452749
'200':
27462750
description: Array of service descriptions
@@ -3002,6 +3006,8 @@ paths:
30023006
- Batch Jobs
30033007
security:
30043008
- Bearer: []
3009+
parameters:
3010+
- $ref: '#/components/parameters/pagination_limit'
30053011
responses:
30063012
'200':
30073013
description: Array of job descriptions
@@ -3451,6 +3457,8 @@ paths:
34513457
- File Storage
34523458
security:
34533459
- Bearer: []
3460+
parameters:
3461+
- $ref: '#/components/parameters/pagination_limit'
34543462
responses:
34553463
'200':
34563464
description: >-
@@ -3902,23 +3910,37 @@ components:
39023910
Clients SHOULD only connect to non-production implementations if the
39033911
user explicitly confirmed to use a non-production implementation.
39043912
default: true
3913+
links_discovery:
3914+
description: |-
3915+
Links related to this set of resources, for example links to alternative
3916+
formats such as a human-readable HTML version.
3917+
3918+
It is RECOMMENDED to provide links with the following
3919+
`rel` (relation) types:
3920+
3921+
1. `alternate`: An alternative representation. For example, a
3922+
human-readable HTML version or another catalog service.
3923+
3924+
For additional relation types see also the lists of
3925+
[common relation types in openEO](#section/Web-Linking).
3926+
type: array
3927+
items:
3928+
$ref: '#/components/schemas/link'
39053929
links_pagination:
39063930
description: |-
39073931
Links related to this list of resources, for example links for pagination
39083932
or alternative formats such as a human-readable HTML version.
3933+
The links array MUST NOT be paginated.
39093934
3910-
Pagination is currently OPTIONAL and back-ends and clients may not support it.
3911-
Therefore it MUST be implemented in a way that clients not supporting
3912-
pagination get all resources regardless. The links array MUST NOT be paginated.
39133935
If pagination is implemented, the following `rel` (relation) types apply:
39143936
3915-
1. `next` (REQUIRED): A link to the next page.
3937+
1. `next` (REQUIRED): A link to the next page, except on the last page.
39163938
3917-
2. `prev` (OPTIONAL): A link to the previous page.
3939+
2. `prev` (OPTIONAL): A link to the previous page, except on the first page.
39183940
3919-
3. `first` (OPTIONAL): A link to the first page.
3941+
3. `first` (OPTIONAL): A link to the first page, except on the first page.
39203942
3921-
4. `last` (OPTIONAL): A link to the last page.
3943+
4. `last` (OPTIONAL): A link to the last page, except on the last page.
39223944
39233945
For additional relation types see also the lists of
39243946
[common relation types in openEO](#section/Web-Linking).
@@ -5531,6 +5553,27 @@ components:
55315553
schema:
55325554
$ref: '#/components/schemas/error'
55335555
parameters:
5556+
pagination_limit:
5557+
name: limit
5558+
description: |-
5559+
This parameter enables pagination for the endpoint and specifies the maximum number of
5560+
elements that arrays in the top-level object are allowed to contain.
5561+
The only exception is the `links` array, which MUST NOT be paginated as otherwise the
5562+
pagination links may be missing ins responses.
5563+
5564+
Pagination is OPTIONAL and back-ends and clients may not support it.
5565+
Therefore it MUST be implemented in a way that clients not supporting
5566+
pagination get all resources regardless.
5567+
5568+
If the response is paginated, the links array must be used to propagate the
5569+
links for pagination with pre-defined `rel` types. See the links array schema
5570+
for supported `rel` types.
5571+
in: query
5572+
allowEmptyValue: true
5573+
schema:
5574+
type: integer
5575+
minimum: 1
5576+
example: 10
55345577
log_limit:
55355578
name: limit
55365579
description: The maximum amount of log entries to include in the response. If not provided or empty, return all log entries.

0 commit comments

Comments
 (0)