Skip to content

Do not add current request Swagger server#68

Merged
eviltester merged 1 commit into
masterfrom
codex/remove-swagger-current-request-server
Jul 17, 2026
Merged

Do not add current request Swagger server#68
eviltester merged 1 commit into
masterfrom
codex/remove-swagger-current-request-server

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • stop Swagger generation from inventing a synthetic current request server when the request origin is not configured
  • keep reordering configured servers when the request matches localhost or the configured HTTPS production host
  • add a regression proving unknown origins are not added to OpenAPI servers

Why

Production API Challenges can expose a backend request origin of http://apichallenges.eviltester.com. Swagger UI then defaulted to the generated current request server and made browser calls to HTTP from the HTTPS page. The API definition already declares the intended servers, so generated docs should only use configured servers.

Verification

  • mvn -pl thingifier '-Dtest=uk.co.compendiumdev.thingifier.swaggerizer.SwaggerizerServerPreferenceTest,uk.co.compendiumdev.thingifier.adapter.httpserver.HttpRequestOriginTest' test
  • mvn -pl thingifier -DskipTests install
  • mvn -pl thingifier -DskipTests checkstyle:check@project-fqn-check
  • mvn -pl challenger '-Dtest=uk.co.compendiumdev.uirouting.UiPagesAreReachableTest#canFetchDefaultOpenApiJsonForSwaggerUi+canFetchOpenApiJsonForSwaggerUiBehindHttpsProxy' test (from apichallenges, using locally installed Thingifier snapshot)

Copilot AI review requested due to automatic review settings July 17, 2026 08:40

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@eviltester
eviltester merged commit 707068c into master Jul 17, 2026
3 checks passed
@eviltester
eviltester deleted the codex/remove-swagger-current-request-server branch July 17, 2026 08:41
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