opengeospatial / ogcapi-connected-systems

Public Repository for the Connected Systems SWG
Other
8 stars 6 forks source link

Datastream `required+readonly` properties are undefined but required #65

Open SpeckiJ opened 3 months ago

SpeckiJ commented 3 months ago

Description

The schema for Datastream defines multiple fields as readonly+required:

https://github.com/opengeospatial/ogcapi-connected-systems/blob/6731f3aed7796f84441f548d2ef572ac3fb096af/api/part2/openapi/schemas/json/dataStream.json#L100

As far as i understand the readonly fields cannot be POSTed (but maybe should be automatically filled by the server with dynamic data? Although i cannot find anything talking about this in the spec). The problem is that nearly all of these are based on parsing/accessing associated Observations which might not exist (yet). This is a very common case because the the datastream needs to be posted first else you cannot even post an observation.

Problem

In the case that there are no associated Observations - what should the API return for the required fields:

when there are no associated Observations posted yet? I cannot leave them out as this breaks clients who conform to the schema. As they are marked readOnly i cannot POST some default values (at least according to the OpenAPI spec posting these is not supported).

alexrobin commented 1 month ago

Discussed during 09/19 telecon.

Add clarification in the spec + change schema to allow null on the read-only properties. Null values would be used when a DataStream has no observations.

Also clarify that the read-only fields should be auto-generated by the server.

Allow live field to be POSTED. Keep it optional. Add comment to explain that either the client sets the flag or the server can auto-generate it if data is being proxied from another source w/o POST being used.