Skip to content

Commit

Permalink
fix: remove strict w3c subjectId uri validation (openwallet-foundatio…
Browse files Browse the repository at this point in the history
…n#1805)

Signed-off-by: Martin Auer <martin.auer97@gmail.com>
  • Loading branch information
auer-martin committed Mar 28, 2024
1 parent 9fb6ae0 commit 65f7611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class W3cCredentialSubject {
}
}

@IsUri()
@IsOptional()
public id?: string

Expand Down Expand Up @@ -70,12 +69,11 @@ export function IsW3cCredentialSubject(validationOptions?: ValidationOptions): P
name: 'IsW3cCredentialSubject',
validator: {
validate: (value): boolean => {
return isInstance(value, W3cCredentialSubject) && (!value.id || isUri(value.id))
return isInstance(value, W3cCredentialSubject)
},
defaultMessage: buildMessage(
(eachPrefix) =>
eachPrefix +
'$property must be an object or an array of objects with an optional id property which is an URI',
eachPrefix + '$property must be an object or an array of objects with an optional id property',
validationOptions
),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('W3cCredential', () => {
},
W3cCredential
)
).toThrow()
).not.toThrow()

expect(() =>
JsonTransformer.fromJSON(
Expand Down

0 comments on commit 65f7611

Please sign in to comment.