Skip to content

Commit e45b60c

Browse files
absoluditymsporny
andauthored
Ensure that a @context array item is a string or a non-empty object.
Co-authored-by: Manu Sporny <msporny@digitalbazaar.com>
1 parent b2f09c5 commit e45b60c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

schema/verifiable-credential/verifiable-credential-schema.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,31 @@
161161
"properties": {
162162
"@context": {
163163
"type": "array",
164+
"contains": {
165+
"const": "https://www.w3.org/ns/credentials/v2"
166+
},
167+
"minItems": 1,
168+
"items": {
169+
"oneOf": [
170+
{
171+
"type": "string",
172+
"minLength": 1
173+
},
174+
{
175+
"type": "object",
176+
"minProperties": 1,
177+
"propertyNames": {
178+
"type": "string",
179+
"minLength": 1
180+
}
181+
}
182+
]
183+
},
164184
"prefixItems": [
165185
{
166186
"const": "https://www.w3.org/ns/credentials/v2"
167187
}
168188
],
169-
"minItems": 1,
170189
"uniqueItems": true
171190
},
172191
"id": {

0 commit comments

Comments
 (0)