diff --git a/internal/lokiapi/oas_client_gen.go b/internal/lokiapi/oas_client_gen.go index 385279c8..a13b4368 100644 --- a/internal/lokiapi/oas_client_gen.go +++ b/internal/lokiapi/oas_client_gen.go @@ -121,7 +121,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // GET /loki/api/v1/label/{name}/values func (c *Client) LabelValues(ctx context.Context, params LabelValuesParams) (*Values, error) { res, err := c.sendLabelValues(ctx, params) - _ = res return res, err } @@ -312,7 +311,6 @@ func (c *Client) sendLabelValues(ctx context.Context, params LabelValuesParams) // GET /loki/api/v1/labels func (c *Client) Labels(ctx context.Context, params LabelsParams) (*Labels, error) { res, err := c.sendLabels(ctx, params) - _ = res return res, err } @@ -465,8 +463,7 @@ func (c *Client) sendLabels(ctx context.Context, params LabelsParams) (res *Labe // // POST /loki/api/v1/push func (c *Client) Push(ctx context.Context, request PushReq) error { - res, err := c.sendPush(ctx, request) - _ = res + _, err := c.sendPush(ctx, request) return err } @@ -558,7 +555,6 @@ func (c *Client) sendPush(ctx context.Context, request PushReq) (res *PushNoCont // GET /loki/api/v1/query func (c *Client) Query(ctx context.Context, params QueryParams) (*QueryResponse, error) { res, err := c.sendQuery(ctx, params) - _ = res return res, err } @@ -720,7 +716,6 @@ func (c *Client) sendQuery(ctx context.Context, params QueryParams) (res *QueryR // GET /loki/api/v1/query_range func (c *Client) QueryRange(ctx context.Context, params QueryRangeParams) (*QueryResponse, error) { res, err := c.sendQueryRange(ctx, params) - _ = res return res, err } @@ -942,7 +937,6 @@ func (c *Client) sendQueryRange(ctx context.Context, params QueryRangeParams) (r // GET /loki/api/v1/series func (c *Client) Series(ctx context.Context, params SeriesParams) (*Maps, error) { res, err := c.sendSeries(ctx, params) - _ = res return res, err } diff --git a/internal/lokiapi/oas_handlers_gen.go b/internal/lokiapi/oas_handlers_gen.go index 99fb79a6..5b57af5e 100644 --- a/internal/lokiapi/oas_handlers_gen.go +++ b/internal/lokiapi/oas_handlers_gen.go @@ -76,10 +76,11 @@ func (s *Server) handleLabelValuesRequest(args [1]string, argsEscaped bool, w ht var response *Values if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "LabelValues", - OperationID: "labelValues", - Body: nil, + Context: ctx, + OperationName: "LabelValues", + OperationSummary: "", + OperationID: "labelValues", + Body: nil, Params: middleware.Parameters{ { Name: "X-Grafana-User", @@ -213,10 +214,11 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re var response *Labels if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Labels", - OperationID: "labels", - Body: nil, + Context: ctx, + OperationName: "Labels", + OperationSummary: "", + OperationID: "labels", + Body: nil, Params: middleware.Parameters{ { Name: "X-Grafana-User", @@ -346,12 +348,13 @@ func (s *Server) handlePushRequest(args [0]string, argsEscaped bool, w http.Resp var response *PushNoContent if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Push", - OperationID: "push", - Body: request, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "Push", + OperationSummary: "", + OperationID: "push", + Body: request, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -457,10 +460,11 @@ func (s *Server) handleQueryRequest(args [0]string, argsEscaped bool, w http.Res var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Query", - OperationID: "query", - Body: nil, + Context: ctx, + OperationName: "Query", + OperationSummary: "", + OperationID: "query", + Body: nil, Params: middleware.Parameters{ { Name: "X-Grafana-User", @@ -589,10 +593,11 @@ func (s *Server) handleQueryRangeRequest(args [0]string, argsEscaped bool, w htt var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "QueryRange", - OperationID: "queryRange", - Body: nil, + Context: ctx, + OperationName: "QueryRange", + OperationSummary: "", + OperationID: "queryRange", + Body: nil, Params: middleware.Parameters{ { Name: "X-Grafana-User", @@ -733,10 +738,11 @@ func (s *Server) handleSeriesRequest(args [0]string, argsEscaped bool, w http.Re var response *Maps if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Series", - OperationID: "series", - Body: nil, + Context: ctx, + OperationName: "Series", + OperationSummary: "", + OperationID: "series", + Body: nil, Params: middleware.Parameters{ { Name: "start", diff --git a/internal/lokiapi/oas_router_gen.go b/internal/lokiapi/oas_router_gen.go index 79972b44..135f71ed 100644 --- a/internal/lokiapi/oas_router_gen.go +++ b/internal/lokiapi/oas_router_gen.go @@ -213,6 +213,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -226,6 +227,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -333,6 +339,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: LabelValues r.name = "LabelValues" + r.summary = "" r.operationID = "labelValues" r.pathPattern = "/loki/api/v1/label/{name}/values" r.args = args @@ -355,6 +362,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Labels r.name = "Labels" + r.summary = "" r.operationID = "labels" r.pathPattern = "/loki/api/v1/labels" r.args = args @@ -377,6 +385,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: Push r.name = "Push" + r.summary = "" r.operationID = "push" r.pathPattern = "/loki/api/v1/push" r.args = args @@ -397,6 +406,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { switch method { case "GET": r.name = "Query" + r.summary = "" r.operationID = "query" r.pathPattern = "/loki/api/v1/query" r.args = args @@ -419,6 +429,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: QueryRange r.name = "QueryRange" + r.summary = "" r.operationID = "queryRange" r.pathPattern = "/loki/api/v1/query_range" r.args = args @@ -441,6 +452,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Series r.name = "Series" + r.summary = "" r.operationID = "series" r.pathPattern = "/loki/api/v1/series" r.args = args diff --git a/internal/promapi/oas_client_gen.go b/internal/promapi/oas_client_gen.go index 56deadc1..a5bae3d3 100644 --- a/internal/promapi/oas_client_gen.go +++ b/internal/promapi/oas_client_gen.go @@ -150,7 +150,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // GET /api/v1/label/{label}/values func (c *Client) GetLabelValues(ctx context.Context, params GetLabelValuesParams) (*LabelValuesResponse, error) { res, err := c.sendGetLabelValues(ctx, params) - _ = res return res, err } @@ -307,7 +306,6 @@ func (c *Client) sendGetLabelValues(ctx context.Context, params GetLabelValuesPa // GET /api/v1/labels func (c *Client) GetLabels(ctx context.Context, params GetLabelsParams) (*LabelsResponse, error) { res, err := c.sendGetLabels(ctx, params) - _ = res return res, err } @@ -445,7 +443,6 @@ func (c *Client) sendGetLabels(ctx context.Context, params GetLabelsParams) (res // GET /api/v1/metadata func (c *Client) GetMetadata(ctx context.Context, params GetMetadataParams) (*MetadataResponse, error) { res, err := c.sendGetMetadata(ctx, params) - _ = res return res, err } @@ -573,7 +570,6 @@ func (c *Client) sendGetMetadata(ctx context.Context, params GetMetadataParams) // GET /api/v1/query func (c *Client) GetQuery(ctx context.Context, params GetQueryParams) (*QueryResponse, error) { res, err := c.sendGetQuery(ctx, params) - _ = res return res, err } @@ -684,7 +680,6 @@ func (c *Client) sendGetQuery(ctx context.Context, params GetQueryParams) (res * // GET /api/v1/query_exemplars func (c *Client) GetQueryExemplars(ctx context.Context, params GetQueryExemplarsParams) (*QueryExemplarsResponse, error) { res, err := c.sendGetQueryExemplars(ctx, params) - _ = res return res, err } @@ -809,7 +804,6 @@ func (c *Client) sendGetQueryExemplars(ctx context.Context, params GetQueryExemp // GET /api/v1/query_range func (c *Client) GetQueryRange(ctx context.Context, params GetQueryRangeParams) (*QueryResponse, error) { res, err := c.sendGetQueryRange(ctx, params) - _ = res return res, err } @@ -966,7 +960,6 @@ func (c *Client) sendGetQueryRange(ctx context.Context, params GetQueryRangePara // GET /api/v1/rules func (c *Client) GetRules(ctx context.Context, params GetRulesParams) (*RulesResponse, error) { res, err := c.sendGetRules(ctx, params) - _ = res return res, err } @@ -1129,7 +1122,6 @@ func (c *Client) sendGetRules(ctx context.Context, params GetRulesParams) (res * // GET /api/v1/series func (c *Client) GetSeries(ctx context.Context, params GetSeriesParams) (*SeriesResponse, error) { res, err := c.sendGetSeries(ctx, params) - _ = res return res, err } @@ -1261,7 +1253,6 @@ func (c *Client) sendGetSeries(ctx context.Context, params GetSeriesParams) (res // POST /api/v1/labels func (c *Client) PostLabels(ctx context.Context) (*LabelsResponse, error) { res, err := c.sendPostLabels(ctx) - _ = res return res, err } @@ -1334,7 +1325,6 @@ func (c *Client) sendPostLabels(ctx context.Context) (res *LabelsResponse, err e // POST /api/v1/query func (c *Client) PostQuery(ctx context.Context, request *QueryForm) (*QueryResponse, error) { res, err := c.sendPostQuery(ctx, request) - _ = res return res, err } @@ -1410,7 +1400,6 @@ func (c *Client) sendPostQuery(ctx context.Context, request *QueryForm) (res *Qu // POST /api/v1/query_exemplars func (c *Client) PostQueryExemplars(ctx context.Context) (*QueryExemplarsResponse, error) { res, err := c.sendPostQueryExemplars(ctx) - _ = res return res, err } @@ -1483,7 +1472,6 @@ func (c *Client) sendPostQueryExemplars(ctx context.Context) (res *QueryExemplar // POST /api/v1/query_range func (c *Client) PostQueryRange(ctx context.Context, request *QueryRangeForm) (*QueryResponse, error) { res, err := c.sendPostQueryRange(ctx, request) - _ = res return res, err } @@ -1559,7 +1547,6 @@ func (c *Client) sendPostQueryRange(ctx context.Context, request *QueryRangeForm // POST /api/v1/series func (c *Client) PostSeries(ctx context.Context) (*SeriesResponse, error) { res, err := c.sendPostSeries(ctx) - _ = res return res, err } diff --git a/internal/promapi/oas_handlers_gen.go b/internal/promapi/oas_handlers_gen.go index a8c52adc..0a2cd27f 100644 --- a/internal/promapi/oas_handlers_gen.go +++ b/internal/promapi/oas_handlers_gen.go @@ -74,10 +74,11 @@ func (s *Server) handleGetLabelValuesRequest(args [1]string, argsEscaped bool, w var response *LabelValuesResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetLabelValues", - OperationID: "getLabelValues", - Body: nil, + Context: ctx, + OperationName: "GetLabelValues", + OperationSummary: "", + OperationID: "getLabelValues", + Body: nil, Params: middleware.Parameters{ { Name: "label", @@ -200,10 +201,11 @@ func (s *Server) handleGetLabelsRequest(args [0]string, argsEscaped bool, w http var response *LabelsResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetLabels", - OperationID: "getLabels", - Body: nil, + Context: ctx, + OperationName: "GetLabels", + OperationSummary: "", + OperationID: "getLabels", + Body: nil, Params: middleware.Parameters{ { Name: "start", @@ -322,10 +324,11 @@ func (s *Server) handleGetMetadataRequest(args [0]string, argsEscaped bool, w ht var response *MetadataResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetMetadata", - OperationID: "getMetadata", - Body: nil, + Context: ctx, + OperationName: "GetMetadata", + OperationSummary: "", + OperationID: "getMetadata", + Body: nil, Params: middleware.Parameters{ { Name: "limit", @@ -446,10 +449,11 @@ func (s *Server) handleGetQueryRequest(args [0]string, argsEscaped bool, w http. var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetQuery", - OperationID: "getQuery", - Body: nil, + Context: ctx, + OperationName: "GetQuery", + OperationSummary: "", + OperationID: "getQuery", + Body: nil, Params: middleware.Parameters{ { Name: "query", @@ -566,10 +570,11 @@ func (s *Server) handleGetQueryExemplarsRequest(args [0]string, argsEscaped bool var response *QueryExemplarsResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetQueryExemplars", - OperationID: "getQueryExemplars", - Body: nil, + Context: ctx, + OperationName: "GetQueryExemplars", + OperationSummary: "", + OperationID: "getQueryExemplars", + Body: nil, Params: middleware.Parameters{ { Name: "query", @@ -690,10 +695,11 @@ func (s *Server) handleGetQueryRangeRequest(args [0]string, argsEscaped bool, w var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetQueryRange", - OperationID: "getQueryRange", - Body: nil, + Context: ctx, + OperationName: "GetQueryRange", + OperationSummary: "", + OperationID: "getQueryRange", + Body: nil, Params: middleware.Parameters{ { Name: "query", @@ -820,10 +826,11 @@ func (s *Server) handleGetRulesRequest(args [0]string, argsEscaped bool, w http. var response *RulesResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetRules", - OperationID: "getRules", - Body: nil, + Context: ctx, + OperationName: "GetRules", + OperationSummary: "", + OperationID: "getRules", + Body: nil, Params: middleware.Parameters{ { Name: "type", @@ -948,10 +955,11 @@ func (s *Server) handleGetSeriesRequest(args [0]string, argsEscaped bool, w http var response *SeriesResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetSeries", - OperationID: "getSeries", - Body: nil, + Context: ctx, + OperationName: "GetSeries", + OperationSummary: "", + OperationID: "getSeries", + Body: nil, Params: middleware.Parameters{ { Name: "start", @@ -1056,12 +1064,13 @@ func (s *Server) handlePostLabelsRequest(args [0]string, argsEscaped bool, w htt var response *LabelsResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "PostLabels", - OperationID: "postLabels", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "PostLabels", + OperationSummary: "", + OperationID: "postLabels", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -1172,12 +1181,13 @@ func (s *Server) handlePostQueryRequest(args [0]string, argsEscaped bool, w http var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "PostQuery", - OperationID: "postQuery", - Body: request, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "PostQuery", + OperationSummary: "", + OperationID: "postQuery", + Body: request, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -1269,12 +1279,13 @@ func (s *Server) handlePostQueryExemplarsRequest(args [0]string, argsEscaped boo var response *QueryExemplarsResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "PostQueryExemplars", - OperationID: "postQueryExemplars", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "PostQueryExemplars", + OperationSummary: "", + OperationID: "postQueryExemplars", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -1385,12 +1396,13 @@ func (s *Server) handlePostQueryRangeRequest(args [0]string, argsEscaped bool, w var response *QueryResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "PostQueryRange", - OperationID: "postQueryRange", - Body: request, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "PostQueryRange", + OperationSummary: "", + OperationID: "postQueryRange", + Body: request, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -1482,12 +1494,13 @@ func (s *Server) handlePostSeriesRequest(args [0]string, argsEscaped bool, w htt var response *SeriesResponse if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "PostSeries", - OperationID: "postSeries", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "PostSeries", + OperationSummary: "", + OperationID: "postSeries", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( diff --git a/internal/promapi/oas_router_gen.go b/internal/promapi/oas_router_gen.go index 4caea3e3..0474f29e 100644 --- a/internal/promapi/oas_router_gen.go +++ b/internal/promapi/oas_router_gen.go @@ -271,6 +271,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -284,6 +285,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -391,6 +397,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetLabelValues r.name = "GetLabelValues" + r.summary = "" r.operationID = "getLabelValues" r.pathPattern = "/api/v1/label/{label}/values" r.args = args @@ -413,6 +420,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetLabels r.name = "GetLabels" + r.summary = "" r.operationID = "getLabels" r.pathPattern = "/api/v1/labels" r.args = args @@ -421,6 +429,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: PostLabels r.name = "PostLabels" + r.summary = "" r.operationID = "postLabels" r.pathPattern = "/api/v1/labels" r.args = args @@ -443,6 +452,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetMetadata r.name = "GetMetadata" + r.summary = "" r.operationID = "getMetadata" r.pathPattern = "/api/v1/metadata" r.args = args @@ -463,6 +473,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { switch method { case "GET": r.name = "GetQuery" + r.summary = "" r.operationID = "getQuery" r.pathPattern = "/api/v1/query" r.args = args @@ -470,6 +481,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { return r, true case "POST": r.name = "PostQuery" + r.summary = "" r.operationID = "postQuery" r.pathPattern = "/api/v1/query" r.args = args @@ -503,6 +515,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetQueryExemplars r.name = "GetQueryExemplars" + r.summary = "" r.operationID = "getQueryExemplars" r.pathPattern = "/api/v1/query_exemplars" r.args = args @@ -511,6 +524,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: PostQueryExemplars r.name = "PostQueryExemplars" + r.summary = "" r.operationID = "postQueryExemplars" r.pathPattern = "/api/v1/query_exemplars" r.args = args @@ -532,6 +546,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetQueryRange r.name = "GetQueryRange" + r.summary = "" r.operationID = "getQueryRange" r.pathPattern = "/api/v1/query_range" r.args = args @@ -540,6 +555,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: PostQueryRange r.name = "PostQueryRange" + r.summary = "" r.operationID = "postQueryRange" r.pathPattern = "/api/v1/query_range" r.args = args @@ -563,6 +579,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetRules r.name = "GetRules" + r.summary = "" r.operationID = "getRules" r.pathPattern = "/api/v1/rules" r.args = args @@ -584,6 +601,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetSeries r.name = "GetSeries" + r.summary = "" r.operationID = "getSeries" r.pathPattern = "/api/v1/series" r.args = args @@ -592,6 +610,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: PostSeries r.name = "PostSeries" + r.summary = "" r.operationID = "postSeries" r.pathPattern = "/api/v1/series" r.args = args diff --git a/internal/pyroscopeapi/oas_client_gen.go b/internal/pyroscopeapi/oas_client_gen.go index bfd047eb..ce29cb8f 100644 --- a/internal/pyroscopeapi/oas_client_gen.go +++ b/internal/pyroscopeapi/oas_client_gen.go @@ -117,7 +117,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // GET /api/apps func (c *Client) GetApps(ctx context.Context) ([]ApplicationMetadata, error) { res, err := c.sendGetApps(ctx) - _ = res return res, err } @@ -189,8 +188,7 @@ func (c *Client) sendGetApps(ctx context.Context) (res []ApplicationMetadata, er // // POST /ingest func (c *Client) Ingest(ctx context.Context, request *IngestReqWithContentType, params IngestParams) error { - res, err := c.sendIngest(ctx, request, params) - _ = res + _, err := c.sendIngest(ctx, request, params) return err } @@ -412,7 +410,6 @@ func (c *Client) sendIngest(ctx context.Context, request *IngestReqWithContentTy // GET /label-values func (c *Client) LabelValues(ctx context.Context, params LabelValuesParams) (LabelValues, error) { res, err := c.sendLabelValues(ctx, params) - _ = res return res, err } @@ -560,7 +557,6 @@ func (c *Client) sendLabelValues(ctx context.Context, params LabelValuesParams) // GET /labels func (c *Client) Labels(ctx context.Context, params LabelsParams) (Labels, error) { res, err := c.sendLabels(ctx, params) - _ = res return res, err } @@ -695,7 +691,6 @@ func (c *Client) sendLabels(ctx context.Context, params LabelsParams) (res Label // GET /render func (c *Client) Render(ctx context.Context, params RenderParams) (*FlamebearerProfileV1, error) { res, err := c.sendRender(ctx, params) - _ = res return res, err } diff --git a/internal/pyroscopeapi/oas_handlers_gen.go b/internal/pyroscopeapi/oas_handlers_gen.go index 398bf309..95fc9c40 100644 --- a/internal/pyroscopeapi/oas_handlers_gen.go +++ b/internal/pyroscopeapi/oas_handlers_gen.go @@ -63,12 +63,13 @@ func (s *Server) handleGetAppsRequest(args [0]string, argsEscaped bool, w http.R var response []ApplicationMetadata if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetApps", - OperationID: "getApps", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "GetApps", + OperationSummary: "", + OperationID: "getApps", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -189,10 +190,11 @@ func (s *Server) handleIngestRequest(args [0]string, argsEscaped bool, w http.Re var response *IngestOK if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Ingest", - OperationID: "ingest", - Body: request, + Context: ctx, + OperationName: "Ingest", + OperationSummary: "", + OperationID: "ingest", + Body: request, Params: middleware.Parameters{ { Name: "name", @@ -333,10 +335,11 @@ func (s *Server) handleLabelValuesRequest(args [0]string, argsEscaped bool, w ht var response LabelValues if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "LabelValues", - OperationID: "labelValues", - Body: nil, + Context: ctx, + OperationName: "LabelValues", + OperationSummary: "", + OperationID: "labelValues", + Body: nil, Params: middleware.Parameters{ { Name: "label", @@ -461,10 +464,11 @@ func (s *Server) handleLabelsRequest(args [0]string, argsEscaped bool, w http.Re var response Labels if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Labels", - OperationID: "labels", - Body: nil, + Context: ctx, + OperationName: "Labels", + OperationSummary: "", + OperationID: "labels", + Body: nil, Params: middleware.Parameters{ { Name: "from", @@ -586,10 +590,11 @@ func (s *Server) handleRenderRequest(args [0]string, argsEscaped bool, w http.Re var response *FlamebearerProfileV1 if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Render", - OperationID: "render", - Body: nil, + Context: ctx, + OperationName: "Render", + OperationSummary: "", + OperationID: "render", + Body: nil, Params: middleware.Parameters{ { Name: "from", diff --git a/internal/pyroscopeapi/oas_router_gen.go b/internal/pyroscopeapi/oas_router_gen.go index 78d83588..032d91cc 100644 --- a/internal/pyroscopeapi/oas_router_gen.go +++ b/internal/pyroscopeapi/oas_router_gen.go @@ -170,6 +170,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -183,6 +184,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -259,6 +265,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetApps r.name = "GetApps" + r.summary = "" r.operationID = "getApps" r.pathPattern = "/api/apps" r.args = args @@ -280,6 +287,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: Ingest r.name = "Ingest" + r.summary = "" r.operationID = "ingest" r.pathPattern = "/ingest" r.args = args @@ -312,6 +320,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: LabelValues r.name = "LabelValues" + r.summary = "" r.operationID = "labelValues" r.pathPattern = "/label-values" r.args = args @@ -333,6 +342,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Labels r.name = "Labels" + r.summary = "" r.operationID = "labels" r.pathPattern = "/labels" r.args = args @@ -355,6 +365,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Render r.name = "Render" + r.summary = "" r.operationID = "render" r.pathPattern = "/render" r.args = args diff --git a/internal/sentryapi/oas_client_gen.go b/internal/sentryapi/oas_client_gen.go index 7748227a..62289be7 100644 --- a/internal/sentryapi/oas_client_gen.go +++ b/internal/sentryapi/oas_client_gen.go @@ -95,7 +95,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // GET /dummy func (c *Client) Dummy(ctx context.Context) (*Event, error) { res, err := c.sendDummy(ctx) - _ = res return res, err } @@ -167,8 +166,7 @@ func (c *Client) sendDummy(ctx context.Context) (res *Event, err error) { // // POST /envelope func (c *Client) Envelope(ctx context.Context, request *EnvelopeReqWithContentType) error { - res, err := c.sendEnvelope(ctx, request) - _ = res + _, err := c.sendEnvelope(ctx, request) return err } diff --git a/internal/sentryapi/oas_handlers_gen.go b/internal/sentryapi/oas_handlers_gen.go index bdf6571a..429b7bb8 100644 --- a/internal/sentryapi/oas_handlers_gen.go +++ b/internal/sentryapi/oas_handlers_gen.go @@ -62,12 +62,13 @@ func (s *Server) handleDummyRequest(args [0]string, argsEscaped bool, w http.Res var response *Event if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Dummy", - OperationID: "dummy", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "Dummy", + OperationSummary: "", + OperationID: "dummy", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -178,12 +179,13 @@ func (s *Server) handleEnvelopeRequest(args [0]string, argsEscaped bool, w http. var response *EnvelopeOK if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Envelope", - OperationID: "envelope", - Body: request, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "Envelope", + OperationSummary: "", + OperationID: "envelope", + Body: request, + Params: middleware.Parameters{}, + Raw: r, } type ( diff --git a/internal/sentryapi/oas_router_gen.go b/internal/sentryapi/oas_router_gen.go index ea4b4f45..bdc95766 100644 --- a/internal/sentryapi/oas_router_gen.go +++ b/internal/sentryapi/oas_router_gen.go @@ -104,6 +104,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -117,6 +118,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -193,6 +199,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Dummy r.name = "Dummy" + r.summary = "" r.operationID = "dummy" r.pathPattern = "/dummy" r.args = args @@ -214,6 +221,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: Envelope r.name = "Envelope" + r.summary = "" r.operationID = "envelope" r.pathPattern = "/envelope" r.args = args diff --git a/internal/tempoapi/oas_client_gen.go b/internal/tempoapi/oas_client_gen.go index cd41b1a9..54833d0c 100644 --- a/internal/tempoapi/oas_client_gen.go +++ b/internal/tempoapi/oas_client_gen.go @@ -121,7 +121,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // GET /api/echo func (c *Client) Echo(ctx context.Context) (EchoOK, error) { res, err := c.sendEcho(ctx) - _ = res return res, err } @@ -194,7 +193,6 @@ func (c *Client) sendEcho(ctx context.Context) (res EchoOK, err error) { // GET /api/search func (c *Client) Search(ctx context.Context, params SearchParams) (*Traces, error) { res, err := c.sendSearch(ctx, params) - _ = res return res, err } @@ -390,7 +388,6 @@ func (c *Client) sendSearch(ctx context.Context, params SearchParams) (res *Trac // GET /api/search/tag/{tag_name}/values func (c *Client) SearchTagValues(ctx context.Context, params SearchTagValuesParams) (*TagValues, error) { res, err := c.sendSearchTagValues(ctx, params) - _ = res return res, err } @@ -483,7 +480,6 @@ func (c *Client) sendSearchTagValues(ctx context.Context, params SearchTagValues // GET /api/v2/search/tag/{tag_name}/values func (c *Client) SearchTagValuesV2(ctx context.Context, params SearchTagValuesV2Params) (*TagValuesV2, error) { res, err := c.sendSearchTagValuesV2(ctx, params) - _ = res return res, err } @@ -575,7 +571,6 @@ func (c *Client) sendSearchTagValuesV2(ctx context.Context, params SearchTagValu // GET /api/search/tags func (c *Client) SearchTags(ctx context.Context) (*TagNames, error) { res, err := c.sendSearchTags(ctx) - _ = res return res, err } @@ -648,7 +643,6 @@ func (c *Client) sendSearchTags(ctx context.Context) (res *TagNames, err error) // GET /api/traces/{traceID} func (c *Client) TraceByID(ctx context.Context, params TraceByIDParams) (TraceByIDRes, error) { res, err := c.sendTraceByID(ctx, params) - _ = res return res, err } diff --git a/internal/tempoapi/oas_handlers_gen.go b/internal/tempoapi/oas_handlers_gen.go index 804eba47..44549893 100644 --- a/internal/tempoapi/oas_handlers_gen.go +++ b/internal/tempoapi/oas_handlers_gen.go @@ -62,12 +62,13 @@ func (s *Server) handleEchoRequest(args [0]string, argsEscaped bool, w http.Resp var response EchoOK if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Echo", - OperationID: "echo", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "Echo", + OperationSummary: "", + OperationID: "echo", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -173,10 +174,11 @@ func (s *Server) handleSearchRequest(args [0]string, argsEscaped bool, w http.Re var response *Traces if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "Search", - OperationID: "search", - Body: nil, + Context: ctx, + OperationName: "Search", + OperationSummary: "", + OperationID: "search", + Body: nil, Params: middleware.Parameters{ { Name: "q", @@ -313,10 +315,11 @@ func (s *Server) handleSearchTagValuesRequest(args [1]string, argsEscaped bool, var response *TagValues if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "SearchTagValues", - OperationID: "searchTagValues", - Body: nil, + Context: ctx, + OperationName: "SearchTagValues", + OperationSummary: "", + OperationID: "searchTagValues", + Body: nil, Params: middleware.Parameters{ { Name: "tag_name", @@ -430,10 +433,11 @@ func (s *Server) handleSearchTagValuesV2Request(args [1]string, argsEscaped bool var response *TagValuesV2 if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "SearchTagValuesV2", - OperationID: "searchTagValuesV2", - Body: nil, + Context: ctx, + OperationName: "SearchTagValuesV2", + OperationSummary: "", + OperationID: "searchTagValuesV2", + Body: nil, Params: middleware.Parameters{ { Name: "tag_name", @@ -532,12 +536,13 @@ func (s *Server) handleSearchTagsRequest(args [0]string, argsEscaped bool, w htt var response *TagNames if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "SearchTags", - OperationID: "searchTags", - Body: nil, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "SearchTags", + OperationSummary: "", + OperationID: "searchTags", + Body: nil, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -643,10 +648,11 @@ func (s *Server) handleTraceByIDRequest(args [1]string, argsEscaped bool, w http var response TraceByIDRes if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "TraceByID", - OperationID: "traceByID", - Body: nil, + Context: ctx, + OperationName: "TraceByID", + OperationSummary: "", + OperationID: "traceByID", + Body: nil, Params: middleware.Parameters{ { Name: "traceID", diff --git a/internal/tempoapi/oas_router_gen.go b/internal/tempoapi/oas_router_gen.go index 39bba96e..76d208c5 100644 --- a/internal/tempoapi/oas_router_gen.go +++ b/internal/tempoapi/oas_router_gen.go @@ -243,6 +243,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -256,6 +257,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -332,6 +338,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: Echo r.name = "Echo" + r.summary = "" r.operationID = "echo" r.pathPattern = "/api/echo" r.args = args @@ -352,6 +359,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { switch method { case "GET": r.name = "Search" + r.summary = "" r.operationID = "search" r.pathPattern = "/api/search" r.args = args @@ -405,6 +413,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: SearchTagValues r.name = "SearchTagValues" + r.summary = "" r.operationID = "searchTagValues" r.pathPattern = "/api/search/tag/{tag_name}/values" r.args = args @@ -427,6 +436,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: SearchTags r.name = "SearchTags" + r.summary = "" r.operationID = "searchTags" r.pathPattern = "/api/search/tags" r.args = args @@ -455,6 +465,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: TraceByID r.name = "TraceByID" + r.summary = "" r.operationID = "traceByID" r.pathPattern = "/api/traces/{traceID}" r.args = args @@ -496,6 +507,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: SearchTagValuesV2 r.name = "SearchTagValuesV2" + r.summary = "" r.operationID = "searchTagValuesV2" r.pathPattern = "/api/v2/search/tag/{tag_name}/values" r.args = args diff --git a/internal/yqlclient/ytqueryapi/oas_client_gen.go b/internal/yqlclient/ytqueryapi/oas_client_gen.go index 7410efa8..9fe257a4 100644 --- a/internal/yqlclient/ytqueryapi/oas_client_gen.go +++ b/internal/yqlclient/ytqueryapi/oas_client_gen.go @@ -110,8 +110,7 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // // POST /api/v4/abort_query func (c *Client) AbortQuery(ctx context.Context, params AbortQueryParams) error { - res, err := c.sendAbortQuery(ctx, params) - _ = res + _, err := c.sendAbortQuery(ctx, params) return err } @@ -256,7 +255,6 @@ func (c *Client) sendAbortQuery(ctx context.Context, params AbortQueryParams) (r // POST /api/v4/get_query func (c *Client) GetQuery(ctx context.Context, params GetQueryParams) (*QueryStatus, error) { res, err := c.sendGetQuery(ctx, params) - _ = res return res, err } @@ -401,7 +399,6 @@ func (c *Client) sendGetQuery(ctx context.Context, params GetQueryParams) (res * // POST /api/v4/read_query_result func (c *Client) ReadQueryResult(ctx context.Context, params ReadQueryResultParams) (QueryResult, error) { res, err := c.sendReadQueryResult(ctx, params) - _ = res return res, err } @@ -577,7 +574,6 @@ func (c *Client) sendReadQueryResult(ctx context.Context, params ReadQueryResult // POST /api/v4/start_query func (c *Client) StartQuery(ctx context.Context, params StartQueryParams) (*StartedQuery, error) { res, err := c.sendStartQuery(ctx, params) - _ = res return res, err } diff --git a/internal/yqlclient/ytqueryapi/oas_handlers_gen.go b/internal/yqlclient/ytqueryapi/oas_handlers_gen.go index 67831537..510ce14b 100644 --- a/internal/yqlclient/ytqueryapi/oas_handlers_gen.go +++ b/internal/yqlclient/ytqueryapi/oas_handlers_gen.go @@ -123,10 +123,11 @@ func (s *Server) handleAbortQueryRequest(args [0]string, argsEscaped bool, w htt var response *AbortedQuery if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "AbortQuery", - OperationID: "abortQuery", - Body: nil, + Context: ctx, + OperationName: "AbortQuery", + OperationSummary: "", + OperationID: "abortQuery", + Body: nil, Params: middleware.Parameters{ { Name: "query_id", @@ -290,10 +291,11 @@ func (s *Server) handleGetQueryRequest(args [0]string, argsEscaped bool, w http. var response *QueryStatus if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetQuery", - OperationID: "getQuery", - Body: nil, + Context: ctx, + OperationName: "GetQuery", + OperationSummary: "", + OperationID: "getQuery", + Body: nil, Params: middleware.Parameters{ { Name: "query_id", @@ -457,10 +459,11 @@ func (s *Server) handleReadQueryResultRequest(args [0]string, argsEscaped bool, var response QueryResult if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "ReadQueryResult", - OperationID: "readQueryResult", - Body: nil, + Context: ctx, + OperationName: "ReadQueryResult", + OperationSummary: "", + OperationID: "readQueryResult", + Body: nil, Params: middleware.Parameters{ { Name: "query_id", @@ -632,10 +635,11 @@ func (s *Server) handleStartQueryRequest(args [0]string, argsEscaped bool, w htt var response *StartedQuery if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "StartQuery", - OperationID: "startQuery", - Body: nil, + Context: ctx, + OperationName: "StartQuery", + OperationSummary: "", + OperationID: "startQuery", + Body: nil, Params: middleware.Parameters{ { Name: "query", diff --git a/internal/yqlclient/ytqueryapi/oas_router_gen.go b/internal/yqlclient/ytqueryapi/oas_router_gen.go index 75998690..d0d05077 100644 --- a/internal/yqlclient/ytqueryapi/oas_router_gen.go +++ b/internal/yqlclient/ytqueryapi/oas_router_gen.go @@ -140,6 +140,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Route is route object. type Route struct { name string + summary string operationID string pathPattern string count int @@ -153,6 +154,11 @@ func (r Route) Name() string { return r.name } +// Summary returns OpenAPI summary. +func (r Route) Summary() string { + return r.summary +} + // OperationID returns OpenAPI operationId. func (r Route) OperationID() string { return r.operationID @@ -229,6 +235,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: AbortQuery r.name = "AbortQuery" + r.summary = "" r.operationID = "abortQuery" r.pathPattern = "/api/v4/abort_query" r.args = args @@ -250,6 +257,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: GetQuery r.name = "GetQuery" + r.summary = "" r.operationID = "getQuery" r.pathPattern = "/api/v4/get_query" r.args = args @@ -271,6 +279,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: ReadQueryResult r.name = "ReadQueryResult" + r.summary = "" r.operationID = "readQueryResult" r.pathPattern = "/api/v4/read_query_result" r.args = args @@ -292,6 +301,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: StartQuery r.name = "StartQuery" + r.summary = "" r.operationID = "startQuery" r.pathPattern = "/api/v4/start_query" r.args = args diff --git a/internal/yqlclient/ytqueryapi/oas_security_gen.go b/internal/yqlclient/ytqueryapi/oas_security_gen.go index b26c2c0e..b8cd9f41 100644 --- a/internal/yqlclient/ytqueryapi/oas_security_gen.go +++ b/internal/yqlclient/ytqueryapi/oas_security_gen.go @@ -8,6 +8,8 @@ import ( "strings" "github.com/go-faster/errors" + + "github.com/ogen-go/ogen/ogenerrors" ) // SecurityHandler is handler for security parameters. @@ -40,7 +42,9 @@ func (s *Server) securityYTToken(ctx context.Context, operationName string, req } t.APIKey = value rctx, err := s.sec.HandleYTToken(ctx, operationName, t) - if err != nil { + if errors.Is(err, ogenerrors.ErrSkipServerSecurity) { + return nil, false, nil + } else if err != nil { return nil, false, err } return rctx, true, err