Open jrhender opened 2 months ago
The VC data model (both v1.1 and v2.0) allow the verifiableCredential property on a VerifiablePresentation to be optional. There are cases where it may not be present, such as an authentication VP. However, the current Credo code expects that it exists as an instance or an array: https://github.com/openwallet-foundation/credo-ts/blob/855d4ab04de317dab0f0e2a31fee6ba44750537f/packages/core/src/modules/vc/models/presentation/W3cPresentation.ts#L59-L62
verifiableCredential
authentication
As a first attempt, I think simply adding the @IsOptional decorator to the property may be sufficient to resolve this issue.
@IsOptional
The VC data model (both v1.1 and v2.0) allow the
verifiableCredential
property on a VerifiablePresentation to be optional. There are cases where it may not be present, such as anauthentication
VP. However, the current Credo code expects that it exists as an instance or an array: https://github.com/openwallet-foundation/credo-ts/blob/855d4ab04de317dab0f0e2a31fee6ba44750537f/packages/core/src/modules/vc/models/presentation/W3cPresentation.ts#L59-L62As a first attempt, I think simply adding the
@IsOptional
decorator to the property may be sufficient to resolve this issue.