From 869b6bbfaf7d587966233220c670867081e7f95d Mon Sep 17 00:00:00 2001 From: tdakkota Date: Thu, 26 Oct 2023 10:52:01 +0300 Subject: [PATCH] chore: commit generated files --- internal/oas/oas_client_gen.go | 8 ++----- internal/oas/oas_handlers_gen.go | 40 ++++++++++++++++++-------------- internal/oas/oas_router_gen.go | 10 ++++++++ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/internal/oas/oas_client_gen.go b/internal/oas/oas_client_gen.go index b19ee1c..141c4c8 100644 --- a/internal/oas/oas_client_gen.go +++ b/internal/oas/oas_client_gen.go @@ -104,7 +104,6 @@ func (c *Client) requestURL(ctx context.Context) *url.URL { // POST /pet func (c *Client) AddPet(ctx context.Context, request *Pet) (*Pet, error) { res, err := c.sendAddPet(ctx, request) - _ = res return res, err } @@ -188,8 +187,7 @@ func (c *Client) sendAddPet(ctx context.Context, request *Pet) (res *Pet, err er // // DELETE /pet/{petId} func (c *Client) DeletePet(ctx context.Context, params DeletePetParams) error { - res, err := c.sendDeletePet(ctx, params) - _ = res + _, err := c.sendDeletePet(ctx, params) return err } @@ -280,7 +278,6 @@ func (c *Client) sendDeletePet(ctx context.Context, params DeletePetParams) (res // GET /pet/{petId} func (c *Client) GetPetById(ctx context.Context, params GetPetByIdParams) (GetPetByIdRes, error) { res, err := c.sendGetPetById(ctx, params) - _ = res return res, err } @@ -370,8 +367,7 @@ func (c *Client) sendGetPetById(ctx context.Context, params GetPetByIdParams) (r // // POST /pet/{petId} func (c *Client) UpdatePet(ctx context.Context, params UpdatePetParams) error { - res, err := c.sendUpdatePet(ctx, params) - _ = res + _, err := c.sendUpdatePet(ctx, params) return err } diff --git a/internal/oas/oas_handlers_gen.go b/internal/oas/oas_handlers_gen.go index 3b78dab..ab63d9a 100644 --- a/internal/oas/oas_handlers_gen.go +++ b/internal/oas/oas_handlers_gen.go @@ -81,12 +81,13 @@ func (s *Server) handleAddPetRequest(args [0]string, argsEscaped bool, w http.Re var response *Pet if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "AddPet", - OperationID: "addPet", - Body: request, - Params: middleware.Parameters{}, - Raw: r, + Context: ctx, + OperationName: "AddPet", + OperationSummary: "Add a new pet to the store", + OperationID: "addPet", + Body: request, + Params: middleware.Parameters{}, + Raw: r, } type ( @@ -181,10 +182,11 @@ func (s *Server) handleDeletePetRequest(args [1]string, argsEscaped bool, w http var response *DeletePetOK if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "DeletePet", - OperationID: "deletePet", - Body: nil, + Context: ctx, + OperationName: "DeletePet", + OperationSummary: "Deletes a pet", + OperationID: "deletePet", + Body: nil, Params: middleware.Parameters{ { Name: "petId", @@ -286,10 +288,11 @@ func (s *Server) handleGetPetByIdRequest(args [1]string, argsEscaped bool, w htt var response GetPetByIdRes if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "GetPetById", - OperationID: "getPetById", - Body: nil, + Context: ctx, + OperationName: "GetPetById", + OperationSummary: "Find pet by ID", + OperationID: "getPetById", + Body: nil, Params: middleware.Parameters{ { Name: "petId", @@ -391,10 +394,11 @@ func (s *Server) handleUpdatePetRequest(args [1]string, argsEscaped bool, w http var response *UpdatePetOK if m := s.cfg.Middleware; m != nil { mreq := middleware.Request{ - Context: ctx, - OperationName: "UpdatePet", - OperationID: "updatePet", - Body: nil, + Context: ctx, + OperationName: "UpdatePet", + OperationSummary: "Updates a pet in the store", + OperationID: "updatePet", + Body: nil, Params: middleware.Parameters{ { Name: "petId", diff --git a/internal/oas/oas_router_gen.go b/internal/oas/oas_router_gen.go index 28844d1..4106e35 100644 --- a/internal/oas/oas_router_gen.go +++ b/internal/oas/oas_router_gen.go @@ -109,6 +109,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 @@ -122,6 +123,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 @@ -186,6 +192,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { switch method { case "POST": r.name = "AddPet" + r.summary = "Add a new pet to the store" r.operationID = "addPet" r.pathPattern = "/pet" r.args = args @@ -213,6 +220,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "DELETE": // Leaf: DeletePet r.name = "DeletePet" + r.summary = "Deletes a pet" r.operationID = "deletePet" r.pathPattern = "/pet/{petId}" r.args = args @@ -221,6 +229,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "GET": // Leaf: GetPetById r.name = "GetPetById" + r.summary = "Find pet by ID" r.operationID = "getPetById" r.pathPattern = "/pet/{petId}" r.args = args @@ -229,6 +238,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { case "POST": // Leaf: UpdatePet r.name = "UpdatePet" + r.summary = "Updates a pet in the store" r.operationID = "updatePet" r.pathPattern = "/pet/{petId}" r.args = args