Skip to content

Fix OpenAPI EvoMaster compatibility - #184

Merged
eviltester merged 2 commits into
masterfrom
openapi-evomaster-fixes
Sep 16, 2026
Merged

eviltester merged 2 commits into
masterfrom
openapi-evomaster-fixes

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • align generated OPTIONS documentation with 200 responses for EvoMaster/API Challenges usage
  • add explicit generated write-route 400 documentation for malformed JSON and request parsing errors
  • add response-content support for custom route documentation and preserve existing response body behavior

Verification

  • branch was previously tested with the Thingifier/APIC Challenges OpenAPI EvoMaster fix work
  • push completed cleanly from the local branch

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-16T21:50:05.794253Z d596a2e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@eviltester
eviltester merged commit b3f81f3 into master Sep 16, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1381 to +1382
successResponsePolicy()
.ifPresent(policy -> applyPolicyMetadata(route, policy, policy.statusCode()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines 1404 to +1408
for (RouteApiResponsePolicy policy : entry.getValue()) {
applyPolicyMetadata(route, policy);
applyPolicyMetadata(
route,
policy,
policy.statusCode() == null ? entry.getKey() : policy.statusCode());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines 1288 to +1289
.addPossibleStatus(RoutingStatus.returnValue(404))
.addPossibleStatus(RoutingStatus.returnValue(415))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +84 to +88
.addPossibleStatuses(200, 400)
.responseSchema(200, "application/json", statusSchema)
.responseExample(200, "application/json", Map.of("status", "ok"))
.responseStringSchema(200, "text/plain")
.responseSchemaRef(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +45 to +49
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'"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

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.

1 participant