Skip to content

Add Swagger UI for API Challenges#64

Merged
eviltester merged 1 commit into
masterfrom
codex/61-unpkg-swagger-api-challenges
Jul 16, 2026
Merged

Add Swagger UI for API Challenges#64
eviltester merged 1 commit into
masterfrom
codex/61-unpkg-swagger-api-challenges

Conversation

@eviltester

Copy link
Copy Markdown
Owner

Summary

  • Adds Swagger UI pages backed by generated OpenAPI JSON for API Challenges and the prefixed practice modes.
  • Makes Swagger UI use the current request host first so local docs call local APIs by default.
  • Forces the embedded Swagger UI into the API Challenges light theme.
  • Fixes Javalin static asset serving so CSS, JS, favicon, and image assets are not swallowed by generic fallback routes.

Validation

  • mvn -pl challenger -am -Dtest=UiPagesAreReachableTest -DfailIfNoTests=false test
  • mvn -pl thingifier -DskipTests checkstyle:check@project-fqn-check
  • mvn spotless:check
  • mvn -pl challenger -am -DskipTests package

Closes #61

Copilot AI review requested due to automatic review settings July 16, 2026 21:39

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 0ce8ebc into master Jul 16, 2026
3 checks passed
@eviltester
eviltester deleted the codex/61-unpkg-swagger-api-challenges branch July 16, 2026 21:40

@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: 5e89dc8ae7

ℹ️ 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 +106 to +107
private String requestOrigin(final HttpServerRequest request) {
return "%s://%s".formatted(request.scheme(), request.host());

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 Preserve the externally visible scheme for OpenAPI servers

When the application is deployed behind an HTTPS-terminating reverse proxy, request.scheme() is the backend connection scheme (normally http), while the browser is on https. This places http://<public-host> first in the generated servers list, so Swagger UI's Try it out requests become mixed-content requests and are blocked by browsers. Derive the public origin from a trusted forwarded-proto configuration/header or retain the configured HTTPS server instead.

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.

unpkg swagger to add to the API Challenges

2 participants