🧬 fiber middleware to automatically generate RESTful API documentation with Swagger

Swagger

Release Discord Test Security Linter

fiber middleware to automatically generate RESTful API documentation with Swagger

Usage

  1. Add comments to your API source code, See Declarative Comments Format.
  2. Download Swag for Go by using:
go get -u github.com/swaggo/swag/cmd/swag
  1. Run the Swag in your Go project root folder which contains main.go file, Swag will parse comments and generate required files(docs folder and docs/doc.go).
swag init
  1. Download swagger by using:
go get -u github.com/gofiber/swagger

And import following in your code:

import "github.com/gofiber/swagger" // swagger handler

Canonical example:

package main

import (
	"github.com/gofiber/swagger"
	"github.com/gofiber/fiber/v2"

	// docs are generated by Swag CLI, you have to import them.
	// replace with your own docs folder, usually "github.com/username/reponame/docs"
	_ "github.com/gofiber/swagger/example/docs"
)

// @title Fiber Example API
// @version 1.0
// @description This is a sample swagger for Fiber
// @termsOfService http://swagger.io/terms/
// @contact.name API Support
// @contact.email [email protected]
// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html
// @host localhost:8080
// @BasePath /
func main() {
	app := fiber.New()

	app.Get("/swagger/*", swagger.HandlerDefault) // default

	app.Get("/swagger/*", swagger.New(swagger.Config{ // custom
		URL: "http://example.com/doc.json",
		DeepLinking: false,
		// Expand ("list") or Collapse ("none") tag groups by default
		DocExpansion: "none",
		// Prefill OAuth ClientId on Authorize popup
		OAuth: &swagger.OAuthConfig{
			AppName:  "OAuth Provider",
			ClientId: "21bb4edc-05a7-4afc-86f1-2e151e4ba6e2",
		},
		// Ability to change OAuth2 redirect uri location
		OAuth2RedirectUrl: "http://localhost:8080/swagger/oauth2-redirect.html",
	}))

	app.Listen(":8080")
}
  1. Run it, and browser to http://localhost:8080/swagger, you can see Swagger 2.0 Api documents.
