generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add json schemas for vc and did data models (#127)
* add json schemas * format fix --------- Co-authored-by: nitro-neal <[email protected]>
- Loading branch information
1 parent
77f2cbd
commit efa968d
Showing
6 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Web5 Spec | ||
|
||
This directory servers as a sub-resource for the [main spec](../README.md) to further define our usage of selected standards. | ||
|
||
* [Decentralized Identifiers v1.0](did.md) | ||
* [Verifiable Credentials v1.1](vc.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"properties": { | ||
"created": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"updated": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"deactivated": { | ||
"type": "boolean" | ||
}, | ||
"nextUpdate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"versionId": { | ||
"type": "string" | ||
}, | ||
"nextversionId": { | ||
"type": "string" | ||
}, | ||
"equivalentId": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
} | ||
}, | ||
"canonicalId": { | ||
"type": "string" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"definitions": { | ||
"errorType": { | ||
"type": "string", | ||
"enum": ["invalidDid", "notFound", "representationNotSupported", "methodNotSupported", "invalidDidDocument", "invalidDidDocumentLength", "internalError"] | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"error": { | ||
"$ref": "#/definitions/errorType" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"definitions": { | ||
"verificationMethod": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"controller": { | ||
"type": "string" | ||
}, | ||
"publicKeyJwk": { | ||
"type": "object" | ||
} | ||
}, | ||
"required": ["id", "type", "controller", "publicKeyJwk"] | ||
}, | ||
"service": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "string" | ||
}, | ||
"serviceEndpoint": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"sig": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"enc": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["id", "type", "serviceEndpoint"] | ||
} | ||
}, | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"controller": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"alsoKnownAs": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"verificationMethod": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/verificationMethod" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"authentication": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"assertionMethod": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"keyAgreement": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"capabilityInvocation": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"capabilityDelegation": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"service": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/service" | ||
} | ||
} | ||
}, | ||
"required": ["id", "verificationMethod"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"definitions": { | ||
"credentialStatus": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"type": { "type": "string" }, | ||
"statusPurpose": { "type": "string" }, | ||
"statusListIndex": { "type": "string" }, | ||
"statusListCredential": { "type": "string" } | ||
}, | ||
"required": ["id", "type", "statusPurpose", "statusListIndex", "statusListCredential"] | ||
}, | ||
"credentialSchema": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"type": { "type": "string" } | ||
}, | ||
"required": ["id", "type"] | ||
} | ||
}, | ||
"properties": { | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"issuer": { | ||
"oneOf": [ | ||
{ "type": "string" }, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" }, | ||
"name": { "type": "string" } | ||
}, | ||
"required": ["id"] | ||
} | ||
] | ||
}, | ||
"issuanceDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"expirationDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"credentialSubject": { | ||
"type": "object", | ||
"properties": { | ||
"id": { "type": "string" } | ||
}, | ||
"required": ["id"] | ||
}, | ||
"credentialStatus": { "$ref": "#/definitions/credentialStatus" }, | ||
"credentialSchema": { "$ref": "#/definitions/credentialSchema" }, | ||
"evidence": { | ||
"type": "array", | ||
"items": { "type": "object" } | ||
} | ||
}, | ||
"required": ["@context", "id", "type", "issuer", "issuanceDate", "credentialSubject"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-2020-12/schema#", | ||
"type": "object", | ||
"properties": { | ||
"@context": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"id": { | ||
"type": "string" | ||
}, | ||
"type": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"minItems": 1 | ||
}, | ||
"holder": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"issuanceDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"expirationDate": { | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"verifiableCredential": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "vc-11.json" | ||
}, | ||
"minItems": 1 | ||
} | ||
}, | ||
"required": ["@context", "id", "type", "holder", "issuanceDate", "verifiableCredential"] | ||
} |