specification icon indicating copy to clipboard operation
specification copied to clipboard

Standard API and client libraries

Open tkurki opened this issue 7 years ago • 10 comments

To make Signal K usage and adoption easier and promote similar behavior across clients we should have a standard api for acccessing Signal K data and metadata and communicating with servers.

tkurki avatar Aug 28 '16 07:08 tkurki

See also #240

tkurki avatar Aug 31 '16 19:08 tkurki

And also #237 as a useful part of the standard API

timmathews avatar Dec 19 '16 23:12 timmathews

@sailoog I understand you are using keyswithmetadata.json, which is not exactly standardised and just changed location with #368.

Could you please describe your use case? I would like to pin this down so that we can provide an api you can rely on.

tkurki avatar Aug 10 '17 06:08 tkurki

@tkurki thanks for notifying.

Openplotter allows to use many types of sensors. Users must select the key where data from sensors will be stored. So, we need to build menus with all available keys to be selected, an example: select_key

We parse keyswithmetadata.json, group keys by SK group and offer a selecting window with keys description. There are also other uses of Signal k key menus like trigger/actions system that need to use the same system. keyswithmetadata.json is doing the job but we could use also any "on the fly" method.

We need an json output with key name, description, unit, enum value. Any idea? Thanks.

sailoog avatar Aug 10 '17 15:08 sailoog

What if we made the flat schema, essentially keyswithmetadata, part of the server api, retrievable from say /signalk/v1/schema/flat?

tkurki avatar Aug 10 '17 15:08 tkurki

That would be great. Easier and more reliable than a file. Would it be possible to add enums? We would use them to set/select possible "states" of keys on trigger/actions system and could be useful for others too.

sailoog avatar Aug 10 '17 15:08 sailoog

@sailoog Thinking about this and needing units in a webapp code I remembered earlier discussion about metadata/schema data retrieval via the current api. The schema for full model includes a meta element that has units, so let's make the server return relevant metadata for all paths, not just ones that the server happens to have data for: see https://github.com/SignalK/signalk-server-node/pull/294

tkurki avatar Sep 27 '17 19:09 tkurki

@tkurki OK. So, do you think keyswithmetadata.json is still the best way of getting the complete list of supported keys?

sailoog avatar Oct 07 '17 18:10 sailoog

Yes. Should we expose it via http?

tkurki avatar Oct 07 '17 18:10 tkurki

It is not necessary for us. I can work with keyswithmetadata.json Thanks

sailoog avatar Oct 07 '17 18:10 sailoog