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

Add test suite to readme; term definition for jsonschema #211

Merged
merged 5 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ https://w3c.github.io/vc-json-schema/
We encourage contributions meeting the [Contribution Guidelines](CONTRIBUTING.md). While we prefer the creation of issues
and Pull Requests in the GitHub repository, discussions may also occur on the [public-credentials](http://lists.w3.org/Archives/Public/public-credentials/) mailing list.

### Test Suite

A [docker](https://www.docker.com/)-based test suite for the specification can [be found here](https://github.com/w3c/vc-json-schema-test-suite). All impelementers are encouraged to add to the test suite.
Copy link
Member

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...

Suggested change
A [docker](https://www.docker.com/)-based test suite for the specification can [be found here](https://github.com/w3c/vc-json-schema-test-suite). All impelementers are encouraged to add to the test suite.
A [docker](https://www.docker.com/)-based test suite for the specification can [be found here](https://github.com/w3c/vc-json-schema-test-suite). All implementers are encouraged to add to the test suite.


### Building

To build, we use [respec](https://respec.org/).
Expand All @@ -21,3 +25,6 @@ Next open up `out.html` in a web browser and review the document.

### Other useful links
* [Public group email archive](https://lists.w3.org/Archives/Public/public-credentials/)
* [VC Data Model](https://www.w3.org/TR/vc-data-model/)
* [JSON Schema](https://json-schema.org/)
* [Test Suite](https://github.com/w3c/vc-json-schema-test-suite)
78 changes: 64 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -200,6 +201,11 @@ <h3>JsonSchema</h3>
</tbody>
</table>
</p>
<p class="note" title="Restriction on the usage of the jsonSchema property">
Usage of the <code><a href="#jsonschema-0">jsonSchema</a></code> property is restricted to
situations where the <code>JsonSchema</code> class instance is the object of the <code>credentialSubject</code>
property within a <code><a href="#jsonschemacredential">JsonSchemaCredential</a></code> instance.
</p>
<p>
An example of utilizing the VC Data Model's <code>credentialSchema</code>
is provided below:
Expand Down Expand Up @@ -273,7 +279,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>
Expand All @@ -291,12 +297,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>
Expand All @@ -314,7 +314,7 @@ <h3>JsonSchemaCredential</h3>
<tr>
<td>id</td>
<td>The constraints on the <code>id</code> property are listed in the Verifiable Credentials
Data Model specification [[VC-DATA-MODEL-2]]. The value MUST be a URL that identifies
Data Model specification [[VC-DATA-MODEL-2]]. The value MUST be a <a>URL</a> that identifies
the <a>verifiable credential</a> which contains a credential schema.</td>
</tr>
<tr>
Expand Down Expand Up @@ -410,10 +410,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/#jsonSchema">Verifiable Credentials Vocabulary v2.0</a>.
</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 only. The value of
the <code>jsonSchema</code> property MUST be a valid [[JSON-SCHEMA]].
</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">
Expand Down Expand Up @@ -461,7 +511,7 @@ <h2>JSON Schema Specifications</h2>
<p class="note" title="A stable JSON Schema specification is coming">
<a href="https://json-schema.org/blog/posts/future-of-json-schema">A stable JSON Schema specification</a>
is in the works. When it's released, we intend to update this table to require the stable version.
</p>
</p>

<section class="normative">
<h3>Reserved Keywords</h3>
Expand Down Expand Up @@ -489,7 +539,7 @@ <h4>$id</h4>
<p>
It is RECOMMENDED that the value of the <code>$id</code> property match the <code>id</code>
value in the <code>credentialSchema</code> object of a <a>verifiable credential</a>, and
that the value of the <code>$id</code> is a dereferenceable URL [[URL]].
that the value of the <code>$id</code> is a dereferenceable <a>URL</a>.
</p>
</section>
<section class="normative">
Expand Down
5 changes: 0 additions & 5 deletions terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@
<dt><dfn data-lt="subjects|subject's">subject</dfn></dt>
<dd>
A thing about which <a>claims</a> are made.
</dd>
<dt><dfn class="lint-ignore">user agent</dfn></dt>
<dd>
A program, such as a browser or other Web client, that mediates the
communication between <a>holders</a>, <a>issuers</a>, and <a>verifiers</a>.
</dd>
<dt><dfn data-lt="credential validation">validation</dfn></dt>
<dd>
Expand Down