When calling pexv2.SelectCredentials with 1 Input Descriptor that has multiple Fields, the function sometimes fails with a JSON schema error.
The cause is code that copies Input Descriptors to a JSONSchema object. As part of that, tokens are generated to uniquely identify each field. Sometimes the tokens are not unique because a system nano time is used for the token value.
Suggest we use a random number of hash instead of nano time.
failed to satisfy input descriptor constraints 1: error compiling schema: jsonschema file:///<redacted>/credential/1 compilation failed: '/required' does not validate with http://json-schema.org/draft-07/schema#/properties/required/$ref/uniqueItems: items at index 0 and 1 are equal
When calling
pexv2.SelectCredentials
with 1 Input Descriptor that has multiple Fields, the function sometimes fails with a JSON schema error.The cause is code that copies Input Descriptors to a JSONSchema object. As part of that, tokens are generated to uniquely identify each field. Sometimes the tokens are not unique because a system nano time is used for the token value.
Suggest we use a random number of hash instead of nano time.
Problem code:
Possible fix:
Error: