Skip to content

Commit

Permalink
Allow null for auto-generated DataStream properties (fixes #65) (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpeckiJ authored Dec 16, 2024
1 parent 14efc44 commit 66fc7b6
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 28 deletions.
107 changes: 79 additions & 28 deletions api/part2/openapi/schemas/json/dataStream.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"allOf": [
{ "$ref": "baseStream.json" },
{
"$ref": "baseStream.json"
},
{
"properties": {
"system@link": {
Expand Down Expand Up @@ -30,29 +32,43 @@
"$ref": "../common/commonDefs.json#/definitions/Link"
},
"observedProperties": {
"description": "List of observed properties included in this datastream",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"definition": {
"type": "string",
"format": "uri"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
"oneOf": [
{
"type": "null"
},
{
"description": "List of observed properties included in this datastream",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"properties": {
"definition": {
"type": "string",
"format": "uri"
},
"label": {
"type": "string"
},
"description": {
"type": "string"
}
}
}
}
},
],
"readOnly": true
},
"phenomenonTime": {
"description": "Time extent spanning all phenomenon times of observations in this datastream",
"$ref": "../common/commonDefs.json#/definitions/TimePeriod",
"oneOf": [
{
"type": "null"
},
{
"description": "Time extent spanning all phenomenon times of observations in this datastream",
"$ref": "../common/commonDefs.json#/definitions/TimePeriod"
}
],
"readOnly": true
},
"phenomenonTimeInterval": {
Expand All @@ -61,8 +77,15 @@
"format": "duration"
},
"resultTime": {
"description": "Time extent spanning all result times of observations in this datastream",
"$ref": "../common/commonDefs.json#/definitions/TimePeriod",
"oneOf": [
{
"type": "null"
},
{
"description": "Time extent spanning all result times of observations in this datastream",
"$ref": "../common/commonDefs.json#/definitions/TimePeriod"
}
],
"readOnly": true
},
"resultTimeInterval": {
Expand All @@ -72,17 +95,39 @@
},
"type": {
"type": "string",
"enum": ["status", "observation"]
"enum": [
"status",
"observation"
]
},
"resultType": {
"type": "string",
"enum": ["measure", "vector", "record", "coverage", "complex"],
"oneOf": [
{
"type": "null"
},
{
"type": "string",
"enum": [
"measure",
"vector",
"record",
"coverage",
"complex"
]
}
],
"readOnly": true
},
"live": {
"description": "Flag indicating if the datastream is currently streaming data",
"type": "boolean",
"readOnly": true
"oneOf": [
{
"type": "null"
},
{
"description": "Flag indicating if the datastream is currently streaming data",
"type": "boolean"
}
]
},
"schema": {
"description": "Schema describing the content of observations in this datastream. The exact syntax of the schema depends on the encoding format.",
Expand All @@ -97,6 +142,12 @@
}
],
"required": [
"name", "system@link", "observedProperties", "phenomenonTime", "resultTime", "resultType", "live"
"name",
"system@link",
"observedProperties",
"phenomenonTime",
"resultTime",
"resultType",
"live"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ The following tables describe the attributes and associations of a `DataStream`
| `formats` | - | The list of formats that the observations in the datastream can be encoded to. | List<String> | Required
|====

The values for the properties `observedProperties`, `phenomenonTime`, `resultTime`, `resultType` SHALL be automatically generated by the server based the `Observations` that are linked to the `Datastream`. If there are no linked Observations the properties SHALL be set to `null`.
The property `live` MAY be generated by the server. In this case the server MAY ignore updates to the property.

[#datastream-types,reftext='{table-caption} {counter:table-num}']
.DataStream Types
[width="100%",options="header"]
Expand Down

0 comments on commit 66fc7b6

Please sign in to comment.