WebThingsIO / gateway

WebThings Gateway
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 336 forks source link

Create central Thing Description schema #2879

Open benfrancis opened 3 years ago

benfrancis commented 3 years ago

In working on making the Thing Descriptions and API exposed by the gateway W3C compliant I've found it a bit strange that the JSON schema and TypeScript types used to validate Thing Descriptions live in the gateway-addon-ipc-schema and gateway-addon-node repos respectively.

I'm wondering whether we should eventually have a central repo (or directory inside a repo) inside the WebThingsIO GitHub org to define the JSON schema (and TypeScript types) for the Thing Description data model, as used in WebThings. Schemas which can be shared by the gateway, gateway-addon-node, gateway-addon-python, gateway-addon-ipc-schema and wot-adapter repos but which are independent of those defined in the W3C's wot-scripting-api repo in case we need to temporarily diverge from them.

benfrancis commented 3 years ago

See also: https://github.com/WebThingsIO/gateway-addon-ipc-schema/issues/19

benfrancis commented 3 years ago

Note that there is now an npm package published by the W3C which provides a schema and TypeScript types based on the schemas in the wot-scripting-api repo https://www.npmjs.com/package/wot-thing-description-types

We could maintain a fork of that (gives us more flexibility than depending it on directly).

lu-zero commented 2 years ago

Depending on what you have in mind, wouldn't be better to use the wot as base and just add to the context the webthings-specific bits with the wt namespace?