webthingsio / gateway-addon-ipc-schema Goto Github PK
View Code? Open in Web Editor NEWJSON-Schema for add-on IPC messages
License: Mozilla Public License 2.0
JSON-Schema for add-on IPC messages
License: Mozilla Public License 2.0
The current schema does not allow the root @type
to be a string, however this is allowed both in w3c and webthings TDs
Where can I get exhaustive documentation about IPC Notifications? I was found Adapter-IPC, but this documentations looks outdated.
For better or worse the schemas defined in definitions.json are currently used by the WebThings Gateway application to validate parts of Thing Descriptions and to generate TypeScript types used to represent them.
There are certain changes needed to these schemas in order to validate W3C compliant Thing Descriptions. Notably:
Ideally we would also remove or vendor-prefix non-standard members of the Thing Description
Before releasing these changes we'll need to evaluate the impact on any existing add-ons which may use these terms directly.
As mentioned in WebThingsIO/gateway#2806 (comment) W3C now publish the official schema and its corrective Typescript types in a npm package. I was wondering if, in the near future, it would be better for the addons and the gateway to depend upon this official schema rather than the one defined here.
I noticed that the schemas have hard coded constants for the messageTypes. I think that the constants defined here: https://github.com/mozilla-iot/gateway-addon-node/blob/master/lib/constants.js should be used here.
And it probably makes sense to move that constants.js file from the gateway-addon-node repository to this repository (since this repository appears to be a lower-level respository).
Using the current ipc schema inside the gateway causes the following complaints
2021-09-28 18:19:07.930 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:07.937 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:07.946 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.026 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.114 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.122 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.128 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.181 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.186 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.192 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.239 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.243 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
2021-09-28 18:19:08.249 ERROR : wot-adapter: strict mode: missing type "object" for keyword "properties" at "https://raw.githubusercontent.com/WebThingsIO/gateway-addon-ipc-schema/master/messages/definitions.json#/allOf/1" (strictTypes)
Even if the message is not helping a lot I think the problem has to be found here:
gateway-addon-ipc-schema/messages/definitions.json
Lines 572 to 606 in 7cc08ec
Notice how the second schema does not have type
property defined
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.