open-contracting / lib-cove-ocds

A data review library for the Open Contracting Data Standard (OCDS)
Other
0 stars 0 forks source link

Try substituting jsonschema-rs for jsonschema #123

Open jpmckinney opened 1 month ago

jpmckinney commented 1 month ago

https://github.com/Stranger6667/jsonschema-rs/tree/master/crates/jsonschema-py is designed to be API-compatible with jsonschema.

If it is truly impossible to switch to jsonschema-rs, I can try using Scalene to find performance improvements in jsonschema.

jpmckinney commented 1 month ago

jsonschema 4.22.0 has the promising changelog entry:

Improve best_match (and thereby error messages from jsonschema.validate) in cases where there are multiple sibling errors from applying anyOf / allOf -- i.e. when multiple elements of a JSON array have errors, we now do prefer showing errors from earlier elements rather than simply showing an error for the full array (#1250).

However, these are still not as friendly as we currently make them. That is, jsonschema errors still look like "is not valid under any of the given schemas" instead of "'date' is missing but required within 'releases'"