[ISSUE #8686] Decode mock JSON request bodies as UTF-8. #8687
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.42) × (1 − Review Confidence (0.66)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 56 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.56 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.242
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
2 items
Thanks for catching this. I added a report name suffix for the US-ASCII run in c7bc79f and verified that Surefire now keeps both XML reports.
wozhenbang2004
Fixes #8686.
Mock expressions that read
#req.jsondecode the request body with the JVM default charset. A UTF-8 request such as{"city":"北京"}returns garbled text when the gateway runs with a different default. Decode JSON request bytes as UTF-8 before parsing, as specified by RFC 8259. This does not change expression syntax or form handling. Non-UTF-8 JSON no longer falls back to the JVM charset.IssueSpec
IssueSpec-Mode: lightweight
IssueSpec-Reason: Correct decoding of the existing Mock JSON body format without changing the plugin API or configuration. Classification is pending maintainer confirmation.
IssueSpec-Validation: With a non-UTF-8 JVM default, the base revision fails only the new expression test. All 85 Mock tests pass with the patch under US-ASCII, ISO-8859-1 and UTF-8 defaults on JDK 21. A loopback HTTP POST through the Mock plugin reproduces the garbled JSON on the base revision and returns the original text with the patch. Checkstyle passed on the two changed files.
AGENTS.md../mvnw clean install -Dmaven.javadoc.skip=true.