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

Make changes to device schema for W3C compliance - partial fix for #20 #21

Merged
merged 4 commits into from
Jan 13, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 88 additions & 11 deletions messages/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,21 @@
],
"properties": {
"@context": {
"type": "string",
"title": "Device context",
"description": "Context of the device"
"oneOf": [
{
"type": "string",
"title": "Device context",
"description": "JSON-LD context used by the device"
},
{
"type": "array",
"items": {
"type": "string",
"title": "Device contexts",
"description": "An array of JSON-LD contexts used by the device"
}
}
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change we can support these two context types: @context : "URL" and @context : ["url", "url"]

What about:

@context : [ "url", { myprefix : "url"}] 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I think so.

Copy link
Member Author

@benfrancis benfrancis Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this? (pushed another commit)

},
"@type": {
"type": "array",
Expand Down Expand Up @@ -108,9 +120,21 @@
"description": "Description of the device",
"properties": {
"@context": {
"type": "string",
"title": "Device context",
"description": "Context of the device"
"oneOf": [
{
"type": "string",
"title": "Device context",
"description": "JSON-LD context used by the device"
},
{
"type": "array",
"items": {
"type": "string",
"title": "Device contexts",
"description": "An array of JSON-LD contexts used by the device"
}
}
]
},
"@type": {
"type": "array",
Expand Down Expand Up @@ -282,6 +306,11 @@
"description": "The type of the relationship"
},
"mediaType": {
"type": "string",
"title": "Link media type",
"description": "The media type of the link (deprecated in favour of type)"
},
"type": {
"type": "string",
"title": "Link media type",
"description": "The media type of the link"
Expand Down Expand Up @@ -478,30 +507,78 @@
"unit": {
"type": "string",
"title": "Event unit",
"description": "The unit of the event"
"description": "The unit of the event (deprecated in favour of data.unit)"
benfrancis marked this conversation as resolved.
Show resolved Hide resolved
},
"minimum": {
"type": "number",
"title": "Event minimum value",
"description": "The minimum value of the event"
"description": "The minimum value of the event (deprecated in favour of data.minimum)"
},
"maximum": {
"type": "number",
"title": "Event maximum value",
"description": "The maximum value of the event"
"description": "The maximum value of the event (deprecated in favour of data.maximum)"
},
"multipleOf": {
"type": "number",
"title": "Event value precision",
"description": "The precision of the value"
"description": "The precision of the value (deprecated in favour of data.multipleOf)"
},
"enum": {
"type": "array",
"items": {
"title": "Property values enum",
"description": "The possible values of the property",
"description": "The possible values of the property (deprecated in favour of data.enum)",
"$ref": "#/definitions/any"
}
},
"data": {
"type": "object",
"description": "Event payload data schema",
"properties": {
"type": {
"type": "string",
"title": "Event value type",
"description": "The type of the event value",
"enum": [
"null",
"boolean",
"object",
"array",
"number",
"integer",
"string"
]
},
"unit": {
"type": "string",
"title": "Event unit",
"description": "The unit of the event"
},
"minimum": {
"type": "number",
"title": "Event minimum value",
"description": "The minimum value of the event"
},
"maximum": {
"type": "number",
"title": "Event maximum value",
"description": "The maximum value of the event"
},
"multipleOf": {
"type": "number",
"title": "Event value precision",
"description": "The precision of the value"
},
"enum": {
"type": "array",
"items": {
"title": "Property values enum",
"description": "The possible values of the property",
"$ref": "#/definitions/any"
}
}
}
}
}
},
Expand Down