Skip to content

Draft: Use pydantic to generate Catalog schema

Pierre Dittgen requested to merge use_pydantic into master

Pydantic model is defined in model.py file.

To generate jsonschema from pydantic model, use:

python model.py > schema.json

Differences from original hand-written jsonschema:

  • all fields get a default title property, automatically generated from field name
  • url fields get extra "minLength": 1 and "maxLength": 2083 properties
  • enum fields don't have inline values but refer to an external definition
  • Schema definition has been removed, its fields are duplicated in GitSchema and URLSchema definitions

Merge request reports