SchemaToCode
NGX-SCHEMA-TO-CODE

Group allow us to group multiple properties into one object and send data to api as object of properties. You cannot use 'array' dataType or 'group' inputType child properties. Also you cannot use 'multiple' metadata for any property including 'select', 'file', 'image'. It doesn't allow nesting.

Group / Object Array

"address": {
  "dataType": "group",        // if you change dataType to array it will create array of groups.
  "inputeType": "group",
  "proeprties": {
    "street": {
      "dataType": "string",
      "inputeType": "text",
      "validation": {
        "required": true
      }
    },
    "area": {
      "dataType": "string",
      "inputeType": "text",
      "validation": {
        "required": true
      }
    },
    "city": {
      "dataType": "string",
      "inputeType": "text",
      "validation": {
              "required": true
      }
    }
    "pinCode": {
      "dataType": "number",
      "inputeType": "number",
      "validation": {
        "required": true,
        "pattern": "^[1-9]{1}[0-9]{5}$"
      }
    }
  }
}

Json request / response object

"address": 
  { 
    "street": "JM Road", 
    "area": "Shivaji Nagar", 
    "city": "Pune",
    "pinCode": 411005
  }
]

Related Topics:

validation