-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Invalid JSON input on handlebars is not reported properly. #2546
Labels
Comments
Found that the code already had some precautions for a |
dirkbolte
added a commit
to dirkbolte/wiremock
that referenced
this issue
Jan 1, 2024
Instead of having `jsonpath` in handlebars throwing an `IllegalArgumentException`, empty bodies are handled the same way as `null` bodies: as empty string
6 tasks
tomakehurst
pushed a commit
that referenced
this issue
Jan 15, 2024
@dirkbolte Is this issue good to close? |
Yes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Proposal
See thread https://wiremock-community.slack.com/archives/C03N1E6HFPY/p1703250590706619 .
When an input JSON is empty, this results in a
HandlebarsException
, which is converted into the following response.I would have expected
wiremock/src/main/java/com/github/tomakehurst/wiremock/extension/responsetemplating/helpers/HandlebarsJsonPathHelper.java
Line 55 in b3874f0
Reproduction steps
POST
){{jsonPath (defaultIfEmpty request.body '{}') '$.doesNotExist' }}
Expected behavior:
handleError
is executed.Actual:
References
See thread https://wiremock-community.slack.com/archives/C03N1E6HFPY/p1703250590706619 .
The text was updated successfully, but these errors were encountered: