1

How can we convert this schema to the below one:

{
    "entityName": "Firm",
    "attributes": [
        {
            "name": "FirmKey",
            "rules": [
                {
                    "type": "primaryKey",
                    "severity": "reject",
                    "operator": "",
                    "value": "1"
                },
                {
                    "type": "dataType",
                    "severity": "reject",
                    "operator": "",
                    "dataType": "int"
                },
                {
                    "type": "notNull",
                    "severity": "reject",
                    "operator": ""
                }
            ]
        },
        {
            "key": "attributedcfd6d27",
            "name": "FirmName",
            "unit": "",
            "rules": [
                {
                    "type": "dataType",
                    "severity": "reject",
                    "operator": "",
                    "dataType": "string"
                }
            ],
        }
}

converted:

{
  "FirmKey":
  {
    "type": "list",
    "schema":
    {
      "isint":true,
      "isNull": NaN
    }
  },
  "FirmName":
  {
    "type": "list",
    "description": "Firm’s legal name",
    "schema":
    {
      "type":"string",
      "isNull": NaN
    }
  }
}
Ether
  • 53,118
  • 13
  • 86
  • 159
  • Convert using what rules? it's not clear what you mean. – Ether Oct 08 '21 at 00:34
  • @Ether I have a json file in which the 1st format is present. The attributes has 'name' and certain rules. But now I want them in other format as given in the second. 'name' :{rules}. – Harshit Pathak Oct 08 '21 at 07:43

0 Answers0