forked from forgejo/forgejo
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:
parent
bb5f694fc5
commit
3edb0c5894
42 changed files with 2361 additions and 66 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue