Skip to content

Commit f92a2f5

Browse files
Merge pull request #662 from geoadmin/feat-pb-2354-openapi-group-properties-by-extension
PB-2354: OpenAPI: Group properties by extension
2 parents 527d3fe + a0541ad commit f92a2f5

3 files changed

Lines changed: 167 additions & 75 deletions

File tree

spec/components/schemas.yaml

Lines changed: 59 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,41 +1130,39 @@ components:
11301130
minItems: 2
11311131
items:
11321132
type: number
1133-
itemProperties:
1134-
title: Properties
1135-
description: >-
1136-
Provides the core metadata fields plus extensions
1137-
1138-
1139-
The item's data timing information can be specified either with
1140-
1141-
* One datetime value in the field `datetime`
1142-
1143-
* A datetime range with a `start_datetime` and an `end_datetime`
1144-
1145-
1146-
One of the two is required.
1147-
1148-
1149-
**Note on STAC extensions:** When a STAC extension is listed in the `stac_extensions` field,
1150-
certain properties may be required. For example, when using the
1151-
[Forecast extension](`https://github.com/stac-extensions/forecast`), the
1152-
`forecast:reference_datetime` property is required.
1133+
itemPropertiesCore:
1134+
title: Core Properties
1135+
description: Core STAC metadata fields for Items
11531136
properties:
11541137
created:
11551138
$ref: "#/components/schemas/created"
1139+
updated:
1140+
$ref: "#/components/schemas/updated"
11561141
datetime:
11571142
$ref: "#/components/schemas/datetime"
11581143
start_datetime:
11591144
$ref: "#/components/schemas/datetime"
11601145
end_datetime:
11611146
$ref: "#/components/schemas/datetime"
1162-
expires:
1163-
$ref: "#/components/schemas/datetime"
1164-
updated:
1165-
$ref: "#/components/schemas/updated"
11661147
title:
11671148
$ref: "#/components/schemas/featureTitle"
1149+
required:
1150+
- created
1151+
- updated
1152+
1153+
itemPropertiesTimestamps:
1154+
title: Timestamps Extension
1155+
description: >-
1156+
Properties from the [STAC Timestamps extension](https://github.com/stac-extensions/timestamps)
1157+
properties:
1158+
expires:
1159+
$ref: "#/components/schemas/datetime"
1160+
1161+
itemPropertiesForecast:
1162+
title: Forecast Extension
1163+
description: >-
1164+
Properties from the [STAC Forecast extension](https://github.com/stac-extensions/forecast)
1165+
properties:
11681166
forecast:reference_datetime:
11691167
$ref: "#/components/schemas/datetime"
11701168
forecast:horizon:
@@ -1175,14 +1173,48 @@ components:
11751173
$ref: "#/components/schemas/forecast_variable"
11761174
forecast:perturbed:
11771175
$ref: "#/components/schemas/forecast_perturbed"
1176+
required:
1177+
- forecast:reference_datetime
1178+
1179+
itemPropertiesCF:
1180+
title: CF Extension
1181+
description: >-
1182+
Properties from the [STAC CF extension](https://github.com/stac-extensions/cf.
1183+
properties:
11781184
cf:standard_name:
11791185
$ref: "#/components/schemas/cf_standard_name"
11801186
unit:
11811187
$ref: "#/components/schemas/unit"
1182-
required:
1183-
- created
1184-
- updated
1188+
1189+
itemProperties:
1190+
title: Properties
1191+
description: |-
1192+
Provides the core metadata fields for a feature together with additional
1193+
fields from the declared STAC extensions.
1194+
1195+
1196+
An feature's temporal information is expressed either as a single point
1197+
in time through `datetime`, or as a range through `start_datetime`
1198+
and `end_datetime` (in which case `datetime` is `null`). One of these
1199+
two forms is required.
1200+
1201+
1202+
STAC extensions:
1203+
1204+
* Every feature carries the mandatory core properties.
1205+
* To use an extension's additional fields, list that extension in the
1206+
`stac_extensions` array.
1207+
* Declaring an extension may make some of its properties required.
1208+
For example, the
1209+
[Forecast extension](`https://github.com/stac-extensions/forecast`)
1210+
requires `forecast:reference_datetime`.
1211+
11851212
type: object
1213+
anyOf:
1214+
- $ref: "#/components/schemas/itemPropertiesCore"
1215+
- $ref: "#/components/schemas/itemPropertiesTimestamps"
1216+
- $ref: "#/components/schemas/itemPropertiesForecast"
1217+
- $ref: "#/components/schemas/itemPropertiesCF"
11861218
itemType:
11871219
title: type
11881220
description: The GeoJSON type

spec/static/spec/v1/openapi.yaml

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,38 +1399,37 @@ components:
13991399
minItems: 2
14001400
items:
14011401
type: number
1402-
itemProperties:
1403-
title: Properties
1404-
description: >-
1405-
Provides the core metadata fields plus extensions
1406-
1407-
1408-
The item's data timing information can be specified either with
1409-
1410-
* One datetime value in the field `datetime`
1411-
1412-
* A datetime range with a `start_datetime` and an `end_datetime`
1413-
1414-
1415-
One of the two is required.
1416-
1417-
1418-
**Note on STAC extensions:** When a STAC extension is listed in the `stac_extensions` field, certain properties may be required. For example, when using the [Forecast extension](`https://github.com/stac-extensions/forecast`), the `forecast:reference_datetime` property is required.
1402+
itemPropertiesCore:
1403+
title: Core Properties
1404+
description: Core STAC metadata fields for Items
14191405
properties:
14201406
created:
14211407
$ref: "#/components/schemas/created"
1408+
updated:
1409+
$ref: "#/components/schemas/updated"
14221410
datetime:
14231411
$ref: "#/components/schemas/datetime"
14241412
start_datetime:
14251413
$ref: "#/components/schemas/datetime"
14261414
end_datetime:
14271415
$ref: "#/components/schemas/datetime"
1428-
expires:
1429-
$ref: "#/components/schemas/datetime"
1430-
updated:
1431-
$ref: "#/components/schemas/updated"
14321416
title:
14331417
$ref: "#/components/schemas/featureTitle"
1418+
required:
1419+
- created
1420+
- updated
1421+
itemPropertiesTimestamps:
1422+
title: Timestamps Extension
1423+
description: >-
1424+
Properties from the [STAC Timestamps extension](https://github.com/stac-extensions/timestamps)
1425+
properties:
1426+
expires:
1427+
$ref: "#/components/schemas/datetime"
1428+
itemPropertiesForecast:
1429+
title: Forecast Extension
1430+
description: >-
1431+
Properties from the [STAC Forecast extension](https://github.com/stac-extensions/forecast)
1432+
properties:
14341433
forecast:reference_datetime:
14351434
$ref: "#/components/schemas/datetime"
14361435
forecast:horizon:
@@ -1441,14 +1440,45 @@ components:
14411440
$ref: "#/components/schemas/forecast_variable"
14421441
forecast:perturbed:
14431442
$ref: "#/components/schemas/forecast_perturbed"
1443+
required:
1444+
- forecast:reference_datetime
1445+
itemPropertiesCF:
1446+
title: CF Extension
1447+
description: >-
1448+
Properties from the [STAC CF extension](https://github.com/stac-extensions/cf.
1449+
properties:
14441450
cf:standard_name:
14451451
$ref: "#/components/schemas/cf_standard_name"
14461452
unit:
14471453
$ref: "#/components/schemas/unit"
1448-
required:
1449-
- created
1450-
- updated
1454+
itemProperties:
1455+
title: Properties
1456+
description: |-
1457+
Provides the core metadata fields for a feature together with additional
1458+
fields from the declared STAC extensions.
1459+
1460+
1461+
An feature's temporal information is expressed either as a single point
1462+
in time through `datetime`, or as a range through `start_datetime`
1463+
and `end_datetime` (in which case `datetime` is `null`). One of these
1464+
two forms is required.
1465+
1466+
1467+
STAC extensions:
1468+
1469+
* Every feature carries the mandatory core properties.
1470+
* To use an extension's additional fields, list that extension in the
1471+
`stac_extensions` array.
1472+
* Declaring an extension may make some of its properties required.
1473+
For example, the
1474+
[Forecast extension](`https://github.com/stac-extensions/forecast`)
1475+
requires `forecast:reference_datetime`.
14511476
type: object
1477+
anyOf:
1478+
- $ref: "#/components/schemas/itemPropertiesCore"
1479+
- $ref: "#/components/schemas/itemPropertiesTimestamps"
1480+
- $ref: "#/components/schemas/itemPropertiesForecast"
1481+
- $ref: "#/components/schemas/itemPropertiesCF"
14521482
itemType:
14531483
title: type
14541484
description: The GeoJSON type

spec/static/spec/v1/openapitransactional.yaml

Lines changed: 54 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,38 +1479,37 @@ components:
14791479
minItems: 2
14801480
items:
14811481
type: number
1482-
itemProperties:
1483-
title: Properties
1484-
description: >-
1485-
Provides the core metadata fields plus extensions
1486-
1487-
1488-
The item's data timing information can be specified either with
1489-
1490-
* One datetime value in the field `datetime`
1491-
1492-
* A datetime range with a `start_datetime` and an `end_datetime`
1493-
1494-
1495-
One of the two is required.
1496-
1497-
1498-
**Note on STAC extensions:** When a STAC extension is listed in the `stac_extensions` field, certain properties may be required. For example, when using the [Forecast extension](`https://github.com/stac-extensions/forecast`), the `forecast:reference_datetime` property is required.
1482+
itemPropertiesCore:
1483+
title: Core Properties
1484+
description: Core STAC metadata fields for Items
14991485
properties:
15001486
created:
15011487
$ref: "#/components/schemas/created"
1488+
updated:
1489+
$ref: "#/components/schemas/updated"
15021490
datetime:
15031491
$ref: "#/components/schemas/datetime"
15041492
start_datetime:
15051493
$ref: "#/components/schemas/datetime"
15061494
end_datetime:
15071495
$ref: "#/components/schemas/datetime"
1508-
expires:
1509-
$ref: "#/components/schemas/datetime"
1510-
updated:
1511-
$ref: "#/components/schemas/updated"
15121496
title:
15131497
$ref: "#/components/schemas/featureTitle"
1498+
required:
1499+
- created
1500+
- updated
1501+
itemPropertiesTimestamps:
1502+
title: Timestamps Extension
1503+
description: >-
1504+
Properties from the [STAC Timestamps extension](https://github.com/stac-extensions/timestamps)
1505+
properties:
1506+
expires:
1507+
$ref: "#/components/schemas/datetime"
1508+
itemPropertiesForecast:
1509+
title: Forecast Extension
1510+
description: >-
1511+
Properties from the [STAC Forecast extension](https://github.com/stac-extensions/forecast)
1512+
properties:
15141513
forecast:reference_datetime:
15151514
$ref: "#/components/schemas/datetime"
15161515
forecast:horizon:
@@ -1521,14 +1520,45 @@ components:
15211520
$ref: "#/components/schemas/forecast_variable"
15221521
forecast:perturbed:
15231522
$ref: "#/components/schemas/forecast_perturbed"
1523+
required:
1524+
- forecast:reference_datetime
1525+
itemPropertiesCF:
1526+
title: CF Extension
1527+
description: >-
1528+
Properties from the [STAC CF extension](https://github.com/stac-extensions/cf.
1529+
properties:
15241530
cf:standard_name:
15251531
$ref: "#/components/schemas/cf_standard_name"
15261532
unit:
15271533
$ref: "#/components/schemas/unit"
1528-
required:
1529-
- created
1530-
- updated
1534+
itemProperties:
1535+
title: Properties
1536+
description: |-
1537+
Provides the core metadata fields for a feature together with additional
1538+
fields from the declared STAC extensions.
1539+
1540+
1541+
An feature's temporal information is expressed either as a single point
1542+
in time through `datetime`, or as a range through `start_datetime`
1543+
and `end_datetime` (in which case `datetime` is `null`). One of these
1544+
two forms is required.
1545+
1546+
1547+
STAC extensions:
1548+
1549+
* Every feature carries the mandatory core properties.
1550+
* To use an extension's additional fields, list that extension in the
1551+
`stac_extensions` array.
1552+
* Declaring an extension may make some of its properties required.
1553+
For example, the
1554+
[Forecast extension](`https://github.com/stac-extensions/forecast`)
1555+
requires `forecast:reference_datetime`.
15311556
type: object
1557+
anyOf:
1558+
- $ref: "#/components/schemas/itemPropertiesCore"
1559+
- $ref: "#/components/schemas/itemPropertiesTimestamps"
1560+
- $ref: "#/components/schemas/itemPropertiesForecast"
1561+
- $ref: "#/components/schemas/itemPropertiesCF"
15321562
itemType:
15331563
title: type
15341564
description: The GeoJSON type

0 commit comments

Comments
 (0)