swagger doc add bearer auth

This commit is contained in:
renaldybrada
2026-02-18 10:28:16 +07:00
parent 4b09db2177
commit f150030eee
4 changed files with 39 additions and 2 deletions
+6
View File
@@ -40,6 +40,12 @@ func gracefulShutdown(apiServer *http.Server, done chan bool) {
// @description Dokumentasi API Antrian Operasi
// @host localhost:8080
// @BasePath /api
// @securityDefinitions.apikey BearerAuth
// @in header
// @name Authorization
// @security BearerAuth
func main() {
log.Println("Starting API Service...")
+13 -1
View File
@@ -1390,7 +1390,19 @@ const docTemplate = `{
}
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"security": [
{
"BearerAuth": []
}
]
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
+13 -1
View File
@@ -1384,5 +1384,17 @@
}
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"security": [
{
"BearerAuth": []
}
]
}
+7
View File
@@ -908,4 +908,11 @@ paths:
summary: Get List Tindakan
tags:
- Reference
security:
- BearerAuth: []
securityDefinitions:
BearerAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"