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 all 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
113 changes: 99 additions & 14 deletions messages/definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
],
"properties": {
"@context": {
"type": "string",
"title": "Device context",
"description": "Context of the device"
"$ref": "#/definitions/device-context"
},
"@type": {
"type": "array",
Expand Down Expand Up @@ -108,9 +106,7 @@
"description": "Description of the device",
"properties": {
"@context": {
"type": "string",
"title": "Device context",
"description": "Context of the device"
"$ref": "#/definitions/device-context"
},
"@type": {
"type": "array",
Expand Down Expand Up @@ -282,6 +278,12 @@
"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)",
"deprecated": true
},
"type": {
"type": "string",
"title": "Link media type",
"description": "The media type of the link"
Expand Down Expand Up @@ -464,7 +466,7 @@
"type": {
"type": "string",
"title": "Event value type",
"description": "The type of the event value",
"description": "Event payload data schema (deprecated in favour of data.type)",
"enum": [
"null",
"boolean",
Expand All @@ -473,34 +475,88 @@
"number",
"integer",
"string"
]
],
"deprecated": true
},
"unit": {
"type": "string",
"title": "Event unit",
"description": "The unit of the event"
"description": "The unit of the event (deprecated in favour of data.unit)",
"deprecated": true
},
"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)",
"deprecated": true
},
"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)",
"deprecated": true
},
"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)",
"deprecated": true
},
"enum": {
"type": "array",
"items": {
"title": "Property values enum",
"description": "The possible values of the property",
"$ref": "#/definitions/any"
"description": "The possible values of the property (deprecated in favour of data.enum)",
"$ref": "#/definitions/any",
"deprecated": true
}
},
"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 Expand Up @@ -701,6 +757,35 @@
}
}
]
},
"device-context": {
"oneOf": [
{
"type": "string",
"title": "Device context",
"description": "The JSON-LD context used by the device"
},
{
"type": "array",
"title": "Device contexts",
"description": "An array of JSON-LD contexts used by the device",
"items": {
"oneOf": [
{
"type": "string",
"title": "Device context",
"description": "A JSON-LD context used by the device"

},
{
"type": "object",
"title": "Prefixed device context",
"description": "A JSON-LD context used by the device, with prefix as key and context URI as value"
}
]
}
}
]
}
}
}