Data Schemas
Introduction
Verified Inc. enables securely sharing verified
We use JSON Schema syntax for data validation purposes via a pre-compiled AJV engine. This ensures our credential schemas are robust enough to encapsulate any data while still being easily described, displayed, and validated.
Schema Definitions
You can view all of the Verified Inc. defined credential schemas via https://schema-resolver.verified.inc/jsonSchema. If you want to know the schema for a particular credential type you can use that same url with the desired credential type in the path. For example, https://schema-resolver.verified.inc/jsonSchema/EmailCredential, would yield the EmailCredential's schema information.
We have this API documented via our public Postman collection documentation under Schema Resolver.
It is possible to view the response bodies from https://schema-resolver.verified.inc/jsonSchema in the browser, but we recommend Postman, which automatically formats the JSON response for human readability.
We hope to soon make it possible for you as a
We currently support what can be referred to as "single attribute atomic credentials" and "composite credentials".
Atomic credentials provide users a means of selective disclosure for
Composite credentials are credentials that contain multiple "Atomic Credentials". For example, the FullNameCredential
contains FirstNameCredential
, LastNameCredential
and MiddleNameCredential
. This provides a means of grouping atomic credentials with related data.
JSON Schema
The /jsonSchema
path will return the JSON schema definition, e.g. https://schema-resolver.verified.inc/jsonSchema/FirstNameCredential:
{
"$id": "FirstNameCredential",
"type": "object",
"properties": {
"firstName": {
"description": "A person's first name",
"examples": ["John", "Mary Kate"],
"title": "First Name",
"displayFormat": "String",
"type": "string"
}
},
"required": ["firstName"]
}
For composite credential schemas, the object will contain a allOf
property, which is an array of the atomic credential schemas:
{
"$id": "FullNameCredential",
"type": "object",
"allOf": [
{
"$ref": "FirstNameCredential"
},
{
"$ref": "LastNameCredential"
},
{
"$ref": "MiddleNameCredential"
}
]
}
The $ref
property is a JSON Pointer, which is a string containing a URI fragment identifier. In this case, it is a reference to another schema. This is how we define composite credential schemas.
It's important to note that each of these credentials inside FullNameCredential
are single attribute atomic credentials, so you are able to request individually.
But if you need create or request a CityCredential
and a StateCredential
you will need to use AddressCredential
so data doesn't get mismatched.
Schema Library
Search for or select a schema, see its properties and attributes, and copy the schema JSON:
Example
First, we get the JSON schemas for the SsnCredential
, FullNameCredential
, which contains FirstNameCredential
and LastNameCredential
and review their attributes' description
s and examples
.
Next, we construct valid credential bodies, according to the schemas:
/*The credential data compliant with the Ssn, FullName (FirstName and LastName) Credentials schemas*/
const credentialsList: Credentials = [
{
type: 'SsnCredential',
data: {
ssn: '333224444',
},
},
{
type: 'FullNameCredential',
data: [
{
type: 'FirstNameCredential',
data: {
firstName: 'John',
},
},
{
type: 'LastNameCredential',
data: {
lastName: 'Doe',
},
},
],
},
];
{
"credentials": credentialsList, // a list of one or more Credentials objects
"email": "richard.hendricks@pipedpiper.net"
}