Comments (4)
This is not router specific feature , it is related to the generated documentation. See source code.
package main
import (
"github.com/labstack/echo/v4"
"github.com/swaggo/echo-swagger"
"github.com/swaggo/swag/example/basic/docs"
)
// @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() {
e := echo.New()
docs.SwaggerInfo.Version = "Test"
docs.SwaggerInfo.Host = "test.io"
docs.SwaggerInfo.BasePath = "/v3"
docs.SwaggerInfo.Schemes = []string{"http"}
docs.SwaggerInfo.Title = "Demo server"
docs.SwaggerInfo.Description = "This is a sample server Petstore server."
e.GET("/swagger/*", echoSwagger.WrapHandler)
/*
Or can use EchoWrapHandler func with configurations.
url := echoSwagger.URL("http://localhost:1323/swagger/doc.json") //The url pointing to API definition
e.GET("/swagger/*", echoSwagger.EchoWrapHandler(url))
*/
e.Logger.Fatal(e.Start(":1323"))
}
from echo-swagger.
Ahh I see. Ok thank you very much
from echo-swagger.
I'm looking for this for echo too. Looks like gin-swagger can do this.
from echo-swagger.
This is great. Thanks!
from echo-swagger.
Related Issues (20)
- Compilation problem:cannot use swaggerFiles.FS (variable of type fs.FS) as webdav.FileSystem value in struct literal HOT 2
- my functions are in other directory and swagger can't detect them
- oauth2-redirect.html with query parameters return 404 HOT 1
- Redirection error when using AddTrailingSlash middleware
- Expose OpenAPI in yml in a different endpoint HOT 3
- Add possibility description tag in dto struct HOT 1
- Update swagger ui version
- Use c.Response.Write() in EchoWrapHandler
- cannot change html title in swagger page HOT 1
- There are repeated slashes when jumping to index HOT 2
- Is it possible to create swagger-ui from a yaml file HOT 1
- Swagger Ui is loading after upgrading version 1.3.1 release HOT 3
- go version 1.18 Generics, swag init failed
- Latest swagger returns swagger-ui-bundle. version: 3.23.0 HOT 1
- How can I use routes that are defined outside the directory structure of main package? HOT 1
- Show document page when delete "docs/*" HOT 1
- securityDefinitions are not parsed HOT 1
- Missing param on external dependency
- IncompatibleAssign Swagger HOT 1
- Add Proof Key for Code Exchange Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echo-swagger.