Skip to content

Commit

Permalink
Add support for credentialId
Browse files Browse the repository at this point in the history
-credentialId identifies credentials without credential.id set
  • Loading branch information
wes-smith committed Jan 30, 2024
1 parent 74e8e32 commit dd0add5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/Credential.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ components:
type: string
"id":
type: string
description: The ID of the credential.
description: The ID of the credential. This property MAY be empty. The issuer SHOULD NOT auto-generate the id property, as this can lead to unrecoverable partitioning errors.
"type":
type: array
description: The JSON-LD type of the credential.
Expand Down
3 changes: 3 additions & 0 deletions components/IssueCredentialOptions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ components:
type:
type: string
description: The type of credential status to issue the credential with
credentialId:
type: string
description: An identifier that can be used to identify the credential. credentialId SHOULD NOT be set if the id property is set. If credential.id is set, that value will be duplicated for credentialId. If neither credentialId nor id is set, there will be no way to uniquely identify a credential or deal with duplicate errors. This property should not be used as a replacement for credential.id, rather as a means of identifying a credential without the id property set.
example:
{
"created": "2020-04-02T18:48:36Z",
Expand Down
34 changes: 34 additions & 0 deletions components/IssueCredentialSuccess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
openapi: 3.0.0
info:
version: "0.0.3-unstable"
title: VC API
description: This is an Experimental Open API Specification for the [VC Data Model](https://www.w3.org/TR/vc-data-model/).
license:
name: W3C Software and Document License
url: http://www.w3.org/Consortium/Legal/copyright-software.
contact:
name: GitHub Source Code
url: https://github.com/w3c-ccg/vc-api
paths:
components:
schemas:
IssueCredentialSuccess:
type: object
description: The format returned from a successful issue request.
properties:
VerifiableCredential:
type: object
description: A JSON-LD Verifiable Credential with a proof.
allOf:
- $ref: "./Credential.yml#/components/schemas/Credential"
- type: object
properties:
proof:
$ref: "./DataIntegrityProof.yml#/components/schemas/DataIntegrityProof"
IssuanceMetadata:
type: object
description: Metadata about the issued credential.
properties:
credentialId:
type: string
description: An identifier for the credential. If credentialId is not set by the user in the issue request, credential.id will be duplicated here.
4 changes: 2 additions & 2 deletions holder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ paths:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Gets a credential or verifiable credential by ID
summary: Gets a credential or verifiable credential by ID. To get a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
operationId: getCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
Expand Down Expand Up @@ -55,7 +55,7 @@ paths:
- networkAuth: []
- oAuth2: []
- zCap: []
summary: Deletes a credential or verifiable credential by ID
summary: Deletes a credential or verifiable credential by ID. To delete a credential that does not have credential.id set but has an associated credentialId value, pass credentialId instead.
operationId: deleteCredential
parameters:
- $ref: "./components/parameters/path/ObjectId.yml"
Expand Down
4 changes: 2 additions & 2 deletions issuer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ components:
IssueCredentialResponse:
type: object
properties:
verifiableCredential:
$ref: "./components/VerifiableCredential.yml#/components/schemas/VerifiableCredential"
IssueCredentialSuccess:
$ref: "./components/IssueCredentialSuccess.yml#/components/schemas/IssueCredentialSuccess"
UpdateCredentialStatus:
type: object
description: Request for updating the status of an issued credential.
Expand Down

0 comments on commit dd0add5

Please sign in to comment.