Package org.mockserver.codec
Class JsonSchemaBodyDecoder
java.lang.Object
org.mockserver.codec.JsonSchemaBodyDecoder
-
Constructor Summary
ConstructorsConstructorDescriptionJsonSchemaBodyDecoder(Configuration configuration, MockServerLogger mockServerLogger, Expectation expectation, HttpRequest httpRequest) -
Method Summary
Modifier and TypeMethodDescriptionconvertToJson(BodySource source, BodyMatcher<?> bodyMatcher) Shared conversion used by both request matching (HttpRequest) and response matching (HttpResponse), driven only through theBodySourceabstraction.convertToJson(HttpRequest request, BodyMatcher<?> bodyMatcher)
-
Constructor Details
-
JsonSchemaBodyDecoder
public JsonSchemaBodyDecoder(Configuration configuration, MockServerLogger mockServerLogger, Expectation expectation, HttpRequest httpRequest)
-
-
Method Details
-
convertToJson
-
convertToJson
Shared conversion used by both request matching (HttpRequest) and response matching (HttpResponse), driven only through theBodySourceabstraction. For an XML or form Content-Type the body is converted to JSON so a JSON / JSON schema / JSON path matcher can match an XML or form actual body; otherwise the body string is returned unchanged (includingnullfor an absent body, which the JSON matchers treat as a clean non-match). The XML→JSON conversion is memoised per message viaBodySource.getOrComputeConvertedBody(Supplier)so it runs once per message, not once per candidate matcher.
-