Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ jobs:
go-version: stable
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v8.0.0
uses: golangci/golangci-lint-action@v9.2.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v2.4.0

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go.
# skip-go-installation: true

# Optional: if set to true then the action don't cache or restore ~/go/pkg.
# skip-pkg-cache: true

# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
# skip-build-cache: true
version: v2.11.3
62 changes: 19 additions & 43 deletions .github/workflows/release-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ on:
release:
types:
- created

permissions:
contents: write # Required to upload assets

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO_VERSION: stable
TAG_NAME: ${{ github.event.release.tag_name }}
jobs:
build:
name: Upload Release Assets
Expand All @@ -23,60 +28,31 @@ jobs:
- name: Build artifacts
run: |
make release-assets

- name: Upload linux_amd64.tar.gz
if: hashFiles('linux_amd64.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./linux_amd64.tar.gz
asset_name: linux_amd64.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" linux_amd64.tar.gz --clobber

- name: Upload linux_amd64_dbg.tar.gz
if: hashFiles('linux_amd64_dbg.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./linux_amd64_dbg.tar.gz
asset_name: linux_amd64_dbg.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" linux_amd64_dbg.tar.gz --clobber

- name: Upload linux_arm64.tar.gz
if: hashFiles('linux_arm64.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./linux_arm64.tar.gz
asset_name: linux_arm64.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" linux_arm64.tar.gz --clobber

- name: Upload linux_arm.tar.gz
if: hashFiles('linux_arm.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./linux_arm.tar.gz
asset_name: linux_arm.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" linux_arm.tar.gz --clobber

- name: Upload darwin_amd64.tar.gz
if: hashFiles('darwin_amd64.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./darwin_amd64.tar.gz
asset_name: darwin_amd64.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" darwin_amd64.tar.gz --clobber

- name: Upload darwin_arm64.tar.gz
if: hashFiles('darwin_arm64.tar.gz') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./darwin_arm64.tar.gz
asset_name: darwin_arm64.tar.gz
asset_content_type: application/tar+gzip
run: gh release upload "$TAG_NAME" darwin_arm64.tar.gz --clobber

- name: Upload windows_amd64.zip
if: hashFiles('windows_amd64.zip') != ''
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./windows_amd64.zip
asset_name: windows_amd64.zip
asset_content_type: application/zip

run: gh release upload "$TAG_NAME" windows_amd64.zip --clobber
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ run:
linters:
default: all
disable:
- modernize
- prealloc
- errcheck
- funlen
- noctx
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#GOLANGCI_LINT_VERSION := "v2.5.0" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v2.11.3" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ just build and run.
### V5

Static assets for `v5` are built from Swagger
UI [v5.29.1](https://github.com/swagger-api/swagger-ui/releases/tag/v5.29.1).
UI [v5.32.3](https://github.com/swagger-api/swagger-ui/releases/tag/v5.32.3).

[CDN-based](https://cdnjs.com/libraries/swagger-ui) `v5cdn` uses Swagger
UI [v5.29.1](https://github.com/swagger-api/swagger-ui/releases/tag/v5.29.1).
UI [v5.32.3](https://github.com/swagger-api/swagger-ui/releases/tag/v5.32.3).

### V4

Expand Down
6 changes: 3 additions & 3 deletions cmd/swgui/swgui.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/bool64/dev/version"
"github.com/swaggest/swgui"
"github.com/swaggest/swgui/v5emb"
swgv5 "github.com/swaggest/swgui/v5emb"
)

func main() {
Expand All @@ -36,7 +36,7 @@ func main() {
flag.Parse()

if ver {
fmt.Printf("%s, Swagger UI %s\n", version.Info().Version, "v5.29.1")
fmt.Printf("%s, Swagger UI %s\n", version.Info().Version, "v5.32.3")

return
}
Expand All @@ -58,7 +58,7 @@ func main() {
Proxy: proxy,
}

swh := v5emb.NewHandlerWithConfig(cfg)
swh := swgv5.NewHandlerWithConfig(cfg)
hh := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
if r.URL.Path == urlToSchema {
http.ServeFile(rw, r, filePathToSchema)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/swaggest/swgui
go 1.17

require (
github.com/bool64/dev v0.2.43
github.com/bool64/dev v0.2.45
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/vearutop/statigz v1.4.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/bool64/dev v0.2.28/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/bool64/dev v0.2.43 h1:yQ7qiZVef6WtCl2vDYU0Y+qSq+0aBrQzY8KXkklk9cQ=
github.com/bool64/dev v0.2.43/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/bool64/dev v0.2.45 h1:3nLKhAS/6Oklk3Mt2lHYSN/Cb4tdAD77KLwzeP+6eYE=
github.com/bool64/dev v0.2.45/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 1 addition & 1 deletion internal/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (h *Handler) proxyRequest(u string, w http.ResponseWriter, r *http.Request)
b := r.Body
defer b.Close()

req, err := http.NewRequest(r.Method, u, b)
req, err := http.NewRequest(r.Method, u, b) //nolint:gosec // URL is well formed.
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)

Expand Down
36 changes: 18 additions & 18 deletions v5/static.go

Large diffs are not rendered by default.

Binary file modified v5/static/oauth2-redirect.html.gz
Binary file not shown.
Binary file modified v5/static/swagger-ui-bundle.js.gz
Binary file not shown.
Binary file modified v5/static/swagger-ui-standalone-preset.js.gz
Binary file not shown.
Binary file modified v5/static/swagger-ui.css.gz
Binary file not shown.
Binary file modified v5/static/swagger-ui.js.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion v5cdn/cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package v5cdn

const (
// AssetsBase is a base URL for the assets.
AssetsBase = "https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.29.1/"
AssetsBase = "https://cdn.jsdelivr.net/npm/swagger-ui@5.32.3/dist/"

// FaviconBase is a base URL for favicons.
FaviconBase = "https://petstore.swagger.io/"
Expand Down
Loading