diff --git a/packages/browser-wallet/CHANGELOG.md b/packages/browser-wallet/CHANGELOG.md index b72c5700..d1505b5b 100644 --- a/packages/browser-wallet/CHANGELOG.md +++ b/packages/browser-wallet/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Changed + +- Adjusted the schema validation for credential schemas to no longer require title and description. The type is now required to be 'object'. + ### Fixed - An issue where changing the credential metadata URL to an invalid URL, or a URL that does not contain a credential metadata file, would result in an empty screen. diff --git a/packages/browser-wallet/src/shared/storage/types.ts b/packages/browser-wallet/src/shared/storage/types.ts index 10241c4e..763d29dc 100644 --- a/packages/browser-wallet/src/shared/storage/types.ts +++ b/packages/browser-wallet/src/shared/storage/types.ts @@ -319,9 +319,12 @@ export type TimestampProperty = { }; type CredentialSchemaAttributes = { + title?: string; + description?: string; + type: 'object'; properties: Record; required: string[]; -} & CredentialSchemaProperty; +}; interface CredentialSchemaSubject { type: string; diff --git a/packages/browser-wallet/src/shared/utils/verifiable-credential-helpers.ts b/packages/browser-wallet/src/shared/utils/verifiable-credential-helpers.ts index 61a0146b..aea28bb6 100644 --- a/packages/browser-wallet/src/shared/utils/verifiable-credential-helpers.ts +++ b/packages/browser-wallet/src/shared/utils/verifiable-credential-helpers.ts @@ -377,9 +377,6 @@ const verifiableCredentialSchemaSchema = { description: { type: 'string', }, - format: { - type: 'string', - }, properties: { additionalProperties: { anyOf: [ @@ -419,10 +416,11 @@ const verifiableCredentialSchemaSchema = { type: 'string', }, type: { + const: 'object', type: 'string', }, }, - required: ['description', 'properties', 'required', 'title', 'type'], + required: ['type', 'properties', 'required'], type: 'object', }, id: {