Skip to content

Commit

Permalink
openapi: Clarified expectations for RFC 3339 on local times
Browse files Browse the repository at this point in the history
- For temporal extent, allow local or UTC time
- For datetime parameter, server need to support at least UTC time
  (but may or may not support local time offsets)
  • Loading branch information
jerstlouis committed Jun 21, 2024
1 parent 177cfd3 commit f60b649
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions collections/openapi/ogcapi-common-2.bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
"type": "array",
"minItems": 1,
"items": {
"description": "Begin and end times of the time interval. The timestamps are in the\ntemporal coordinate reference system specified in `trs`. By default\nthis is the Gregorian calendar.\n\nThe value `null` for start or end time is supported and indicates a half-bounded time interval.",
"description": "Begin and end times of the time interval. The timestamps are in the\ntemporal coordinate reference system specified in `trs`. By default\nthis is the Gregorian calendar, expressed using RFC 3339 section 5.6.\nNote that these times may be specified using time zone offsets to UTC time other than zero.\n\nThe value `null` for start or end time is supported and indicates a half-bounded time interval.",
"type": "array",
"minItems": 2,
"maxItems": 2,
Expand All @@ -572,6 +572,7 @@
},
"example": [
"2011-11-11T12:22:11Z",
"2011-11-11T08:22:11-04:00",
null
]
}
Expand Down Expand Up @@ -683,6 +684,7 @@
},
"example": [
"2011-11-11T12:22:11Z",
"2011-11-11T08:22:11-04:00",
32.5,
null
]
Expand Down Expand Up @@ -883,7 +885,7 @@
"datetime": {
"name": "datetime",
"in": "query",
"description": "Either a date-time or an interval. Date and time expressions adhere to RFC 3339. Intervals may be bounded or half-bounded (double-dots at start or end).\nExamples:\n* A date-time: \"2018-02-12T23:20:50Z\" * A bounded interval: \"2018-02-12T00:00:00Z/2018-03-18T12:31:12Z\" * Half-bounded intervals: \"2018-02-12T00:00:00Z/..\" or \"../2018-03-18T12:31:12Z\"\nOnly resources that have a temporal property that intersects the value of `datetime` are selected.\nIf 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.",
"description": "Either a date-time or an interval. Date and time expressions adhere to RFC 3339, section 5.6. Intervals may be bounded or half-bounded (double-dots at start or end). Server implementations may or may not support times expressed using time offsets from UTC, but need to support UTC time with the notation ending with a Z.\nExamples:\n* A date-time: \"2018-02-12T23:20:50Z\" * A bounded interval: \"2018-02-12T00:00:00Z/2018-03-18T12:31:12Z\" * Half-bounded intervals: \"2018-02-12T00:00:00Z/..\" or \"../2018-03-18T12:31:12Z\"\nOnly resources that have a temporal property that intersects the value of `datetime` are selected.\nIf 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.",
"required": false,
"schema": {
"type": "string"
Expand Down
4 changes: 3 additions & 1 deletion collections/openapi/parameters/common-geodata/datetime.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: datetime
in: query
description: >-
Either a date-time or an interval. Date and time expressions
adhere to RFC 3339. Intervals may be bounded or half-bounded (double-dots at start or end).
adhere to RFC 3339, section 5.6. Intervals may be bounded or half-bounded (double-dots at start or end).
Server implementations may or may not support times expressed using time offsets from UTC, but need to support
UTC time with the notation ending with a Z.
Examples:
Expand Down
1 change: 1 addition & 0 deletions collections/openapi/schemas/common-geodata/extent-uad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ allOf:
- type: number
example:
- '2011-11-11T12:22:11Z'
- '2011-11-11T08:22:11-04:00'
- 32.5
- null
trs:
Expand Down
4 changes: 3 additions & 1 deletion collections/openapi/schemas/common-geodata/extent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ properties:
description: |-
Begin and end times of the time interval. The timestamps are in the
temporal coordinate reference system specified in `trs`. By default
this is the Gregorian calendar.
this is the Gregorian calendar, expressed using RFC 3339 section 5.6.
Note that these times may be specified using time zone offsets to UTC time other than zero.
The value `null` for start or end time is supported and indicates a half-bounded time interval.
type: array
Expand All @@ -188,6 +189,7 @@ properties:
nullable: true
example:
- '2011-11-11T12:22:11Z'
- '2011-11-11T08:22:11-04:00'
- null
trs:
description: |-
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[req_collections_rc-datetime-definition]]
[width="90%",cols="2,6a"]
|===
^|*Requirement {counter:req-id}* |*/req/collections/rc-datetime-definition*
^|*Requirement {counter:req-id}* |*/req/collections/rc-datetime-definition*
^|A |The `datetime` parameter SHALL have the following characteristics (using an OpenAPI Specification 3.0 fragment):

[source,YAML]
Expand All @@ -25,6 +25,6 @@ interval-half-bounded-end = date-time "/" [".."]
interval = interval-bounded / interval-half-bounded-start / interval-half-bounded-end
datetime = date-time / interval
----
^|C |The syntax of `date-time` is specified by link:https://tools.ietf.org/html/rfc3339#section-5.6[RFC 3339, 5.6].
^|D |Open ranges in time intervals at the start or end are supported using a double-dot (`..`) or an empty string for the start/end..
^|C |Server implementations SHALL interpret the `date-time` as specified by link:https://tools.ietf.org/html/rfc3339#section-5.6[RFC 3339, 5.6] supporting at least UTC time with the notation ending with a Z (with support for local time offsets optional).
^|D |When a double-dot (`..`) or an empty string is specified in a time interval, the implementation SHALL interpret it as a half-bounded or an unbounded interval (open range).
|===

0 comments on commit f60b649

Please sign in to comment.