Owner
Fiber
🚀 Fiber is an Express inspired web framework written in Go with 💖
Fiber
Comments
  • Reverse Proxy configuration

    Reverse Proxy configuration

    Hello.

    I use a reverse proxy (Istio+Envoy) and I'm unable to configure swagger using fiber correctly.

    I'm configuring the swagger handler like this:

    	app.Get("/docs/*", swagger.HandlerDefault)
    

    But when I try to access it from the proxy, which is a URL like this:

    https://proxy-host/some/custom/path/docs
    

    The current implementation redirects me to:

    https://proxy-host/docs/index.html
    

    Instead of

    https://proxy-host/some/custom/path/docs/index.html
    

    The Try it out button also doesn't works because it is trying to send the request to the incorrect path. It should send the request to https://my-proxy-host/custom/path/channels.

    Screenshot with this example: image

    Also, TrustedProxies and EnableTrustedProxyCheck options don't fix this issue. And even it could fix my reverse proxy doesn't have a fixed IP, which would be impossible to configure using the available options. I think you guys should look how Spring Boot manages this and maybe this is even a fiber issue (fixing the c.Redirect func) instead of a gofiber swagger issue: https://docs.spring.io/spring-boot/docs/current/reference/html/howto.html#howto.webserver.use-behind-a-proxy-server

    Thanks.

  • Bump github.com/gofiber/fiber/v2 from 2.32.0 to 2.36.0

    Bump github.com/gofiber/fiber/v2 from 2.32.0 to 2.36.0

    Bumps github.com/gofiber/fiber/v2 from 2.32.0 to 2.36.0.

    Release notes

    Sourced from github.com/gofiber/fiber/v2's releases.

    v2.36.0

    🚀 New

    🐛 Fixes

    • Padding around app name in startup message when containing non-ascii characters (#1987)
    • Closes #1931 "🤗 How to get path param before a custom verb?" (#1983)

    📚 Documentation

    • Translate to Indonesian Awesome List (#1980)

    Thank you @​Maxi-Mega, @​efectn, @​radenrishwan and @​tohutohu for making this update possible.

    v2.35.0

    🚀 New

    🧹 Updates

    • Binds the param string to a struct use params tag (#1968)
    • Client: Remove beta warning (#1951)
    • Bump github.com/valyala/fasthttp from 1.37.0 to 1.38.0 (#1948)
    • Delete a blank line (#1961)
    • Actions for MacOS (#1911)

    🐛 Fixes

    • middleware/logger: TagLatency doesn't have standard format between modes (#1943)
    • middleware/session: fix update cookie. (#1960)

    📚 Documentation

    • Refactor - default error handler & example (#1941)
    • New issue templates (#1945)
    • Translate some lines to turkish (#1954)
    • Update README_fa.md (#1953)
    • Flat-square style for readme badges (#1949)

    Thank you @​efectn, @​hamidreza01, @​ly020044, @​marcelogamba, @​nnnkkk7, @​olongfen and @​taheri24 for making this update possible.

    ... (truncated)

    Commits
    • 1cca495 try to stabilize Test_Test_Timeout
    • 7108b44 prepare release v2.36.0
    • c59370f prepare release v2.36.0
    • e49880c :art: Fix padding around app name in startup message when containing non-asci...
    • 43133be 🔥 Add OnPrefork Hooks so you can get the PID of the child process. (#1974)
    • 4103f94 :sparkles: feature: customizable colors (#1977)
    • ff1e010 Closes #1931 "🤗 How to get path param before a custom verb?" (#1983)
    • ad89ba4 fix README_it.md (#1980)
    • 2a2337d prepare release v2.35.0
    • bad7001 binds the param string to a struct use params tag (#1968)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/swaggo/swag from 1.8.1 to 1.8.4

    Bump github.com/swaggo/swag from 1.8.1 to 1.8.4

    Bumps github.com/swaggo/swag from 1.8.1 to 1.8.4.

    Release notes

    Sourced from github.com/swaggo/swag's releases.

    v1.8.4

    Changelog

    bd21bb0 Fix issue swaggo/swag#1150 (#1248) 401e414 doc: add missing web frameworks (#1263) a566490 feat: add default description to code if none is provided (#1239) a780e45 feat: default required option for struct fields (#1181) 213f6b8 feat: permit error (and any) interface definition (#1212) 89c61d4 feat: suppress debug logs when using -q (#1254) 0e2ec6c feat: use early overrides to allow converting unsupported types. (#1209) 1cd0b53 fix: don't skip ".." directory (#1238) 8de9952 fix: generic arrays generate successfully (#1247) 796a346 fix: temp dir to be the same as SerchDir to avoid invalid cross-device link (#1203) (#1241)

    v1.8.3

    Changelog

    f09eaa1 chore: cleanup generics_test.go (#1231) b736c5f chore: increment version (#1230) e767abb chore: refactor parser (#1191) 5f6b402 feat: Improve performance when generating spec with external dependencies (#1108) 3b580a0 feat: add --quiet=true for swag init, make the debug logger quiet. (#1206) ff41d9c feat: add basic generics support (#1225) 3cedab9 fix: README_zh-CN.md translate bug (#1202) 67cb768 fix: array enum varnames in arrays (#1187)

    v1.8.2

    Changelog

    c7cb3fd chore: update @​Produce comments (#1196) 36ae7af chore: remove gomonkey dependency from formatter (#1192) 47d5a76 chore: updating dependencies (#1190) 5f6c5f8 impr: add param example to readme (#1189) 636f456 chore: improve code quality (#1184) 90170b9 chore(deps): bump github.com/swaggo/http-swagger in /example/markdown (#1185) d209f71 added security definition description (#1174)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump actions/checkout from 2.3.1 to 3.0.2

    Bump actions/checkout from 2.3.1 to 3.0.2

    Bumps actions/checkout from 2.3.1 to 3.0.2.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.0.2

    v3.0.1

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    Changelog

    Sourced from actions/checkout's changelog.

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    v2 (beta)

    • Improved fetch performance
      • The default behavior now fetches only the SHA being checked-out
    • Script authenticated git commands

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump reviewdog/action-golangci-lint from 1 to 2

    Bump reviewdog/action-golangci-lint from 1 to 2

    Bumps reviewdog/action-golangci-lint from 1 to 2.

    Release notes

    Sourced from reviewdog/action-golangci-lint's releases.

    Release v2.0.0

    v2.0.0: PR #94 - Migrating from v1 to v2

    Release v1.25.0

    v1.25.0: PR #84 - chore(deps): update reviewdog/reviewdog to 0.13.0

    Release v1.24.0

    v1.24.0: PR #82 - chore(deps): update reviewdog/reviewdog to 0.12.0

    Release v1.23.0

    v1.23.0: PR #80 - chore(deps): update golangci/golangci-lint to 1.41.1

    Release v1.22.0

    v1.22.0: PR #79 - chore(deps): update golangci/golangci-lint to 1.41.0

    Release v1.21.2

    v1.21.2: PR #78 - chore(deps): update golangci/golangci-lint to 1.40.1

    Release v1.21.1

    v1.21.1: PR #77 - fix fail_on_error input

    Release v1.21.0

    v1.21.0: PR #76 - chore(deps): update golangci/golangci-lint to 1.40.0

    Release v1.20.0

    v1.20.0: PR #72 - chore(deps): update golangci/golangci-lint to 1.39.0

    Release v1.19.0

    v1.19.0: PR #71 - chore(deps): update golangci/golangci-lint to 1.38.0

    Release v1.18.1

    v1.18.1: PR #67 - chore(deps): update golangci-lint to 1.37.1

    Release v1.18.0

    v1.18.0: PR #66 - chore(deps): update golangci-lint to 1.37.0

    Release v1.17.0

    v1.17.0: PR #63 - chore(deps): update golangci-lint to 1.36.0

    Release v1.16.1

    v1.16.1: PR #61 - chore(deps): update golangci-lint to 1.35.2

    Release v1.16.0

    v1.16.0: PR #60 - chore(deps): update golangci-lint to 1.35.0

    Release v1.15.0

    v1.15.0: PR #57 - chore(deps): update golangci-lint to 1.34.1

    Release v1.14.1

    v1.14.1: PR #55 - chore(deps): update golangci-lint to 1.32.2

    ... (truncated)

    Commits
    • 0b4fbce npm run package
    • 869e452 Merge pull request #351 from reviewdog/renovate/jest-monorepo
    • 325e990 chore(deps): update jest monorepo to v28.1.2
    • 1cb5c2c Merge pull request #350 from reviewdog/renovate/typescript-eslint-monorepo
    • 2560d53 chore(deps): update dependency @​typescript-eslint/parser to v5.30.0
    • 2defb7f Merge pull request #349 from reviewdog/renovate/actions-cache-3.x
    • f1098e4 fix(deps): update dependency @​actions/cache to v3
    • 11447f3 Merge pull request #348 from reviewdog/renovate/jest-monorepo
    • 6465f7c chore(deps): update dependency @​types/jest to v28.1.3
    • eed00d9 Merge pull request #345 from reviewdog/renovate/typescript-4.x
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump actions/setup-go from 2 to 3

    Bump actions/setup-go from 2 to 3

    Bumps actions/setup-go from 2 to 3.

    Release notes

    Sourced from actions/setup-go's releases.

    Update actions/cache version to 3.0.0

    In scope of this release we updated actions/cache package as the new version contains fixes for caching error handling

    v3.0.0

    What's Changed

    Breaking Changes

    With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.

    This new major release removes the stable input, so there is no need to specify additional input to use pre-release versions. This release also corrects the pre-release versions syntax to satisfy the SemVer notation (1.18.0-beta1 -> 1.18.0-beta.1, 1.18.0-rc1 -> 1.18.0-rc.1).

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-go@v3
        with:
          go-version: '1.18.0-rc.1' 
      - run: go version
    

    Add check-latest input

    In scope of this release we add the check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a Go version will then be downloaded from go-versions repository. By default check-latest is set to false. Example of usage:

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-go@v2
        with:
          go-version: '1.16'
          check-latest: true
      - run: go version
    

    Moreover, we updated @actions/core from 1.2.6 to 1.6.0

    v2.1.5

    In scope of this release we updated matchers.json to improve the problem matcher pattern. For more information please refer to this pull request

    v2.1.4

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/setup-go/compare/v2.1.3...v2.1.4

    v2.1.3

    • Updated communication with runner to use environment files rather then workflow commands

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Declarative comments format is out-of-date

    Declarative comments format is out-of-date

    The current link to the declarative comments format documentation seems out-of-date. The new one is here. Could you update the README.md with the new link?

  • Swag is not recognized as an internal or external command

    Swag is not recognized as an internal or external command

    My trying to run swag init but I got some command error

    'swag' is not recognized as an internal or external command, operable program or batch file.

    Untitled

    go version 1.18.2 Fiber version 2.33.0

  • [Feature request]: accept option to include custom css

    [Feature request]: accept option to include custom css

    I would be neat to be able to set a custom css on top of the existing one, I personally hate the default color theme used by Shagger, and i think mos developers would prefer a dark them for my api's documentations, so i would like to see if that would be possible.

    How?, adding a css string or file descriptor, they would be different fields to differenciate them

  • swagger.json is almost empty. No operations defined in spec!

    swagger.json is almost empty. No operations defined in spec!

    Hi, I'm new to swagger in general. I followed the README. Here is what I did so far.

    1. Added few comments to main.go
    // @title Fiber Example API
    // @version 1.0
    // @description This is a sample swagger for Fiber
    // @contact.name API Support
    // @contact.email [email protected]
    // @host localhost:3000
    // @BasePath /
    func main() {
    ...
    }
    
    1. Added default handler to Fiber instance
    app.Get("/swagger/*", swagger.HandlerDefault) // default
    
    1. Imported docs package in the same file as handler.
    _ "main/docs"
    
    1. Ran swag init in the root dir of the workspace.

    This produces following docs/swagger.json

    {
        "swagger": "2.0",
        "info": {
            "description": "This is a sample swagger for Fiber",
            "title": "Fiber Example API",
            "contact": {
                "name": "API Support",
                "email": "[email protected]"
            },
            "version": "1.0"
        },
        "host": "localhost:3000",
        "basePath": "/",
        "paths": {}
    }
    

    http://127.0.0.1:3000/swagger/index.html returns No operations defined in spec!

    Am I missing anything?

    Thanks.

  • Bump github.com/gofiber/fiber/v2 from 2.40.0 to 2.40.1

    Bump github.com/gofiber/fiber/v2 from 2.40.0 to 2.40.1

    Bumps github.com/gofiber/fiber/v2 from 2.40.0 to 2.40.1.

    Release notes

    Sourced from github.com/gofiber/fiber/v2's releases.

    v2.40.1

    🐛 Fixes

    • Fix mounting when mount prefix is / (#2227)

    Full Changelog: https://github.com/gofiber/fiber/compare/v2.40.0...v2.40.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/swaggo/swag from 1.8.8 to 1.8.9

    Bump github.com/swaggo/swag from 1.8.8 to 1.8.9

    Bumps github.com/swaggo/swag from 1.8.8 to 1.8.9.

    Release notes

    Sourced from github.com/swaggo/swag's releases.

    v1.8.9

    Changelog

    a10fb9a Just optimize code about parsing extensions (#1399) 4ccbeaf chore: increment version (#1423) 8139731 chore: parse escaped double colon (\:) example struct tag (#1402) 2c530ea chore: release candidate (#1403) e3151c1 chore: release candidate (#1404) e50db3e enhancement for enums (#1400) 7c20f30 feat: parse only specific extension tag (#1219) 80d5221 feat: support json tags in embedded structs (#1396) 4519064 feat: use enums in request (#1417) 9a4fa5d fix issue 1414 (#1419) 30684a2 fix parsing bug affected by fmt (#1398) 7867c24 fix: don't error on empty comment line (#1415) dfce6c8 parse self-nested generic struct (#1420) ba5df82 record token.FileSet for every file so that the position of parsing error can be acquired (#1393) 3fe9ca2 revert docker login-action (#1405)

    v1.8.9-rc3

    Changelog

    97634c6 chore: v1.8.9-rc3 7c20f30 feat: parse only specific extension tag (#1219) 4519064 feat: use enums in request (#1417) 9a4fa5d fix issue 1414 (#1419) 7867c24 fix: don't error on empty comment line (#1415) dfce6c8 parse self-nested generic struct (#1420) 3fe9ca2 revert docker login-action (#1405)

    v1.8.9-rc2

    Changelog

    a10fb9a Just optimize code about parsing extensions (#1399) 8139731 chore: parse escaped double colon (\:) example struct tag (#1402) 2c530ea chore: release candidate (#1403) e3151c1 chore: release candidate (#1404) e50db3e enhancement for enums (#1400) 80d5221 feat: support json tags in embedded structs (#1396) 30684a2 fix parsing bug affected by fmt (#1398) ba5df82 record token.FileSet for every file so that the position of parsing error can be acquired (#1393)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump actions/checkout from 3.1.0 to 3.2.0

    Bump actions/checkout from 3.1.0 to 3.2.0

    Bumps actions/checkout from 3.1.0 to 3.2.0.

    Release notes

    Sourced from actions/checkout's releases.

    v3.2.0

    What's Changed

    New Contributors

    Full Changelog: https://github.com/actions/checkout/compare/v3...v3.2.0

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Ideas for Swagger Middleware

    Ideas for Swagger Middleware

    https://github.com/arsmn/fiber-swagger middleware is great but it doesn't have automatic adding feature. Also it will be optional.

    I think it can be added like this with hooks:

    type UserBody struct{
        Email string `json:"email" swagger:"email,required"`
        Password string `json:"password" swagger:"required"`
    }
    
    
    func main() {
        app := fiber.New()
        swg := swagger.New(app, swagger.Config{})
    
        swg.Add("index", swagger.Schema{
            Description: "home page",
            Tags: string["home","index"],
            Summary: "qwerty",
            Body: UserBody,
        })
    
        app.Get("/", func(c *fiber.Ctx) error {
            var user UserBody
            if err := c.BodyParser(&user); err != nil{
                return err
            }
    
            return c.JSON("👋")
        }).Name("index")
    }
    

    cc @balcieren

Related tags
Documentation side of the spaghetti cutter.
Documentation side of the spaghetti cutter.

spaghetti-analyzer - Win The Fight Against Spaghetti Code Overview spaghetti-analyzer is a command line tool for CI/CD pipelines (and dev machines) th

Dec 7, 2022
Gopi - Simple API for get geo information about your IP Address, Build by go-fiber

gopi Simple API to get information from your IP Address Idea This idea come from IP zxq and literaly i clone it How to download GeoIP2 ? Remember to c

May 27, 2022
The Akita CLI for watching network traffic, automatically generating API specs, and diffing API specs.

Catch breaking changes faster Akita builds models of your APIs to help you: Catch breaking changes on every pull request, including added/removed endp

Jan 2, 2023
HTTP API traffic recording and replay middleware based on GoReplay, can be used for migration and refactoring testing

gorc HTTP API traffic recording and replay middleware based on GoReplay, can be used for migration and refactoring testing. English | 中文 Requirements

Feb 13, 2022
The seed repository for your Flamego middleware modules

seed This repository contains seed files that almost every repository of Flamego middleware module should have. Using the content Create an empty repo

Dec 11, 2021
Mev-boost: A middleware server written in Go

mev-boost A middleware server written in Go, that sits between an ethereum PoS consensus client and an execution client. It allows consensus clients t

Dec 28, 2022
Header Block is a middleware plugin for Traefik to block request and response headers which regex matched by their name and/or value

Header Block is a middleware plugin for Traefik to block request and response headers which regex matched by their name and/or value Conf

May 24, 2022
Log4Shell is a middleware plugin for Traefik which blocks JNDI attacks based on HTTP header values.

Log4Shell Mitigation Log4Shell is a middleware plugin for Traefik which blocks JNDI attacks based on HTTP header values. Related to the Log4J CVE: htt

Dec 20, 2022
Middleware for Blocking IP ranges by inserting CIDR Blocks and searching IPs through those blocks

firewall Middleware for Blocking IP ranges by inserting CIDR Blocks and searching IPs through those blocks. Features Easy to use Efficient and Fast Co

Oct 9, 2022
SubCenter is a middleware that integrate task subscriptions and real-time push

Subscription Center SubCenter是一个集成各种任务并进行实时推送的中间件,本身不提供数据与推送服务。

Oct 31, 2022
HTTP proxy written in Go. COW can automatically identify blocked sites and use parent proxies to access.

COW (Climb Over the Wall) proxy COW 是一个简化穿墙的 HTTP 代理服务器。它能自动检测被墙网站,仅对这些网站使用二级代理。 English README. 当前版本:0.9.8 CHANGELOG 欢迎在 develop branch 进行开发并发送 pull

Jan 9, 2023
Automatically spawn a reverse shell fully interactive for Linux or Windows victim
Automatically spawn a reverse shell fully interactive for Linux or Windows victim

Girsh (Golang Interactive Reverse SHell) Who didn't get bored of manually typing the few lines to upgrade a reverse shell to a full interactive revers

Dec 14, 2022
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.
Automatically compress podcasts to tiny file sizes for bandwidth constrained devices like cellular.

tinycast Automatically compress podcasts to tiny file sizes for bandwidth constrained connections like cellular or satellite.

Sep 18, 2022
dynflare is a tool to automatically update dns records at Cloudflare, when the ip changes.

dynflare dynflare is a tool to automatically update dns records at Cloudflare, when the ip changes. How it works The current ips are determined by ask

Dec 7, 2021
Automatically register a list of domain names, add them to Cloudflare and set DNS records.

NameCannon Automatically register a list of domain names, add them as zones on Cloudflare, then add DNS records. Usage $ ./NameCannon --namesiloSecret

Jan 26, 2022
Attach services to specified networks automatically

Docker swarm network attacher Description docker-swarm-network-attacher aims to solve the problem of sharing a network between unrelated services. Wit

Nov 11, 2021
Automatically update your Windows hosts file with the WSL2 VM IP address

Automatically update your Windows hosts file with the WSL2 VM IP address

Jan 9, 2023
AutoTrackIR will automatically re-enabled your Track IR if flight simulator disabled it. (bug introduce in SU7)

AutoTrackIR AutoTrackIR will automatically re-enable your Track IR if flight simulator disabled it. (bug introduce in SU7) How it works ? It just watc

Oct 7, 2022