2017-10-21 19:35:50 +05:30
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package misc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.gitea.io/gitea/modules/base"
|
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
)
|
|
|
|
|
|
|
|
// tplSwagger swagger page template
|
2018-07-28 05:49:01 +05:30
|
|
|
const tplSwagger base.TplName = "swagger/ui"
|
2017-10-21 19:35:50 +05:30
|
|
|
|
|
|
|
// Swagger render swagger-ui page with v1 json
|
|
|
|
func Swagger(ctx *context.Context) {
|
|
|
|
ctx.Data["APIJSONVersion"] = "v1"
|
|
|
|
ctx.HTML(200, tplSwagger)
|
|
|
|
}
|