Skip to content

Commit

Permalink
add validations
Browse files Browse the repository at this point in the history
  • Loading branch information
Patel-Raj committed Feb 19, 2025
1 parent 7a992eb commit 98acb8c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/transactions/credential_accept.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ components:
properties:
CredentialType:
type: string
pattern: '^[0-9a-fA-F]+$'
description: Arbitrary data defining the type of credential. The minimum size is 1 byte and the maximum is 64 bytes.
Issuer:
type: string
description: The address of the issuer that created the credential.
x-custom-validation:
validCredentialType:
field: CredentialType

CredentialAcceptErrorCode:
$id: CredentialAcceptErrorCode
Expand Down
6 changes: 6 additions & 0 deletions shared/transactions/credential_create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ components:
properties:
CredentialType:
type: string
pattern: '^[0-9a-fA-F]+$'
description: Arbitrary data defining the type of credential this entry represents. The minimum length is 1 byte and the maximum length is 64 bytes.
Expiration:
type: number
Expand All @@ -26,9 +27,14 @@ components:
description: The subject of the credential.
URI:
type: string
pattern: '^[0-9a-fA-F]+$'
maxLength: 512
description: |
Arbitrary additional data about the credential, such as the URL where users can look up an associated Verifiable Credential document.
If present, the minimum length is 1 byte and the maximum is 256 bytes.
x-custom-validation:
validCredentialType:
field: CredentialType

CredentialCreateErrorCode:
$id: CredentialCreateErrorCode
Expand Down
3 changes: 3 additions & 0 deletions shared/transactions/credential_delete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ components:
properties:
CredentialType:
type: string
pattern: '^[0-9a-fA-F]+$'
description: Arbitrary data defining the type of credential to delete. The minimum length is 1 byte and the maximum length is 256 bytes.
Subject:
type: string
Expand All @@ -25,6 +26,8 @@ components:
- fields:
- Subject
- Issuer
validCredentialType:
field: CredentialType

CredentialDeleteErrorCode:
$id: CredentialDeleteErrorCode
Expand Down

0 comments on commit 98acb8c

Please sign in to comment.