Skip to content

feat: add JSON schema for fixture definitions - #66

Merged
BryanFRD merged 1 commit into
mainfrom
feat/json-schema
Apr 8, 2026
Merged

BryanFRD merged 1 commit into
mainfrom
feat/json-schema

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add schema/fixture.schema.json with full JSON Schema (draft 2020-12) for fixture definition files
  • Covers all fields: meta, config, packages, commits, tags, branches, hooks, generate, expect
  • Uses $defs/commit for shared commit structure between top-level and branch commits
  • Update README to show $schema usage in example and add schema dir to directory tree

Closes #58

Copilot AI review requested due to automatic review settings April 8, 2026 12:52
@BryanFRD
BryanFRD merged commit 87ea298 into main Apr 8, 2026
3 checks passed
@BryanFRD
BryanFRD deleted the feat/json-schema branch April 8, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 $schema usage 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.

Comment on lines +21 to +25
"type": "string",
"description": "Unique identifier for this fixture (used as directory name)."
},
"description": {
"type": "string",

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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,

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +48
"enum": ["json", "toml", "json5"],
"default": "json",
"description": "Config file format. Determines the default filename if 'filename' is not set."

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"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."

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add JSON schema for fixture definitions

2 participants