2020-04-05 01:20:50 -05:00
|
|
|
// Copyright 2020 The Gitea Authors. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-04-05 01:20:50 -05:00
|
|
|
|
2021-06-09 07:33:54 +08:00
|
|
|
package web
|
2018-07-28 02:19:01 +02:00
|
|
|
|
|
|
|
|
import (
|
2025-07-06 13:36:45 +08:00
|
|
|
"html/template"
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
2024-02-27 15:12:22 +08:00
|
|
|
"code.gitea.io/gitea/services/context"
|
2018-07-28 02:19:01 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// SwaggerV1Json render swagger v1 json
|
|
|
|
|
func SwaggerV1Json(ctx *context.Context) {
|
2025-07-06 13:36:45 +08:00
|
|
|
ctx.Data["SwaggerAppVer"] = template.HTML(template.JSEscapeString(setting.AppVer))
|
|
|
|
|
ctx.Data["SwaggerAppSubUrl"] = setting.AppSubURL // it is JS-safe
|
2024-02-18 17:52:02 +08:00
|
|
|
ctx.JSONTemplate("swagger/v1_json")
|
2018-07-28 02:19:01 +02:00
|
|
|
}
|