Repository navigation
Fix OpenAPI EvoMaster compatibility - #184
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d596a2ec89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| successResponsePolicy() | ||
| .ifPresent(policy -> applyPolicyMetadata(route, policy, policy.statusCode())); |
There was a problem hiding this comment.
Infer success statuses before suppressing response content
When a route uses the normal .onSuccess().suppressBody() form without overriding its status, policy.statusCode() is null, so applyPolicyMetadata never records suppression. The runtime response is bodyless, but generated OpenAPI still advertises the entity payload for the route's existing 200/201 status; derive the affected success statuses from the route when no override is configured.
Useful? React with 👍 / 👎.
| for (RouteApiResponsePolicy policy : entry.getValue()) { | ||
| applyPolicyMetadata(route, policy); | ||
| applyPolicyMetadata( | ||
| route, | ||
| policy, | ||
| policy.statusCode() == null ? entry.getKey() : policy.statusCode()); |
There was a problem hiding this comment.
Keep content for conditionally suppressed errors
When .onErrorWhen(status)...suppressBody() is guarded by a request-header condition, this loop marks the status as globally bodyless. Swaggerizer consequently removes content from that status for every request, even though requests that do not match the condition still receive the normal or unconditional error body; conditional suppression must not erase the representation that remains possible.
Useful? React with 👍 / 👎.
| .addPossibleStatus(RoutingStatus.returnValue(404)) | ||
| .addPossibleStatus(RoutingStatus.returnValue(415)) |
There was a problem hiding this comment.
Document malformed-body responses on fixed write routes
For fixed POST/PATCH routes, malformed JSON and other request-mapping failures can return 400 through the same write mapper used by generated routes, but this status list adds only the new 415 response. The resulting OpenAPI still omits the 400 response for fixed writes, so tools such as EvoMaster receive an incomplete contract; PUT has the same omission below.
Useful? React with 👍 / 👎.
| .addPossibleStatuses(200, 400) | ||
| .responseSchema(200, "application/json", statusSchema) | ||
| .responseExample(200, "application/json", Map.of("status", "ok")) | ||
| .responseStringSchema(200, "text/plain") | ||
| .responseSchemaRef( |
There was a problem hiding this comment.
Split the independent response-content cases
This test combines object-schema mapping, example propagation, text-schema mapping, and a separate error-status schema reference, so one failure does not identify which response-content rule broke. Split these behaviors into named tests or expose the equivalent combinations as parameterized rows rather than hiding the scenario matrix in one method.
AGENTS.md reference: AGENTS.md:L6-L8
Useful? React with 👍 / 👎.
| Assertions.assertTrue( | ||
| docs.contains("href='/mirror/docs/openapi-3.2.json?strongschema=true'")); | ||
| Assertions.assertTrue( | ||
| docs.contains( | ||
| "href='/mirror/docs/openapi-3.2.json?strongschema=true&download'")); |
There was a problem hiding this comment.
Parameterize the OpenAPI link variants
The amended test now folds strong-schema, operation-parameter, combined-option, and download-link scenarios into an already broad default-page test. These are equivalent link-generation combinations with the same assertion shape, so represent them as parameterized rows or separate named tests to keep failures attributable to one variant.
AGENTS.md reference: AGENTS.md:L17-L24
Useful? React with 👍 / 👎.
Summary
Verification