Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Schema Integration #1

Open
mkattnerBSB opened this issue Nov 20, 2018 · 4 comments
Open

Schema Integration #1

mkattnerBSB opened this issue Nov 20, 2018 · 4 comments
Labels
question Further information is requested

Comments

@mkattnerBSB
Copy link

Hey guys,

we are developing something pretty new for the marine sector. And we want to rely on signal k.

I just had a look to your source code. I like the way you did it.

But I couldn't find a full schema integrating. Are you doing it by hand, or ist there a automatic way to read it from the json files of the specification repository?
Do you have a roadmap?

Best,
Martin

@rob42
Copy link
Contributor

rob42 commented Nov 20, 2018

Thanks, there are some improvements coming too, but I'm still finishing an edge case. The new version makes it easy to react to signalk keys and value changes, or to generate synthetic keys from real data - eg true wind from apparent wind.

'full schema integrating' - not sure what you mean. I'm deliberately using unstructured json (maps etc) as signalk both develops fast, and allows for arbitrary extension. Ive used jackson to reverse the schema to java pojos for the swagger docs, and tried the full schema too. Jackson didnt create nice pojos, so I canned that.

Roadmap is in my head!.
Basically first goal is full signalk schema compliance with swagger docs for REST apis etc. Multi-vessel, horizontally scale-able. Nearly there.
Second - fine-grained security (RBAC) down to the individual key level - the basics are there
Third - full history with analysis. - the basics are there
More:

  • any transport ( MQTT, COAP, STOMP, serial, tcp, udp, etc)
  • discovery and on-demand data sharing between arbitrary signalk users - a bit like private chat groups in XMPP - in fact Ive used that to experiment.

But its a lot of work. Extra hands are always welcome.

@rob42 rob42 added the question Further information is requested label Nov 21, 2018
@mkattner
Copy link

"...swagger docs, and tried the full schema too. Jackson didnt create nice pojos"

The signalk schema files are json schemas in version draft-04. Right? And no swagger docs.

As Jackson and the other POJO generators didn't work well, I wrote a simple own pojo generator.
Have a look to the attachment:
eclipse_2018-11-22_14-06-03

Deserializing with Jackosn:
{"vessels":{"self":{"sensors":{"mastRotation":{"sensorData":"180"}}}}}

Creates a nice SignalK Pojo Instance.

And serializing with Jackson results in:
{"vessels":{"self":{"sensors":{"mastRotation":{"sensorData":"180"}}}}}

Pojo Generation is 85% done and it works for my needs. I'll update it as soon as the first problems are araising.

If you want I can share the pojos with you ;-)

@rob42
Copy link
Contributor

rob42 commented Nov 22, 2018

ooh nice :-) Thats much better than the jackson version:
image
If you can contribute that would be appreciated.

Due to the dynamic nature of signalk I wont change the current handling in artemis, but your code would be great for swagger docs, test suites and signalk spec compliance checking which is a priority for us.

BTW the swagger docs are generated on the fly in the artemis server, so they are not in the spec yet.

@rob42
Copy link
Contributor

rob42 commented Nov 23, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants