mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-25 12:00:01 +02:00
Swagger.v1.json template (#3572)
* Turn swagger.v1.json into template * Rename ENABLE_SWAGGER_ENDPOINT option to ENABLE_SWAGGER
This commit is contained in:
parent
412583a3f2
commit
a74426d631
14 changed files with 74 additions and 21 deletions
|
@ -278,13 +278,13 @@ func mustAllowPulls(ctx *context.Context) {
|
|||
func RegisterRoutes(m *macaron.Macaron) {
|
||||
bind := binding.Bind
|
||||
|
||||
if setting.API.EnableSwaggerEndpoint {
|
||||
if setting.API.EnableSwagger {
|
||||
m.Get("/swagger", misc.Swagger) //Render V1 by default
|
||||
}
|
||||
|
||||
m.Group("/v1", func() {
|
||||
// Miscellaneous
|
||||
if setting.API.EnableSwaggerEndpoint {
|
||||
if setting.API.EnableSwagger {
|
||||
m.Get("/swagger", misc.Swagger)
|
||||
}
|
||||
m.Get("/version", misc.Version)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue