Giter Site home page Giter Site logo

fiber-swagger's People

Contributors

kuklyy avatar snakeice avatar ubogdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fiber-swagger's Issues

Reverse proxy configuration

I'm using swag with fiber but I can't configure correctly the swagger definition to access the documentation behind a reverse proxy or multiple accesses.

In my use case I have three ways of accessing applications' documentation:

  1. From the proxy using a custom host and path. Example: https://my-proxy/custom/path/swag/index.html
  2. From the pod's direct IP. Example: http://123.123.1.2/swag/index.html
  3. From a port forwarding, which basically follows the same rule of 2.

The problem: I can't make basePath dynamic. It will always have one single value. And because of that the Try it out button may only work from one of those access.

Would be nice to have in swag's implementation a way of adding a prefix to the basePath in the swag.ReadDoc() call (or a new one).

If this is implemented I will be able to change the implementation of gofiber's swagger to use the X-Forwarded-Prefix header as prefix for the basePath using swag.

Thanks.

Openning by requested in swaggo/swag#1210

No operations defined in spec!

not able to view any urls
even tried example provided.
Here is the code

package main

import (
	"log"

	"github.com/gofiber/fiber/v2"
	fiberSwagger "github.com/swaggo/fiber-swagger"

	_ "github.com/swaggo/fiber-swagger/example/docs" // docs is generated by Swag CLI, you have to import it.
)

// @title Swagger Example API
// @version 1.0
// @description This is a sample server Petstore server.
// @termsOfService http://swagger.io/terms/

// @contact.name API Support
// @contact.url http://www.swagger.io/support
// @contact.email [email protected]

// @license.name Apache 2.0
// @license.url http://www.apache.org/licenses/LICENSE-2.0.html

// @host petstore.swagger.io
// @BasePath /v2
func main() {
	app := fiber.New()

	app.Get("/swagger/*", fiberSwagger.WrapHandler)

	app.Get("/", func(c *fiber.Ctx) error {
		return c.SendString("home")
	})

	app.Get("/news", func(c *fiber.Ctx) error {
		return c.SendString("news")
	})

	err := app.Listen(":4000")
	if err != nil {
		log.Fatalf("fiber.Listen failed %s", err)
	}
}

after the i had given swag init
How can i view urls list of urls in swagger docs

How do I use this with OpenID Connect?

I have endpoints that are authorized by a Keycloak server that uses OpenID Connect, similar to this example:
swagger-api/swagger-ui#7963

In other words, I would like to configure the underlying Swagger UI with this configuration:

"securitySchemes": {
  "OpenIdConnect": {
    "type": "openIdConnect",
    "openIdConnectUrl": "https://my.url.com/auth/realms/myrealm/.well-known/openid-configuration"
  }
}

How would I configure swag so that it will Authorize correctly with Keycloak?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.