Forum Discussion

ttschapp's avatar
13 years ago

Request Editor shows incorrect JSON response

I'm running soapUI 4.0.1 (not Pro) and am using the Request Editor to make a REST call that returns a simple JSON structure.
After sending the request, the Raw tab shows this response (ignoring HTTP header):

{"SearchResult":[{"ClassURI":"CEP/ldm/class/CEP_DRAFT/BasicReport"},{"PrimaryKey":"ReportKey:def"}],
"SearchResult":[{"ClassURI":"CEP/ldm/class/CEP_DRAFT/BasicReport"},{"PrimaryKey":"ReportKey:xyz"}],
"SearchResult":[{"ClassURI":"CEP/ldm/class/CEP_DRAFT/BasicReport"},{"PrimaryKey":"ReportKey:45664"}]}


Clicking on the JSON tab shows:

{"SearchResult": [
{"ClassURI": "CEP/ldm/class/CEP_DRAFT/BasicReport"},
{"PrimaryKey": "ReportKey:def"},
[
{"ClassURI": "CEP/ldm/class/CEP_DRAFT/BasicReport"},
{"PrimaryKey": "ReportKey:xyz"}
],
[
{"ClassURI": "CEP/ldm/class/CEP_DRAFT/BasicReport"},
{"PrimaryKey": "ReportKey:45664"}
]
]}


These two tabs are reporting materially different results.
The "Raw" tab interprets this as a flat array of 3 elements - SearchResult["def", "xyz", "45664"].
The "JSON" tab shows this as an array within an array - SearchResult["def" [ "xyz", "45664"]] .

I'm new to JSON, so I may be misunderstanding something, but I ran both results through a JSON formatter (http://jsonformatter.curiousconcept.com/) and verified that the two tabs come up with different results.