Fix: SchemasInputDescriptorFilter: broken deserialization renders generated clients unusable #1894
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What’s wrong?
The OpenAPI spec requires an Input Descriptor’s
schema
property to contain aSchemasInputDescriptorFilter
object.However, on deserialization, there is a preprocessing step which ensures that lists of URIs or a dict containing a
oneof_filter
property are accepted as well by transforming them into said object. (These alternative input formats are also included as examples in theInputDescriptors
model.) Yet, input that already IS aSchemasInputDescriptorFilter
object is not handled correctly during preprocessing and deserialization fails. This results in any client adhering to the spec being unable to create valid input descriptors and, ultimately, a presentation definition to use in a DIF proof request.What has been changed?
I adjusted the preprocessing step such that input is forwarded as-is if it looks like a
SchemasInputDescriptorFilter
. I also extended the tests to cover deserializing the actual object.