Repository navigation
feat: add JSON schema for fixture definitions - #66
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a JSON Schema to formalize the fixture definition JSON format, enabling editor autocomplete/validation for consumers, and updates the README to document schema usage.
Changes:
- Added
schema/fixture.schema.json(JSON Schema draft 2020-12) describing fixture definition files. - Documented
$schemausage in the README example. - Updated the README directory tree to include the new
schema/directory.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| schema/fixture.schema.json | Introduces the JSON Schema for fixture definition JSON files. |
| README.md | Documents how to reference the schema and lists it in the repo structure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "type": "string", | ||
| "description": "Unique identifier for this fixture (used as directory name)." | ||
| }, | ||
| "description": { | ||
| "type": "string", |
There was a problem hiding this comment.
meta.name and meta.description are validated as non-empty in generator/src/validate.rs (it errors on empty strings), but the schema currently allows empty strings. Consider adding minLength: 1 to both fields so editor validation matches runtime validation.
| "type": "string", | |
| "description": "Unique identifier for this fixture (used as directory name)." | |
| }, | |
| "description": { | |
| "type": "string", | |
| "type": "string", | |
| "minLength": 1, | |
| "description": "Unique identifier for this fixture (used as directory name)." | |
| }, | |
| "description": { | |
| "type": "string", | |
| "minLength": 1, |
| "enum": ["json", "toml", "json5"], | ||
| "default": "json", | ||
| "description": "Config file format. Determines the default filename if 'filename' is not set." |
There was a problem hiding this comment.
config.format is restricted to json|toml|json5, but the generator code explicitly supports unknown formats by falling back to ferrflow.json (see resolve_unknown_format_falls_back_to_json test). With the current schema, definitions that work at runtime (e.g. format: "yaml") will be flagged invalid by editors. Consider removing the enum constraint and instead using examples/description to document the known values, or otherwise allow arbitrary strings.
| "enum": ["json", "toml", "json5"], | |
| "default": "json", | |
| "description": "Config file format. Determines the default filename if 'filename' is not set." | |
| "default": "json", | |
| "examples": ["json", "toml", "json5"], | |
| "description": "Config file format. Known values include 'json', 'toml', and 'json5'. Determines the default filename if 'filename' is not set. Unknown values are allowed and fall back to the default 'ferrflow.json' filename behavior." |
Summary
schema/fixture.schema.jsonwith full JSON Schema (draft 2020-12) for fixture definition files$defs/commitfor shared commit structure between top-level and branch commits$schemausage in example and add schema dir to directory treeCloses #58