Skip to content

Commit

Permalink
Merge pull request #367 from Concordium/attribute-schema-fix
Browse files Browse the repository at this point in the history
Update schema validation for credential schema
  • Loading branch information
orhoj authored Aug 31, 2023
2 parents 3c133c1 + 96d4aa3 commit fc34721
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/browser-wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion packages/browser-wallet/src/shared/storage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,12 @@ export type TimestampProperty = {
};

type CredentialSchemaAttributes = {
title?: string;
description?: string;
type: 'object';
properties: Record<string, CredentialSchemaProperty | TimestampProperty>;
required: string[];
} & CredentialSchemaProperty;
};

interface CredentialSchemaSubject {
type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,6 @@ const verifiableCredentialSchemaSchema = {
description: {
type: 'string',
},
format: {
type: 'string',
},
properties: {
additionalProperties: {
anyOf: [
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit fc34721

Please sign in to comment.