-
Notifications
You must be signed in to change notification settings - Fork 180
/
Copy pathsort.fragment.yaml
54 lines (54 loc) · 1.3 KB
/
sort.fragment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Adds sorting parameter to the base STAC search.
paths:
/search:
get:
parameters:
- $ref: '#/components/parameters/sortby'
components:
parameters:
sortby:
name: sortby
in: query
description: |-
An array of property names, prefixed by either "+" for ascending or
"-" for descending. If no prefix is provided, "+" is assumed.
required: false
schema:
type: string
example: '+id,-properties.eo:cloud_cover'
style: form
explode: false
schemas:
searchBody:
allOf:
- $ref: '#/components/schemas/sortFilter'
sortFilter:
type: object
description: Sort the results
properties:
sortby:
$ref: '#/components/schemas/sortby'
sortby:
type: array
description: |
An array of objects containing a property name and sort direction.
minItems: 1
items:
type: object
required:
- field
- direction
properties:
field:
type: string
direction:
type: string
default: asc
enum:
- asc
- desc
example:
- field: properties.eo:cloud_cover
direction: asc
- field: id
direction: desc