From 66fc7b6055093884e70d7eec00d11b9aa99296c9 Mon Sep 17 00:00:00 2001 From: Jan Speckamp Date: Mon, 16 Dec 2024 11:30:30 +0100 Subject: [PATCH] Allow null for auto-generated DataStream properties (fixes #65) (#93) --- .../openapi/schemas/json/dataStream.json | 107 +++++++++++++----- ...ause_8_requirements_class_datastreams.adoc | 3 + 2 files changed, 82 insertions(+), 28 deletions(-) diff --git a/api/part2/openapi/schemas/json/dataStream.json b/api/part2/openapi/schemas/json/dataStream.json index d7cf5ed1..e716273f 100644 --- a/api/part2/openapi/schemas/json/dataStream.json +++ b/api/part2/openapi/schemas/json/dataStream.json @@ -1,7 +1,9 @@ { "$schema": "http://json-schema.org/draft-07/schema", "allOf": [ - { "$ref": "baseStream.json" }, + { + "$ref": "baseStream.json" + }, { "properties": { "system@link": { @@ -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": { @@ -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": { @@ -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.", @@ -97,6 +142,12 @@ } ], "required": [ - "name", "system@link", "observedProperties", "phenomenonTime", "resultTime", "resultType", "live" + "name", + "system@link", + "observedProperties", + "phenomenonTime", + "resultTime", + "resultType", + "live" ] } \ No newline at end of file diff --git a/api/part2/standard/sections/clause_8_requirements_class_datastreams.adoc b/api/part2/standard/sections/clause_8_requirements_class_datastreams.adoc index d13140e8..1b3c0718 100644 --- a/api/part2/standard/sections/clause_8_requirements_class_datastreams.adoc +++ b/api/part2/standard/sections/clause_8_requirements_class_datastreams.adoc @@ -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 | 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"]