Skip to content

Validator failures: missing schema registration, incomplete examples, and structural gaps #346

Description

@jonathanrobie

Summary

Running npm test reveals several pre-existing failures that were never caught because the Node.js validator crashes before completing. This issue documents all of them so they can be fixed together.


1. Node.js validator crashes (MissingRefError)

code/validate.js loads schemas from schema/index.js, but alignment/alignment.schema.json is not registered there. Since type.schema.json references it via $ref, AJV throws:

MissingRefError: can't resolve reference alignment/alignment.schema.json
  from id https://burrito.bible/schema/type.schema.json

Fix: add require("./alignment/alignment.schema.json") to schema/index.js.


2. audioAlignment.json and audioTranslation.json missing idAuthorities

Both example files lack the idAuthorities field, which source_metadata.schema.json requires. audioAlignment.json was added in caad42c without it; audioTranslation.json also lacks it.

Fix: add an idAuthorities block to both example files.


3. textTranslation_derived.jsonrelationType: "parascriptural" has no schema case

The example contains:

{ "relationType": "parascriptural", "flavor": "alignment", "id": "agmt::irvmal-4-wh" }

relationship.schema.json defines a top-level oneOf with four cases: source, target, expression, and x- custom flavors. There is no case for relationType: "parascriptural" or "peripheral" with standard flavor names, even though both are valid relationType values in the properties enum.

Decision needed: add oneOf cases for parascriptural and peripheral, or change the example to use a valid combination.


4. wrapper.json validated against burrito metadata schema

The npm test glob docs/examples/artifacts/*.json includes wrapper.json, which is a Scripture Burrito Wrapper file ("format": "scripture burrito wrapper"), not a burrito metadata file. Because meta.category is absent, metadata.schema.json's if condition (meta.category == "source") is vacuously satisfied and the file is routed to source_metadata, where it fails languages required.

Fix options:

  • Exclude wrapper.json from the test glob, or
  • Add a format == "scripture burrito" guard at the top of metadata.schema.json

Notes

  • All four failures are pre-existing; none were introduced by recent schema changes.
  • The Node.js crash masks the Python failures when running npm test.
  • The Python validator (code/validate.py) surfaces failures 2–4 when run directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions