Skip to content
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

Minimal schema on formbuilder json #1026

Open
settysreekanth opened this issue Oct 26, 2023 · 1 comment
Open

Minimal schema on formbuilder json #1026

settysreekanth opened this issue Oct 26, 2023 · 1 comment
Labels

Comments

@settysreekanth
Copy link

settysreekanth commented Oct 26, 2023

we are using form-builder in our project and we are passing below form schema to the builder as input property however the JSON gets updated with all the default values in the json preview. How to get the minimal schema without default values?

Input form schema:

{
	"components": [
		{
			"label": "Text Field",
			"applyMaskOn": "change",
			"tableView": true,
			"key": "textField",
			"type": "textfield",
			"input": true
		},
		{
			"type": "button",
			"label": "Submit",
			"key": "submit",
			"disableOnInvalid": true,
			"input": true,
			"tableView": false
		}
	]
}

Updated Schema which includes all default values:

{
  "components": [
    {
      "label": "Text Field",
      "applyMaskOn": "change",
      "tableView": true,
      "key": "textField",
      "type": "textfield",
      "input": true,
      "id": "e46q82x",
      "placeholder": "",
      "prefix": "",
      "customClass": "",
      "suffix": "",
      "multiple": false,
      "defaultValue": null,
      "protected": false,
      "unique": false,
      "persistent": true,
      "hidden": false,
      "clearOnHide": true,
      "refreshOn": "",
      "redrawOn": "",
      "modalEdit": false,
      "dataGridLabel": false,
      "labelPosition": "top",
      "description": "",
      "errorLabel": "",
      "tooltip": "",
      "hideLabel": false,
      "tabindex": "",
      "disabled": false,
      "autofocus": false,
      "dbIndex": false,
      "customDefaultValue": "",
      "calculateValue": "",
      "calculateServer": false,
      "widget": {
        "type": "input"
      },
      "attributes": {},
      "validateOn": "change",
      "validate": {
        "required": false,
        "custom": "",
        "customPrivate": false,
        "strictDateValidation": false,
        "multiple": false,
        "unique": false,
        "minLength": "",
        "maxLength": "",
        "pattern": ""
      },
      "conditional": {
        "show": null,
        "when": null,
        "eq": ""
      },
      "overlay": {
        "style": "",
        "left": "",
        "top": "",
        "width": "",
        "height": ""
      },
      "allowCalculateOverride": false,
      "encrypted": false,
      "showCharCount": false,
      "showWordCount": false,
      "properties": {},
      "allowMultipleMasks": false,
      "addons": [],
      "mask": false,
      "inputType": "text",
      "inputFormat": "plain",
      "inputMask": "",
      "displayMask": "",
      "spellcheck": true,
      "truncateMultipleSpaces": false
    },
    {
      "type": "button",
      "label": "Submit",
      "key": "submit",
      "disableOnInvalid": true,
      "input": true,
      "tableView": false,
      "id": "ehenmjg",
      "placeholder": "",
      "prefix": "",
      "customClass": "",
      "suffix": "",
      "multiple": false,
      "defaultValue": null,
      "protected": false,
      "unique": false,
      "persistent": false,
      "hidden": false,
      "clearOnHide": true,
      "refreshOn": "",
      "redrawOn": "",
      "modalEdit": false,
      "dataGridLabel": true,
      "labelPosition": "top",
      "description": "",
      "errorLabel": "",
      "tooltip": "",
      "hideLabel": false,
      "tabindex": "",
      "disabled": false,
      "autofocus": false,
      "dbIndex": false,
      "customDefaultValue": "",
      "calculateValue": "",
      "calculateServer": false,
      "widget": {
        "type": "input"
      },
      "attributes": {},
      "validateOn": "change",
      "validate": {
        "required": false,
        "custom": "",
        "customPrivate": false,
        "strictDateValidation": false,
        "multiple": false,
        "unique": false
      },
      "conditional": {
        "show": null,
        "when": null,
        "eq": ""
      },
      "overlay": {
        "style": "",
        "left": "",
        "top": "",
        "width": "",
        "height": ""
      },
      "allowCalculateOverride": false,
      "encrypted": false,
      "showCharCount": false,
      "showWordCount": false,
      "properties": {},
      "allowMultipleMasks": false,
      "addons": [],
      "size": "md",
      "leftIcon": "",
      "rightIcon": "",
      "block": false,
      "action": "submit",
      "theme": "primary"
    }
  ]
}
@ZenMasterJacob20011
Copy link
Contributor

@settysreekanth Could you please provide how you are getting the JSON under the "Updated Schema which includes all default values:" section of your question? We do provide a "Edit JSON" button when hovering over individual components that can be clicked to show the JSON of a components. Inside this Edit JSON modal we have a checkbox that can display the full schema which can be toggled on or off. Providing a jsfiddle or code sandbox can help me better understand your issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants