Raja
Raja

Reputation: 249

IODocs : First Object inside Array Doesn't have a tag name

I want to add a objects inside a array. I have to set a name for that object like

    "identifiers": [
      "IDENTIFIER": {
        "primary": true
       }
     ]

Here "IDENTIFIER" is the object name. But the first object inside array always created as a empty object like

    "identifiers": [
       {
         "IDENTIFIER": {
             "primary": true
         }
       }
     ]

I used the following JSON code in config file,

    "identifiers": {
        "title": "Identifiers",
        "type": "array",
        "location": "body",
        "items": {
            "title": "Identifier Fields",
            "type": "object",
            "properties": {
                "IDENTIFIER": {
                    "type": "object",
                    "properties": {
                        "primary": {
                            "title": "primary",
                            "required": true,
                            "type": "boolean",
                            "description": "",
                            "default": true
                        }
                    }
                }
            }
        }
    }

How to achieve this. Kindly help me.

Note : I can able to do using Object inside Object. but I don't want that.

Thanks in advance.

Upvotes: 1

Views: 28

Answers (0)

Related Questions