Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to device schema needed for W3C compliance #20

Open
benfrancis opened this issue Sep 28, 2021 · 2 comments
Open

Changes to device schema needed for W3C compliance #20

benfrancis opened this issue Sep 28, 2021 · 2 comments

Comments

@benfrancis
Copy link
Member

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:

  1. Add data wrapper for event data schema Add data wrapper for event data schema gateway#2810
  2. Change mediaType to type for links in API Change mediaType to type for links in API gateway#2808
  3. Change @context of Thing Descriptions to an array Change @context of Thing Descriptions gateway#2809

Ideally we would also remove or vendor-prefix non-standard members of the Thing Description

  1. Remove name member of property affordances in Thing Descriptions Remove name member of property affordances in Thing Descriptions gateway#2855
  2. Remove value member of property affordances in Thing Descriptions Remove value member of property affordances in Thing Descriptions gateway#2854
  3. Add prefix to proprietary members of Thing Descriptions Remove or add prefix to proprietary members of Thing Descriptions gateway#2832

Before releasing these changes we'll need to evaluate the impact on any existing add-ons which may use these terms directly.

@benfrancis
Copy link
Member Author

Draft PR #21 implements the first three by allowing the old and new formats.

Similarly, I suggest adding back in support for links as a deprecated alternative to forms.

@benfrancis
Copy link
Member Author

@tim-hellhake What do you think about also marking the following members as deprecated?

  • name - Why does this still exist, wasn't it replaced by title?
  • value - Why do values of properties get sent in the Thing Description? That should never have happened.
  • href - This should not be needed in a Thing resource, only a Things resource until we implement the W3C Directory Service API
  • baseHref What's the difference between this and base?

We should also consider vendor-prefixing the following members on some way:

  • pin
  • credentialsRequired

e.g. using a new JSON-LD context

{
  "schema": [{"wtg": "https://webthings.io/schemas/webthings-gateway" }],
  "wtg:pin": {},
  "wtg:credentialsRequired": {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant