Skip to content

Commit

Permalink
update form elements
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 3, 2024
1 parent f0762fd commit fb2a46a
Showing 1 changed file with 41 additions and 46 deletions.
87 changes: 41 additions & 46 deletions spec/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,27 @@
"properties": {
"element": {
"type": "array",
"items": {
"oneOf": [
{
"$ref": "Form_Element_Input"
},
{
"$ref": "Form_Element_Select"
},
{
"$ref": "Form_Element_Tag"
},
{
"$ref": "Form_Element_TextArea"
}
],
"discriminator": {
"propertyName": "element",
"mapping": {
"http://fusio-project.org/ns/2015/form/input": "Form_Element_Input",
"http://fusio-project.org/ns/2015/form/select": "Form_Element_Select",
"http://fusio-project.org/ns/2015/form/tag": "Form_Element_Tag",
"http://fusio-project.org/ns/2015/form/textarea": "Form_Element_TextArea"
}
}
"schema": {
"type": "reference",
"target": "Form_Element"
}
}
}
},
"Form_Element": {
"type": "object",
"base": true,
"discriminator": "type",
"mapping": {
"Form_Element_Input": "http://fusio-project.org/ns/2015/form/input",
"Form_Element_Select": "http://fusio-project.org/ns/2015/form/select",
"Form_Element_Tag": "http://fusio-project.org/ns/2015/form/tag",
"Form_Element_TextArea": "http://fusio-project.org/ns/2015/form/textarea"
},
"properties": {
"type": {
"type": "string"
},
"element": {
"type": "string"
},
Expand All @@ -91,16 +81,29 @@
}
},
"Form_Element_Input": {
"$extends": "Form_Element",
"type": "object",
"type": "struct",
"parent": {
"type": "reference",
"target": "Form_Element"
}
},
"Form_Element_Select": {
"type": "struct",
"parent": {
"type": "reference",
"target": "Form_Element"
},
"properties": {
"type": {
"type": "string"
"options": {
"type": "array",
"items": {
"$ref": "Form_Element_Select_Option"
}
}
}
},
"Form_Element_Select_Option": {
"type": "object",
"type": "struct",
"properties": {
"key": {
"type": "string"
Expand All @@ -110,27 +113,19 @@
}
}
},
"Form_Element_Select": {
"$extends": "Form_Element",
"type": "object",
"properties": {
"options": {
"type": "array",
"items": {
"$ref": "Form_Element_Select_Option"
}
}
}
},
"Form_Element_Tag": {
"$extends": "Form_Element",
"type": "object",
"properties": {
"type": "struct",
"parent": {
"type": "reference",
"target": "Form_Element"
}
},
"Form_Element_TextArea": {
"$extends": "Form_Element",
"type": "object",
"type": "struct",
"parent": {
"type": "reference",
"target": "Form_Element"
},
"properties": {
"mode": {
"type": "string"
Expand Down

0 comments on commit fb2a46a

Please sign in to comment.