Files
kjvstudy.org/kjvstudy_org/data/schemas/study_guides.schema.json
T
kennethreitz 8a03d22b9a Add JSON schema validation with Pydantic
- Add Pydantic models for all 6 main data files:
  - bible_metadata.json
  - word_studies.json
  - study_guides.json
  - verse_commentary.json
  - featured_verses.json
  - resource_slugs.json

- Add BookIntroduction schema for book JSON files

- Create scripts/validate_data.py:
  - Validates JSON data using Pydantic models
  - Can generate JSON schemas from Pydantic models
  - CLI with --verbose and --generate-schemas flags

- Add test suite (tests/test_data_validation.py):
  - 12 tests validating data file structure
  - Parametrized tests for all data files
  - Integrated into existing test suite

All validation tests pass. JSON schemas auto-generated from Pydantic models.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 18:34:44 -05:00

125 lines
2.7 KiB
JSON

{
"$defs": {
"CatalogEntry": {
"description": "Schema for study guide catalog entry",
"properties": {
"title": {
"minLength": 1,
"title": "Title",
"type": "string"
},
"description": {
"minLength": 1,
"title": "Description",
"type": "string"
},
"slug": {
"pattern": "^[a-z-]+$",
"title": "Slug",
"type": "string"
},
"verses": {
"items": {
"type": "string"
},
"title": "Verses",
"type": "array"
}
},
"required": [
"title",
"description",
"slug",
"verses"
],
"title": "CatalogEntry",
"type": "object"
},
"GuideContent": {
"description": "Schema for study guide content",
"properties": {
"title": {
"minLength": 1,
"title": "Title",
"type": "string"
},
"description": {
"minLength": 1,
"title": "Description",
"type": "string"
},
"sections": {
"items": {
"$ref": "#/$defs/StudySection"
},
"minItems": 1,
"title": "Sections",
"type": "array"
}
},
"required": [
"title",
"description",
"sections"
],
"title": "GuideContent",
"type": "object"
},
"StudySection": {
"description": "Schema for study guide section",
"properties": {
"title": {
"minLength": 1,
"title": "Title",
"type": "string"
},
"verses": {
"items": {
"type": "string"
},
"title": "Verses",
"type": "array"
},
"content": {
"minLength": 1,
"title": "Content",
"type": "string"
}
},
"required": [
"title",
"verses",
"content"
],
"title": "StudySection",
"type": "object"
}
},
"description": "Schema for study_guides.json",
"properties": {
"catalog": {
"additionalProperties": {
"items": {
"$ref": "#/$defs/CatalogEntry"
},
"type": "array"
},
"title": "Catalog",
"type": "object"
},
"content": {
"additionalProperties": {
"$ref": "#/$defs/GuideContent"
},
"title": "Content",
"type": "object"
}
},
"required": [
"catalog",
"content"
],
"title": "Schema for study_guides.json",
"type": "object",
"$id": "https://kjvstudy.org/schemas/study_guides.schema.json"
}