SpaceApi / schema

SpaceAPI JSON schema files.
24 stars 14 forks source link

Why is `state` required? #40

Closed koalatux closed 5 years ago

koalatux commented 5 years ago

In the space api version 0.13 the state is a required key. The value of state must be an object containing at least the open key. The open key is required but it's value is nullable.

In our space api endpoint at the ccczh [1] we have not (yet) implemented exposing the current state, this forces us to permanently set the open value to null.

If the state would not be required then intuitively I would say 'open': null means sensor data currently not available and the absence of a state key would mean that the state sensor never has been implemented for this space.

[1] https://www.ccczh.ch/api/v13/

dbrgn commented 5 years ago

That's a good point. I would propose making state non-required.

Opinions, @rnestler @gidsi?

gidsi commented 5 years ago

That's a good point. I would propose making state non-required.

Opinions, @rnestler @gidsi?

Yeah, same thought came to my mind after i've read the beginners guide. Was saving it for the next meeting, lets make it not mandatory :)

dbrgn commented 5 years ago

@koalatux a PR for the 14-draft.json spec file would be welcome :slightly_smiling_face:

rnestler commented 5 years ago

Currently state is required, but you may set the open field to null to indicate that it is not known. But I don't get why this should be any different from state being completely optional.