Hi ,
I have json file like below
here name, age, add , out , result are mandatory keys .. and nextfield and nextfield1 are optional keys have to do validation for these , like chk the mandatory keys present in input file , if not present should throw exeption mandatory keys not present, same like optional .. also have to validate the values of mandatory keys
suppose if i check the type of name (mandatory keys) should print the type of value. likewise i have to do validation of nextfield and nextfield1 , if req key is "Y" then it will go this field n chk if req : N it will throw error msg ,
kindly suggest how i can achieve this ?
I have json file like below
{ "fieldname" :{ "name" :"str", "age" : 13 "add" : "str" "out" :"Y", "result" :"Y", "nextfield" :{ "req" :"Y", "cfy" : "nan",}, "nextfield1": { "req" :"n", "source" :"n/a", "target" :"n/a"} }like there are many json file, jus 1 json im putting here.
here name, age, add , out , result are mandatory keys .. and nextfield and nextfield1 are optional keys have to do validation for these , like chk the mandatory keys present in input file , if not present should throw exeption mandatory keys not present, same like optional .. also have to validate the values of mandatory keys
suppose if i check the type of name (mandatory keys) should print the type of value. likewise i have to do validation of nextfield and nextfield1 , if req key is "Y" then it will go this field n chk if req : N it will throw error msg ,
kindly suggest how i can achieve this ?