Forum Discussion
3 Replies
- richieCommunity Hero
Hey varnikha
Can you provide the actual .json from the response? - I believe you're getting the warning because the .json parser in ReadyAPI! seems to think you've got malformed .json
$id : 12345 // is considered malformed .json (i.e. not well formed)
you can't just have an id attribute on it's own without being wrapped within an object (e.g. curly braces { }) or array (e.g. square brackets [ ]) - especially as it appears from the screenshot 'id' is at the root level of your .json.
also - you're $id in the screenshot isn't wrapped with single quotes and the square bracket notation for representing .json (JSONPATH) requires single quote marks.
I don't know what your .json looks like - but if I add in a content match assertion on an attribute that is at the root level of my response - it appears in the JSONPath Expression field is $['id']
Looks like SoapUI is a little less fussy than ReadyAPI!- but thats to be expected!
I ithink the only way to sort is to recreate your assertion - then you won't have this issue
Hope this helps!
cheers
rich
- richieCommunity Hero
Hi varnikha
I can't see a way around this other than to recreate the assertion in ReadyAPI! that works in SoapUI but doesnt in ReadyAPI!
Essentially if you click on the id attribute and select the 'Assert' >> 'Content' - you will generate your JSONPath Match Assertion form. The bit in the JSONPath Expression field is the problem.
Currently the assertion is displaying $id in the JSONPath Expression field - but it needs to display $['id']
If I create an assertion on an attribute that is at the root of an equivalent .json response I have - it generates $['id']
If I delete the square brackets and quote marks so it reads $id - then I generate the 'InvalidPathException:Illegal character at position 1 expected '.' or [' error response
As I say above - I cant see a way around this except to recreate the assertion on the 'id' attribute (and delete the existing failing assertion) in ReadyAPI! if you want it working in ReadyAPI!
Sorry I couldn't be more help - but that's the only way I see to get it running in ReadyAPI!
cheers,
rich