Skip to content

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

Open
@jiyoonie9

Description

@jiyoonie9

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions