mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08: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:
		
				
					committed by
					
						
						Lauris BH
					
				
			
			
				
	
			
			
			
						parent
						
							412583a3f2
						
					
				
				
					commit
					a74426d631
				
			@@ -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)
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// tplSwagger swagger page template
 | 
			
		||||
const tplSwagger base.TplName = "swagger"
 | 
			
		||||
const tplSwagger base.TplName = "swagger/ui"
 | 
			
		||||
 | 
			
		||||
// Swagger render swagger-ui page with v1 json
 | 
			
		||||
func Swagger(ctx *context.Context) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user