Skip to content

Comments

feat: auto-expand SwaggerUI path/paths for Phoenix usage#696

Open
petermueller wants to merge 1 commit intoopen-api-spex:masterfrom
petermueller:swagger-ui-use-phoenix-path
Open

feat: auto-expand SwaggerUI path/paths for Phoenix usage#696
petermueller wants to merge 1 commit intoopen-api-spex:masterfrom
petermueller:swagger-ui-use-phoenix-path

Conversation

@petermueller
Copy link

@petermueller petermueller commented Feb 18, 2026

closes #695

Changes:

  • path: "/open_api_spec" and paths: [latest: "/open_api_spec", ...] now expand with endpoint_module.path() when the paths start w/ "/"
  • oauth2_redirect_url: {:endpoint_url, ...} now also expands with endpoint_module.path()

Fixes:

  • Fix protocol encoding error when using :paths key

…efix when in Phoenix

When a Phoenix endpoint is present on the conn, automatically prepend
the endpoint's path prefix to `:path` and `:paths` config values.This
handles apps deployed behind a path prefix without requiring any special
tuple wrapper.Also fix `:paths` not being excluded from the SwaggerUI
config `Map.drop`, which would cause JSON encoding errors.
@petermueller
Copy link
Author

petermueller commented Feb 18, 2026

I didn't add documentation as I think for a new user it would be assumed that the path generation would work in this way, but as far as patch vs. minor, I guess it depends, as others would have just worked around this previously by making a wrapper plug, or by hard-coding the prefix in the :path option when adding this to their router (like us).

Either way, hopefully(?) it's just a quick sentence in the CHANGELOG.md to say "hey, remove any hard-coded path prefixes if you did that"

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.

OpenApiSpex.Plug.SwaggerUI does not expand :path/:paths w/ Phoenix.Endpoint.path

1 participant