API: Extract OpenAPI specification from source code using go-swagger (#40528) (#45061)

* API: Using go-swagger for extracting OpenAPI specification from source code

* Merge Grafana Alerting spec

* Include enterprise endpoints (if enabled)

* Serve SwaggerUI under feature flag

* Fix building dev docker images

* Configure swaggerUI

* Add missing json tags

Co-authored-by: Ying WANG <ying.wang@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
(cherry picked from commit 35fe58de37)
This commit is contained in:
Grot (@grafanabot)
2022-02-08 13:52:05 +01:00
committed by GitHub
parent c6a58003d1
commit 08ad99c36e
61 changed files with 35314 additions and 74 deletions
+4
View File
@@ -141,6 +141,10 @@ func (hs *HTTPServer) registerRoutes() {
// expose plugin file system assets
r.Get("/public/plugins/:pluginId/*", hs.getPluginAssets)
if hs.Features.IsEnabled(featuremgmt.FlagSwaggerUi) {
r.Get("/swagger-ui", swaggerUI)
}
// authed api
r.Group("/api", func(apiRoute routing.RouteRegister) {
// user (signed in)