mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
c226c4bbbf
This commit adds comprehensive validation for all book introduction files in data/books/ using Pydantic models and JSON Schema. Changes: - Added BookIntroduction Pydantic model with nested models: - OutlineSection: Validates book outline sections - KeyTheme: Validates key themes with descriptions - KeyVerse: Validates key verses with references and text - Added validate_all_books() function to validate all 66 book files - Added validate_book_file() helper function - Added --books CLI flag to validate book files separately - Generated book_introduction.schema.json JSON Schema file - Fixed KeyVerse model field name from 'verse' to 'reference' - Added 4 new tests to validate book directory and all 66 books All 66 book files now validate successfully against the schema. Test suite updated: 268 tests passing (added 4 book validation tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
175 lines
3.5 KiB
JSON
175 lines
3.5 KiB
JSON
{
|
|
"$defs": {
|
|
"KeyTheme": {
|
|
"description": "Schema for book key theme",
|
|
"properties": {
|
|
"theme": {
|
|
"minLength": 1,
|
|
"title": "Theme",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"minLength": 1,
|
|
"title": "Description",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"theme",
|
|
"description"
|
|
],
|
|
"title": "KeyTheme",
|
|
"type": "object"
|
|
},
|
|
"KeyVerse": {
|
|
"description": "Schema for book key verse",
|
|
"properties": {
|
|
"reference": {
|
|
"minLength": 1,
|
|
"title": "Reference",
|
|
"type": "string"
|
|
},
|
|
"text": {
|
|
"minLength": 1,
|
|
"title": "Text",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"reference",
|
|
"text"
|
|
],
|
|
"title": "KeyVerse",
|
|
"type": "object"
|
|
},
|
|
"OutlineSection": {
|
|
"description": "Schema for book outline section",
|
|
"properties": {
|
|
"section": {
|
|
"minLength": 1,
|
|
"title": "Section",
|
|
"type": "string"
|
|
},
|
|
"chapters": {
|
|
"minLength": 1,
|
|
"title": "Chapters",
|
|
"type": "string"
|
|
},
|
|
"description": {
|
|
"minLength": 1,
|
|
"title": "Description",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"section",
|
|
"chapters",
|
|
"description"
|
|
],
|
|
"title": "OutlineSection",
|
|
"type": "object"
|
|
}
|
|
},
|
|
"description": "Schema for individual book introduction file",
|
|
"properties": {
|
|
"name": {
|
|
"minLength": 1,
|
|
"title": "Name",
|
|
"type": "string"
|
|
},
|
|
"abbreviation": {
|
|
"minLength": 1,
|
|
"title": "Abbreviation",
|
|
"type": "string"
|
|
},
|
|
"testament": {
|
|
"pattern": "^(Old Testament|New Testament)$",
|
|
"title": "Testament",
|
|
"type": "string"
|
|
},
|
|
"position": {
|
|
"maximum": 66,
|
|
"minimum": 1,
|
|
"title": "Position",
|
|
"type": "integer"
|
|
},
|
|
"chapters": {
|
|
"minimum": 1,
|
|
"title": "Chapters",
|
|
"type": "integer"
|
|
},
|
|
"category": {
|
|
"minLength": 1,
|
|
"title": "Category",
|
|
"type": "string"
|
|
},
|
|
"author": {
|
|
"minLength": 1,
|
|
"title": "Author",
|
|
"type": "string"
|
|
},
|
|
"date_written": {
|
|
"minLength": 1,
|
|
"title": "Date Written",
|
|
"type": "string"
|
|
},
|
|
"introduction": {
|
|
"minLength": 1,
|
|
"title": "Introduction",
|
|
"type": "string"
|
|
},
|
|
"outline": {
|
|
"items": {
|
|
"$ref": "#/$defs/OutlineSection"
|
|
},
|
|
"minItems": 1,
|
|
"title": "Outline",
|
|
"type": "array"
|
|
},
|
|
"key_themes": {
|
|
"items": {
|
|
"$ref": "#/$defs/KeyTheme"
|
|
},
|
|
"minItems": 1,
|
|
"title": "Key Themes",
|
|
"type": "array"
|
|
},
|
|
"key_verses": {
|
|
"items": {
|
|
"$ref": "#/$defs/KeyVerse"
|
|
},
|
|
"minItems": 1,
|
|
"title": "Key Verses",
|
|
"type": "array"
|
|
},
|
|
"christ_in_book": {
|
|
"anyOf": [
|
|
{
|
|
"type": "string"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"title": "Christ In Book"
|
|
}
|
|
},
|
|
"required": [
|
|
"name",
|
|
"abbreviation",
|
|
"testament",
|
|
"position",
|
|
"chapters",
|
|
"category",
|
|
"author",
|
|
"date_written",
|
|
"introduction",
|
|
"outline",
|
|
"key_themes",
|
|
"key_verses"
|
|
],
|
|
"title": "Schema for individual book introduction files",
|
|
"type": "object",
|
|
"$id": "https://kjvstudy.org/schemas/book_introduction.schema.json"
|
|
} |