open fun json(jsonContent: String): ResultMatcher
Parse the expected and actual strings as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting with a lenient checking (extensible, and non-strict array ordering).
jsonContent - the expected JSON content
Since
4.1
open fun json(jsonContent: String, strict: Boolean): ResultMatcher
Parse the response content and the given string as JSON and assert the two are "similar" - i.e. they contain the same attribute-value pairs regardless of formatting.
Can compare in two modes, depending on strict parameter value:
true: strict checking. Not extensible, and strict array ordering.false: lenient checking. Extensible, and non-strict array ordering.Use of this matcher requires the JSONassert library.
jsonContent - the expected JSON content
strict - enables strict checking
Since
4.2