Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field.Filter does not require type but Filter type in PEX requires it #159

Open
jiyoonie9 opened this issue May 3, 2024 · 0 comments
Open

Comments

@jiyoonie9
Copy link

jiyoonie9 commented May 3, 2024

I'm submitting a ...
[x] bug report
[x] release request
[ ] question about the decisions made in the repository
[ ] question about how to use this project

Summary

Thanks for building this library! We are using it to select credentials and I ran across a small issue while writing tests against test vectors.

In one of my test vectors, I have a Input Descriptor whose filter is a const requiring a specific string. Not having type inside filter object seems to cause a type error, but filter should behave like a JSON schema, and JSON schema does not require type.

          "input_descriptors": [
            {
              "id": "7b928839-f0b1-4237-893d-b27124b57952",
              "constraints": {
                "fields": [
                  {
                    "path": [
                      "$.vc.credentialSubject.name",
                      "$.credentialSubject.name"
                    ],
                    "filter": {
                      "const": "Satoshi Tacomoto"
                    }
                  }
                ]
              }
            }
          ]

When I take the filter object and put it in a JSON Schema validator, the object with just the const key should be a valid JSON schema.
image
Link to validator

It appears type is nullable in the latest version of fieldV2 in this repo, but the latest pex-model released (v2.2.4) does not reflect this change

All that to say - would you be able to release a new version of @sphereon/pex-model so that we can have a nullable type field in filterV2 type?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant