Repository navigation
feat: add JSON schema for fixture definitions #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,240 @@ | ||||||||||||||
| { | ||||||||||||||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||||||||||||||
| "$id": "https://raw.githubusercontent.com/FerrFlow-Org/Fixtures/main/schema/fixture.schema.json", | ||||||||||||||
| "title": "FerrFlow Fixture Definition", | ||||||||||||||
| "description": "Declarative definition for generating a git fixture repository.", | ||||||||||||||
| "type": "object", | ||||||||||||||
| "required": ["meta"], | ||||||||||||||
| "additionalProperties": false, | ||||||||||||||
| "properties": { | ||||||||||||||
| "$schema": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "JSON Schema reference for editor support." | ||||||||||||||
| }, | ||||||||||||||
| "meta": { | ||||||||||||||
| "type": "object", | ||||||||||||||
| "description": "Metadata about this fixture.", | ||||||||||||||
| "required": ["name", "description"], | ||||||||||||||
| "additionalProperties": false, | ||||||||||||||
| "properties": { | ||||||||||||||
| "name": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Unique identifier for this fixture (used as directory name)." | ||||||||||||||
| }, | ||||||||||||||
| "description": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Human-readable description of the scenario. Copied into .expect.toml." | ||||||||||||||
| }, | ||||||||||||||
| "default_branch": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Default branch name for the generated repo. Defaults to git's init.defaultBranch." | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| }, | ||||||||||||||
| "config": { | ||||||||||||||
| "type": "object", | ||||||||||||||
| "description": "FerrFlow configuration file to place in the generated repo.", | ||||||||||||||
| "required": ["content"], | ||||||||||||||
| "additionalProperties": false, | ||||||||||||||
| "properties": { | ||||||||||||||
| "content": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "description": "Raw content of the config file." | ||||||||||||||
| }, | ||||||||||||||
| "format": { | ||||||||||||||
| "type": "string", | ||||||||||||||
| "enum": ["json", "toml", "json5"], | ||||||||||||||
| "default": "json", | ||||||||||||||
| "description": "Config file format. Determines the default filename if 'filename' is not set." | ||||||||||||||
|
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." | |
| "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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.nameandmeta.descriptionare validated as non-empty ingenerator/src/validate.rs(it errors on empty strings), but the schema currently allows empty strings. Consider addingminLength: 1to both fields so editor validation matches runtime validation.