Skip to content

Conversation

@chrisinmtown
Copy link
Contributor

@chrisinmtown chrisinmtown commented Nov 2, 2025

Fixes #2093

Changes proposed in this pull request:

  • Use "/" if the escaped app base path is the empty string, to adjust for
    new behavior of Flask and/or Werkzeug, which raises this error if the
    swagger.yaml file has no servers/url entry or servers/url with value "/":

    werkzeug.routing.exceptions.BuildError: Could not build url for endpoint '/._openapi_json'.
    
  • Add new test case to check blueprint and url prefix of open API specification
    with servers/url value "/"

  • Add new test case to confirm Swagger UI is returned when the specification
    (either OpenAPI or Swagger) has a trivial base path

@chrisinmtown chrisinmtown force-pushed the v2-fix-2093-swagger-base-path branch 2 times, most recently from a9d4bb7 to 36a3845 Compare November 2, 2025 11:55
@chrisinmtown chrisinmtown changed the title (v2) Fix build of Swagger UI URL if servers/url is missing or "/" (v2) Fix build of OpenAPI Console UI URL if servers/url is missing or "/" Nov 2, 2025
@chrisinmtown chrisinmtown force-pushed the v2-fix-2093-swagger-base-path branch 2 times, most recently from a4d27a3 to 8df2a59 Compare November 3, 2025 12:12
… "/"

Fixes spec-first#2093

Changes proposed in this pull request:
- Use "/" if the escaped app base path is the empty string, to adjust for
  new behavior of Flask and/or Werkzeug, which raises this error if the
  swagger.yaml file has no servers/url entry or servers/url with value "/":

  werkzeug.routing.exceptions.BuildError: Could not build url for endpoint '/._openapi_json'.

- Add new test case to check blueprint and url prefix of open API specification
  with servers/url value "/"

- Add new test case to confirm Swagger UI is returned when the specification
  (either OpenAPI or Swagger) has a trivial base path
@chrisinmtown chrisinmtown force-pushed the v2-fix-2093-swagger-base-path branch from 8df2a59 to 3473bc8 Compare November 3, 2025 12:13
@chrisinmtown chrisinmtown changed the title (v2) Fix build of OpenAPI Console UI URL if servers/url is missing or "/" (v2) Fix build of OpenAPI Console UI URL if servers/url is empty or "/" Nov 3, 2025
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