Testing the JSON message against a definition
After the JSON definition is configured, use the JSON testing tool to check whether the definition is correct.
The testing tool can also be used to check whether the JSON message matches the definition.
Example data:
{
"Name": "Mike",
"ID": "12345",
"Contacts": [
{ "Type": "Home", "Address": "XXX", "Telephone": ["000","12345678"]},
{ "Type": "Work", "Address": "YYY", "Telephone": ["111","87654321"]}
],
"Details": {
"Sex": "Male",
"Age": 40
}
}
Parse result:
Name >Mike<
ID >12345<
Contacts(0).Type >Home<
Contacts(0).Address >XXX<
Contacts(0).Telephone(0) >000<
Contacts(0).Telephone(1) >12345678<
Contacts(1).Type >Work<
Contacts(1).Address >YYY<
Contacts(1).Telephone(0) >111<
Contacts(1).Telephone(1) >87654321<
Details.Sex >Male<
Details.Age >40<
Contacts
and
Telephone
are arrays, so they have an index number after
them to indicate the specific element in the JSON message.