Skip to content

Commit 072f324

Browse files
committed
chore(typescript): sync thing model json schema from wot-thing-description.git
1 parent 3f6cc45 commit 072f324

File tree

2 files changed

+40
-20
lines changed

2 files changed

+40
-20
lines changed

typescript/thing-model/schema/tm-json-schema-validation.json

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "Thing Model",
3-
"version": "1.1-09-November-2023",
3+
"version": "1.1-12-March-2025",
44
"description": "JSON Schema for validating Thing Models. This is automatically generated from the WoT TD Schema.",
55
"$schema": "http://json-schema.org/draft-07/schema#",
66
"$id": "https://raw.githubusercontent.com/w3c/wot-thing-description/main/validation/tm-json-schema-validation.json",
@@ -98,7 +98,10 @@
9898
"$ref": "#/definitions/anyUri"
9999
},
100100
{
101-
"type": "object"
101+
"type": "object",
102+
"additionalProperties": {
103+
"type": "string"
104+
}
102105
}
103106
],
104107
"not": {
@@ -113,7 +116,7 @@
113116
{
114117
"$comment": "Old context URI, followed by the new one and possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided",
115118
"type": "array",
116-
"prefixItems": [
119+
"items": [
117120
{
118121
"$ref": "#/definitions/thing-context-td-uri-v1"
119122
},
@@ -122,39 +125,39 @@
122125
}
123126
],
124127
"minItems": 2,
125-
"contains": {
126-
"$ref": "#/definitions/thing-context-td-uri-v1.1"
127-
},
128128
"additionalItems": {
129129
"anyOf": [
130130
{
131131
"$ref": "#/definitions/anyUri"
132132
},
133133
{
134-
"type": "object"
134+
"type": "object",
135+
"additionalProperties": {
136+
"type": "string"
137+
}
135138
}
136139
]
137140
}
138141
},
139142
{
140143
"$comment": "Old context URI, followed by possibly other vocabularies. minItems and contains are required since prefixItems does not say all items should be provided",
141144
"type": "array",
142-
"prefixItems": [
145+
"items": [
143146
{
144147
"$ref": "#/definitions/thing-context-td-uri-v1"
145148
}
146149
],
147150
"minItems": 1,
148-
"contains": {
149-
"$ref": "#/definitions/thing-context-td-uri-v1"
150-
},
151151
"additionalItems": {
152152
"anyOf": [
153153
{
154154
"$ref": "#/definitions/anyUri"
155155
},
156156
{
157-
"type": "object"
157+
"type": "object",
158+
"additionalProperties": {
159+
"type": "string"
160+
}
158161
}
159162
]
160163
}

typescript/thing-model/thing-model.d.ts

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,31 +166,48 @@ export type ThingContext =
166166
...(
167167
| AnyUri
168168
| {
169-
[k: string]: unknown;
169+
[k: string]: string;
170170
}
171171
)[]
172172
]
173173
| "https://www.w3.org/2022/wot/td/v1.1"
174-
| [unknown, unknown, ...unknown[]]
175-
| [unknown, ...unknown[]]
174+
| [
175+
ThingContextTdUriV1,
176+
ThingContextTdUriV11,
177+
...(
178+
| AnyUri
179+
| {
180+
[k: string]: string;
181+
}
182+
)[]
183+
]
184+
| [
185+
ThingContextTdUriV1,
186+
...(
187+
| AnyUri
188+
| {
189+
[k: string]: string;
190+
}
191+
)[]
192+
]
176193
| "https://www.w3.org/2019/wot/td/v1";
177194
/**
178195
* This interface was referenced by `ThingModel`'s JSON-Schema
179196
* via the `definition` "thing-context-td-uri-v1.1".
180197
*/
181198
export type ThingContextTdUriV11 = "https://www.w3.org/2022/wot/td/v1.1";
199+
/**
200+
* This interface was referenced by `ThingModel`'s JSON-Schema
201+
* via the `definition` "thing-context-td-uri-v1".
202+
*/
203+
export type ThingContextTdUriV1 = "https://www.w3.org/2019/wot/td/v1";
182204
/**
183205
* This interface was referenced by `ThingModel`'s JSON-Schema
184206
* via the `definition` "tm_optional".
185207
*/
186208
export type TmOptional = (string & {
187209
[k: string]: unknown;
188210
})[];
189-
/**
190-
* This interface was referenced by `ThingModel`'s JSON-Schema
191-
* via the `definition` "thing-context-td-uri-v1".
192-
*/
193-
export type ThingContextTdUriV1 = "https://www.w3.org/2019/wot/td/v1";
194211
/**
195212
* This interface was referenced by `ThingModel`'s JSON-Schema
196213
* via the `definition` "thing-context-td-uri-temp".

0 commit comments

Comments
 (0)