-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add test suite to readme; term definition for jsonschema #211
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
github: "https://github.com/w3c/vc-json-schema/", | ||
includePermalinks: false, | ||
edDraftURI: "https://w3c.github.io/vc-json-schema/", | ||
testSuiteURI: "https://w3c.github.io/vc-json-schema-test-suite/", | ||
editors: [{ | ||
name: "Gabe Cohen", | ||
url: "https://github.com/decentralgabe", | ||
|
@@ -273,7 +274,7 @@ <h3>JsonSchemaCredential</h3> | |
The <code>credentialSubject</code> property MUST contain two properties: | ||
<ul> | ||
<li><code>type</code> – the value of which MUST be <code>JsonSchema</code></li> | ||
<li><code>jsonSchema</code> – an object which contains a valid JSON Schema</li> | ||
<li><a href="jsonschema-0"><code>jsonSchema</code></a> – an object which contains a valid JSON Schema</li> | ||
</ul> | ||
</li> | ||
<li> | ||
|
@@ -291,12 +292,6 @@ <h3>JsonSchemaCredential</h3> | |
</p> | ||
</li> | ||
</ul> | ||
|
||
<p> | ||
The <a href="https://www.w3.org/TR/json-ld/#dfn-term-definition">term definition</a> | ||
for using the <code>jsonSchema</code> property within the <code>credentialSubject</code> | ||
of a verifiable credential is <code>https://www.w3.org/ns/credentials#jsonSchema</code>. | ||
</p> | ||
<p> | ||
Any version of [[JSON-SCHEMA]] in the section on | ||
<a href="#json-schema-specifications">JSON Schema Specifications</a> | ||
|
@@ -410,10 +405,60 @@ <h3>JsonSchemaCredential</h3> | |
} | ||
</pre> | ||
</p> | ||
<p class="issue" data-number="159"> | ||
Add language about JsonSchemaCredential credentials having a credentialSchema property | ||
and the risks of nesting. | ||
</p> | ||
<section class="normative"> | ||
<h4>jsonSchema</h4> | ||
<p> | ||
This term is part of the | ||
<a href="https://www.w3.org/2018/credentials/#JsonSchemaCredential">Verifiable Credentials Vocabulary v2.0</a>. | ||
decentralgabe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</p> | ||
<p><b>jsonSchema</b> enables the use of the <code>jsonSchema</code> property | ||
within the <code>credentialSubject</code> of a verifiable credential. The term is | ||
intended to be used with the <a href="#jsonschemacredential"></a> type. The value of | ||
decentralgabe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
the <code>jsonSchema</code> property MUST be a valid [[JSON-SCHEMA]]. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are two related statements:
There are two alternative interpretations of these two statements when put together.
I suspect that the intention of the spec is alternative (2). If so, this statement should be very explicitly added to the definition of the property in §2.1 (I know that it is between the lines in §2.2, but not really explicitly). Unfortunately, expressing that in the RDFS ontology is not really possible (or would require some complex OWL ontology construct that I do not think we should use), which means one more reason for this restrictions to appear very explicitly. Note that, personally, I would not have any problems with alternative (1), which is simpler. But it is not my decision. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Actually, there would be one way of introducing this restriction into the vocabulary: define a subclass of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I intended for (2) and will firm up the language. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @iherman please review the latest change, I've added a note with the text you've suggested in section 2.1 |
||
</p> | ||
<p> | ||
<pre class="example jsonschemacredential-jsonschema nohighlight" title="Example JsonSchema Credential with jsonSchema"> | ||
{ | ||
"@context": [ | ||
"https://www.w3.org/ns/credentials/v2", | ||
"https://www.w3.org/ns/credentials/examples/v2" | ||
], | ||
"id": "https://example.com/credentials/3734", | ||
"type": ["VerifiableCredential", "JsonSchemaCredential"], | ||
"issuer": "https://example.com/issuers/14", | ||
"issuanceDate": "2010-01-01T19:23:24Z", | ||
"credentialSchema": { | ||
"id": "https://www.w3.org/2022/credentials/v2/json-schema-credential-schema.json", | ||
"type": "JsonSchema", | ||
}, | ||
"credentialSubject": { | ||
"id": "https://example.com/schemas/favorite-color-schema.json", | ||
"type": "JsonSchema", | ||
<span class="highlight"> "jsonSchema": { | ||
"$id": "https://example.com/schemas/favorite-color-schema.json", | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"name": "Favorite Color Schema", | ||
"description": "Favorite Color using JsonSchemaCredential", | ||
"type": "object", | ||
"properties": { | ||
"credentialSubject": { | ||
"type": "object", | ||
"properties": { | ||
"favoriteColor": { | ||
"type": "string" | ||
"enum": ["red", "orange", "green", "blue", "yellow", "purple"] | ||
} | ||
}, | ||
"required": ["favoriteColor"] | ||
} | ||
} | ||
} | ||
</span> | ||
} | ||
} | ||
</pre> | ||
</p> | ||
</section> | ||
</section> | ||
</section> | ||
<section class="normative"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The things that jump out after a PR is merged...