AnsweredAssumed Answered

How to define schema using Validate JSON Schema Assertion?

Question asked by Sathish2306 on Sep 21, 2015
Latest reply on Jan 25, 2016 by Nicolas Afonso

Hi,

 

Consider i have json like below,

 

{

    "a": "b",

    "c": "d",

    "e": {

        "f": "g",

        "h": "1234"

    },

    "qwerty": [

        {

            "love": "kind"

        },

        {

            "love": "kind1"

        }

    ],

    "asdf": [

        {

            "omega": "12345",

            "omega1": "2345"

        },

        {

            "beta": "f9",

            "beta1": "f10"

        }

    ],

   "arrayval": ["1","2"]

}

 

1. I want to make "e" as optional, if input has "e" and then i want to make  "h":"1234" as optional ?

2. Value "c" either can be integer/string ? how to provide this?

3. How to define this "qwerty" array of object in JSON Schema Assertion? (NOTE: The Array will contain same schema for n times..)

4. How to define this "asdf" array of object in JSON Schema Assertion? (NOTE: The Array will have different type of objects for n times..)

5. How to define the key "arrayval" in JSON Schema Assertion?

Outcomes