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

[question] Schema is not generatin proper #58

Closed
uttamsolanki opened this issue Sep 2, 2021 · 1 comment
Closed

[question] Schema is not generatin proper #58

uttamsolanki opened this issue Sep 2, 2021 · 1 comment
Labels

Comments

@uttamsolanki
Copy link

Hello Devs,
I am using vue-formio library, now I want to get the schema for a form that I have a design in form builder but I am getting a large object instead of a schema object

For code or form JSON, please enclose in a code block:
schema which i am getting

{
    "label": "Text Field",
    "labelPosition": "top",
    "placeholder": "",
    "description": "",
    "tooltip": "",
    "prefix": "",
    "suffix": "",
    "widget": {
        "type": "input"
    },
    "inputMask": "",
    "allowMultipleMasks": false,
    "customClass": "",
    "tabindex": "",
    "autocomplete": "",
    "hidden": false,
    "hideLabel": false,
    "showWordCount": false,
    "showCharCount": false,
    "mask": false,
    "autofocus": false,
    "spellcheck": true,
    "disabled": false,
    "tableView": true,
    "modalEdit": false,
    "multiple": false,
    "persistent": true,
    "inputFormat": "plain",
    "protected": false,
    "dbIndex": false,
    "case": "",
    "encrypted": false,
    "redrawOn": "",
    "clearOnHide": true,
    "customDefaultValue": "",
    "calculateValue": "",
    "calculateServer": false,
    "allowCalculateOverride": false,
    "validateOn": "change",
    "validate": {
        "required": false,
        "pattern": "",
        "customMessage": "",
        "custom": "",
        "customPrivate": false,
        "json": "",
        "minLength": "",
        "maxLength": "",
        "strictDateValidation": false,
        "multiple": false,
        "unique": false
    },
    "unique": false,
    "errorLabel": "",
    "key": "textField",
    "tags": [],
    "properties": {},
    "conditional": {
        "show": null,
        "when": null,
        "eq": "",
        "json": ""
    },
    "customConditional": "",
    "logic": [],
    "attributes": {},
    "overlay": {
        "style": "",
        "page": "",
        "left": "",
        "top": "",
        "width": "",
        "height": ""
    },
    "type": "textfield",
    "input": true,
    "refreshOn": "",
    "dataGridLabel": false,
    "inputType": "text",
    "id": "ev6786",
    "defaultValue": null
}

But I want to like this

 {
      "label": "Text Field",
      "tableView": true,
      "key": "textField",
      "type": "textfield",
      "input": true
  }

My code is to get schema

      methods:{
        saveComponent(){
          console.log(JSON.parse(JSON.stringify(this.$refs['formio-form'].builder.form)))
        }
}

Template code

  <div id="app">
  <div>
    <FormBuilder ref="formio-form"  v-bind:form="{display: 'from',components:component}" v-bind:options="" v-on:change="jsonSchema" v-on:saveComponent="saveComponent"></FormBuilder>
  </div>
  </div></template>```
@brendanbond
Copy link
Contributor

Hi @uttamsolanki, that is the full schema of the component as expected. The form.io builder should be able to provide a truncated schema via builder.instance.schema

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