Skip to content

Preserve JSON request text in generated tests - #1975

Open
hoco-scy wants to merge 2 commits into
masterfrom
codex/evomaster-json-request-text
Open

hoco-scy wants to merge 2 commits into
masterfrom
codex/evomaster-json-request-text

Conversation

@hoco-scy

@hoco-scy hoco-scy commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The generated HTTP request reformats and pads the JSON text used during search. For example, a searched payload of 741 becomes a string containing a leading and trailing space. Services that bind the body as raw text can therefore receive a different input.

Fix and rationale

Escape the original payload for the target source language instead of parsing, formatting, or padding it just for display. This preserves text, including numeric spelling and line endings, in the generated string payload. Generated DTO paths and response formatting are unchanged.

Affected SUTs and trigger

In an isolated user-management control with the role already present, 741 returned 400 but 741 was treated as a different role and returned 201.

Verification

The new Java and Kotlin writer regressions fail on master at c45c90e (both add spaces around the scalar) and pass with this fix. Focused writer and HTTP result tests passed locally (JDK 21).

Split out of #1926; no other split PR is required.

Evidence boundary

The branch checks emitted Java/Kotlin literals and compiles generated requests to compare actual UTF-8 bytes at a local HTTP receiver. All four focused cases passed locally. Playwright's parsed JSON/DTO path is not a byte-fidelity claim.

@hoco-scy hoco-scy closed this Dec 1, 2026
@hoco-scy hoco-scy reopened this Dec 3, 2026
@hoco-scy
hoco-scy force-pushed the codex/evomaster-json-request-text branch from ed8abdb to a309326 Compare December 3, 2026 12:26
@hoco-scy
hoco-scy marked this pull request as ready for review December 4, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants