Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase max message size when mockserver is used with Jackson 2.15 #1754

Open
solita-simoki opened this issue Jun 8, 2023 · 1 comment
Open

Comments

@solita-simoki
Copy link

solita-simoki commented Jun 8, 2023

Describe the feature request
Increase max mock response size when mockserver is used with Jackson 2.15.

What you are trying to do
I'm trying to use mockserver inside a project which uses Jackson 2.15.2 dependency. This overrides Jackson version 2.14.2 from the mockserver project.

Implementation of jackson-core#863 sets upper limit on maximum length of String values read from input. Default limit is 20M since Jackson version 2.15.1.

Because of this new limit, mockserver fails if >20M mock response is used:

java.lang.IllegalArgumentException: com.fasterxml.jackson.core.exc.StreamConstraintsException: String length (20051112) exceeds the maximum length (20000000)

	at org.mockserver.client.MockServerClient.sendRequest(MockServerClient.java:403)
	at org.mockserver.client.MockServerClient.sendRequest(MockServerClient.java:429)
	at org.mockserver.client.MockServerClient.upsert(MockServerClient.java:1494)
	at org.mockserver.client.ForwardChainExpectation.respond(ForwardChainExpectation.java:84)

The solution you'd like
Updgrade mockserver's Jackson dependency to 2.15 and configure applicable ObjectFactory (or factories) to allow larger messages e.g. using Integer.MAX_VALUE as limit.

Example code: FasterXML/jackson-core#863 (comment).

Describe alternatives you've considered
As temporary solution I have pinned Jackson dependency to version 2.14.3.

@SahibYar
Copy link

SahibYar commented Mar 9, 2024

One must increase the severity of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants