Skip to content

Commit

Permalink
Allow short-hand preset definition
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Mar 24, 2022
1 parent 7850e53 commit 8a8b54e
Showing 1 changed file with 38 additions and 31 deletions.
69 changes: 38 additions & 31 deletions schema/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,43 +338,50 @@
"preset": {
"title": "Input preset",
"description": "Input presets allow for a field to be automatically filled in with the data of another field, optionally modifying the value to match a requested format.",
"type": "object",
"required": ["field", "type"],
"properties": {
"field": {
"title": "Preset field",
"description": "Defines the field that will be used to pre-fill this field.",
"oneOf": [
{
"type": "string"
},
"type": {
"title": "Preset conversion type",
"description": "Defines the conversion type that will be applied to the copied value",
"type": "string",
"oneOf": [
{
"$ref": "./fields/preset-type/exact.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/slug.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/url.json#/definitions/value"
{
"type": "object",
"required": ["field", "type"],
"properties": {
"field": {
"title": "Preset field",
"description": "Defines the field that will be used to pre-fill this field.",
"type": "string"
},
{
"$ref": "./fields/preset-type/camel.json#/definitions/value"
"type": {
"title": "Preset conversion type",
"description": "Defines the conversion type that will be applied to the copied value",
"type": "string",
"oneOf": [
{
"$ref": "./fields/preset-type/exact.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/slug.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/url.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/camel.json#/definitions/value"
},
{
"$ref": "./fields/preset-type/file.json#/definitions/value"
}
],
"default": "slug"
},
{
"$ref": "./fields/preset-type/file.json#/definitions/value"
"prefixInput": {
"title": "Preset prefix",
"description": "Defines a custom prefix to add to the start of the value",
"type": "string"
}
],
"default": "slug"
},
"prefixInput": {
"title": "Preset prefix",
"description": "Defines a custom prefix to add to the start of the value",
"type": "string"
}
}
}
]
},
"required": {
"title": "Required field",
Expand Down

0 comments on commit 8a8b54e

Please sign in to comment.