swagger doc add bearer auth
This commit is contained in:
@@ -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
@@ -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
@@ -1384,5 +1384,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"BearerAuth": {
|
||||
"type": "apiKey",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"BearerAuth": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -908,4 +908,11 @@ paths:
|
||||
summary: Get List Tindakan
|
||||
tags:
|
||||
- Reference
|
||||
security:
|
||||
- BearerAuth: []
|
||||
securityDefinitions:
|
||||
BearerAuth:
|
||||
in: header
|
||||
name: Authorization
|
||||
type: apiKey
|
||||
swagger: "2.0"
|
||||
|
||||
Reference in New Issue
Block a user