microbiomedata / nmdc-runtime

Runtime system for NMDC data management and orchestration
https://microbiomedata.github.io/nmdc-runtime/
Other
4 stars 3 forks source link

Replace hardcoded usages of `Draft7Validator` #461

Open pkalita-lbl opened 5 months ago

pkalita-lbl commented 5 months ago

There are a few places where the nmdc-schema JSON Schema artifact is provided to a Draft7Validator (from the jsonschema package). For example. Recently LinkML tooling started generating JSON Schema that is declared to be compatible with JSON Schema Draft 2019-09. We should switch over to using the jsonschema package's validator_for method which inspects the schema and returns the correct validator class.

pkalita-lbl commented 4 months ago

Oof this isn't as straightforward as I thought. Unfortunately we use not one but two different JSON Schema libraries in nmdc-runtime: the jsonschema package (like here) and the fastjsonschema package (like here).

Three options to move forward:

With no sensible option here I'm just putting this issue back in the backlog.

eecavanna commented 2 months ago

I created this analogous issue for the migration notebooks today (they, too, use Draft7Validator via jsonschema).

eecavanna commented 2 months ago

fastjsonschema was introduced as a dependency in this commit. I don't know when jsonschema was introduced as a dependency (it is not listed in the main.in file—I'll file a separate issue about that).

eecavanna commented 2 weeks ago

Here's a recent nmdc-schema PR that describes a scenario where fastjsonschema seemed to not tolerate something about our schema: https://github.com/microbiomedata/nmdc-schema/pull/2083