opengeospatial / sensorthings

The official web site of the OGC SensorThings API standard specification.
136 stars 29 forks source link

Define response for Collection(id)/property/$value for NULL properties #18

Closed hylkevds closed 5 years ago

hylkevds commented 7 years ago

Take an Observation with id 1, which has no validTime. What should the response be to the request GET v1.0/Observations(1)/validTime/$value

The request without $value is clear: GET v1.0/Observations(1)/validTime returns {"validTime": NULL}

However, since $value returns the raw value, we can't return NULL, since that would mean a String value of "NULL", not "this property does not have a value".

Options:

  1. Return a 404 Not Found
  2. Return a 204 No Data
  3. Return a 200, with an empty document (no good, can't distinguish between no value and an empty String)

Option 2 seems good, since it allows the distinction between "404: this Observation does not exist" and "204: this observation exists, but this observation does not have this property".

Any other opinions?

hylkevds commented 7 years ago

I found the answer in a different section:

If the property is single-valued and has the null value, the service SHALL respond with 204 No Content.

Also GET v1.0/Observations(1)/validTime should already return 204 No Content, and not the property with a null value. Is this important enough for a test in the conformance suite? If not we can close this issue.