mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Generate swagger json (#1402)
- Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
This commit is contained in:
committed by
Kim "BKC" Carlbäcker
parent
bb5f694fc5
commit
3edb0c5894
@@ -20,6 +20,8 @@ import (
|
||||
const (
|
||||
// tplHome home page template
|
||||
tplHome base.TplName = "home"
|
||||
// tplSwagger swagger page template
|
||||
tplSwagger base.TplName = "swagger"
|
||||
// tplExploreRepos explore repositories page template
|
||||
tplExploreRepos base.TplName = "explore/repos"
|
||||
// tplExploreUsers explore users page template
|
||||
@@ -51,6 +53,11 @@ func Home(ctx *context.Context) {
|
||||
ctx.HTML(200, tplHome)
|
||||
}
|
||||
|
||||
// Swagger render swagger-ui page
|
||||
func Swagger(ctx *context.Context) {
|
||||
ctx.HTML(200, tplSwagger)
|
||||
}
|
||||
|
||||
// RepoSearchOptions when calling search repositories
|
||||
type RepoSearchOptions struct {
|
||||
Ranger func(*models.SearchRepoOptions) (models.RepositoryList, int64, error)
|
||||
|
Reference in New Issue
Block a user