-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add descriptions to JSON schema
- Loading branch information
Showing
2 changed files
with
38 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,90 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"title": "The Root Schema", | ||
"title": "Foggy Schema", | ||
"description": "A Foggy (https://github.com/worksome/foggy) configuration.", | ||
"required": [ | ||
"database" | ||
], | ||
"definitions": { | ||
"table": { | ||
"type": "object", | ||
"description": "A representation of how a table should be dumped.", | ||
"properties": { | ||
"withData" : { | ||
"type": "boolean" | ||
"type": "boolean", | ||
"description": "Whether the tables data should be included in the dump." | ||
}, | ||
"rules" : { | ||
"type": "array", | ||
"description": "A configuration rule for a column.", | ||
"items": { | ||
"$ref": "#/definitions/rule" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"withData" | ||
] | ||
], | ||
"additionalProperties": false | ||
}, | ||
"rule": { | ||
"type": "object", | ||
"description": "A representation of how a column should be dumped.", | ||
"properties": { | ||
"column": { | ||
"type": "string" | ||
"type": "string", | ||
"description": "The name of the column." | ||
}, | ||
"type": { | ||
"enum": [ | ||
"faker", | ||
"php", | ||
"replace" | ||
] | ||
"$ref": "#/definitions/ruleType", | ||
"description": "The type of rule that should be used." | ||
}, | ||
"value": { | ||
"type": "string" | ||
"type": "string", | ||
"description": "The value that should be used for the column." | ||
}, | ||
"condition": { | ||
"type": "string" | ||
"type": "string", | ||
"description": "The conditional rule that has to pass before the rule is applied." | ||
}, | ||
"times": { | ||
"type": "integer" | ||
"type": "integer", | ||
"description": "The number of times the rule is allowed to be applied." | ||
}, | ||
"params": { | ||
"type": "string" | ||
"type": "string", | ||
"description": "A list of static pipe-separated (|) parameters to pass to the rule." | ||
} | ||
}, | ||
"required": [ | ||
"column", | ||
"type", | ||
"value" | ||
], | ||
"additionalProperties": false | ||
}, | ||
"ruleType": { | ||
"type": "string", | ||
"enum": [ | ||
"faker", | ||
"php", | ||
"replace" | ||
] | ||
} | ||
}, | ||
"properties": { | ||
"database": { | ||
"$id": "#/properties/database", | ||
"type": "object", | ||
"title": "Holds all information of how the database should be dumped", | ||
"title": "Database configuration", | ||
"description": "A representation of how the database should be dumped.", | ||
"patternProperties": { | ||
"^.*$": { | ||
"$ref": "#/definitions/table" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |