Closed David-Chadwick closed 2 months ago
As I understand it, the desire is to inspect every element of an array using a JSON Schema filter to test for presence of values.
If you assume the following target object:
{
"foo": ["bar", "biz"]
}
This would be the filter you would use to evaluate each element of the array to ensure at least one of a specified set of string values is present:
{
"path": ["$.foo"],
"filter": {
"type": "array",
"contains": {
"enum": ["bar", "zoo"]
}
}
}
Here's the docs for handling tuples with json schema https://json-schema.org/understanding-json-schema/reference/array.html#tuple-validation
Closing as complete, given the requested filter is supported and examples have been provided.
why was this closed complete? json schema validation for oid4vp example still fails, no?
I believe this was closed because json schema supports the requested filter. There's nothing PE specific about the json schema capabilities
Reopening per #480
this should be addressed by specifying Draft 7 here https://github.com/decentralized-identity/presentation-exchange/pull/481
closing this now, please re-open if this solution is insufficient
If a VC contains a property whose values are a set of strings, e.g.
foo = ["bar", "baz"]
then a presentation definition filter will need to specify one-of or any-of from the array of values e.g.
Unfortunately when the above PD has been entered into the OIDC4VP draft, there is a schema checking violation on the oneOf property (also anyOf gives a similar error). The authors of OIDC4VP feel that this is a problem with the PE specification, in that it is not precise enough about which schema validation rules (year, version) have to be used. Nor is there any indication of which tools exist in order to validate that any PD instance is a correct instance of the PE specification.