Skip to content

Bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs#148

Open
thdxg wants to merge 1 commit into
swaggo:masterfrom
thdxg:bump-files-v2-openapi31
Open

Bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs#148
thdxg wants to merge 1 commit into
swaggo:masterfrom
thdxg:bump-files-v2-openapi31

Conversation

@thdxg

@thdxg thdxg commented Jun 21, 2026

Copy link
Copy Markdown

Problem

echo-swagger v2 generates OpenAPI 3.1 specs (via swag/v2), but its go.mod pins github.com/swaggo/files/v2 v2.0.0, which embeds an older Swagger UI build that cannot render OpenAPI 3.1. The result is that the served UI loads but shows:

Unable to render this definition
The provided definition does not specify a valid version field.
Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n.

So a swag/v2 + echo-swagger v2 setup produces a 3.1 spec that the bundled UI refuses to display.

Fix

Bump github.com/swaggo/files/v2 from v2.0.0 to v2.0.2.

files/v2 v2.0.1 upgraded the bundled Swagger UI to v5.17.10, which renders OpenAPI 3.1; v2.0.2 bumps it further. This is a go.mod/go.sum-only change.

Verification

  • go build ./... — passes
  • go test ./... — passes (the existing asset-serving tests stay green)
  • Verified end-to-end against a real swag/v2-generated openapi: 3.1.0 spec: with files/v2 v2.0.0 the UI shows the "valid version field" error; after bumping to v2.0.2 (confirmed by asset hash that the new bundle is served) the spec renders correctly.

Relates to #113 (request to update the bundled Swagger UI).

The pinned files/v2 v2.0.0 bundles an older Swagger UI that cannot render
OpenAPI 3.1 specs, so serving a swag/v2-generated 3.1 spec fails with
"does not specify a valid version field". files/v2 v2.0.1 upgraded the
bundled Swagger UI to v5.17.10 (and v2.0.2 bumps it further), which
renders OpenAPI 3.1. Since echo-swagger v2 already produces 3.1 specs via
swag/v2, bump the UI dependency so the served UI can render them.
@thdxg thdxg changed the title chore(deps): bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs deps: bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs Jun 21, 2026
@thdxg thdxg changed the title deps: bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs Bump swaggo/files/v2 to v2.0.2 to render OpenAPI 3.1 specs Jun 21, 2026
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