Skip to content

Make layout configurable in Swagger UI#704

Open
joshk wants to merge 1 commit into
open-api-spex:masterfrom
joshk:patch-1
Open

Make layout configurable in Swagger UI#704
joshk wants to merge 1 commit into
open-api-spex:masterfrom
joshk:patch-1

Conversation

@joshk

@joshk joshk commented Jun 12, 2026

Copy link
Copy Markdown

This allows users to configure the Swagger UI layout with:

get("/swaggerui", OpenApiSpex.Plug.SwaggerUI, path: "/api/openapi", layout: "BaseLayout")

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.

Pull request overview

This PR updates OpenApiSpex.Plug.SwaggerUI to allow callers to configure the Swagger UI layout via plug options (e.g., layout: "BaseLayout"), instead of always using "StandaloneLayout".

Changes:

  • Adds support for :layout in the generated Swagger UI JS config, with "StandaloneLayout" as the default when not provided.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
layout: "<%= config[:layout] || "StandaloneLayout" %>",
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
layout: "<%= config[:layout] || "StandaloneLayout" %>",
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