SpaceApi / schema

SpaceAPI JSON schema files.
24 stars 15 forks source link

Question: how to provide forward compatibility for newer clients? #96

Open xopr opened 2 years ago

xopr commented 2 years ago

Since #56 it is possible to provide a sort of compatibility indication server side, but there is no client side preferred version possible.

We're looking into migrating to newer SpaceAPI versions but our hackerspace makes heavily use of the null/undefined spacestate on the backend where it determines that after n minutes, there is no certain state (internet loss, power failure, building torn down).

We also have multiple implementations of several (embedded) clients that reflect the v.013 state, so upgrading to the future v0.15 would most likely break those implementations (of which one is built into a car dashboard).

What would your suggestion be for a client to indicate support for newer versions? Can these suggestions be documented as well?

In my opinion there are a couple of ways to go about:

API endpoints might default to their liking but still provide forward compatibility while clients can specify which version they actually want.

I know this could be regarded as an edge case, but it might assist in migrating to future versions really well where a hackerspace wants to provide the latest and greatest while still pleasing the dozens of IOT devices that might be difficult to upgrade.

rnestler commented 1 year ago

I'd prefer to solve it at the directory level an be able to provide multiple endpoints like:

[
   {
      "url": "https://my.space.api/013/status.json",
       "supported_api_versions": ["0.13"]
  },
   {
      "url": "https://my.space.api/status.json",
       "supported_api_versions": ["14", "15"]
  },
]