From 731b1629429c0d3b0d1fbb49f06e332d5c66286e Mon Sep 17 00:00:00 2001 From: "Mateusz Szychowski (Muttley)" Date: Fri, 28 Jun 2019 19:21:01 +0200 Subject: [PATCH] [C++][Pistache] Fix warnings (#3238) * [C++][Pistache] Fix warnings Remove unecessary semicolon (Wpedantic) Remove unused parameter name (Wunused-parameter) * [C++][Pistache] Update Petstore sample --- .../main/resources/cpp-pistache-server/api-source.mustache | 6 +++--- samples/server/petstore/cpp-pistache/api/PetApi.cpp | 4 ++-- samples/server/petstore/cpp-pistache/api/StoreApi.cpp | 6 +++--- samples/server/petstore/cpp-pistache/api/UserApi.cpp | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache index cfb88ec331..4e35d5f863 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/api-source.mustache @@ -14,7 +14,7 @@ using namespace {{modelNamespace}};{{/hasModelImport}} {{classname}}::{{classname}}(std::shared_ptr rtr) { router = rtr; -}; +} void {{classname}}::init() { setupRoutes(); @@ -32,7 +32,7 @@ void {{classname}}::setupRoutes() { } {{#operation}} -void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Request &{{#hasParams}}request{{/hasParams}}, Pistache::Http::ResponseWriter response) { {{#vendorExtensions.x-codegen-pistache-isParsingSupported}} {{#hasPathParams}} // Getting the path params @@ -92,7 +92,7 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque } {{/operation}} -void {{classname}}::{{classnameSnakeLowerCase}}_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void {{classname}}::{{classnameSnakeLowerCase}}_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); } diff --git a/samples/server/petstore/cpp-pistache/api/PetApi.cpp b/samples/server/petstore/cpp-pistache/api/PetApi.cpp index 2dcf3b1434..32d47377c6 100644 --- a/samples/server/petstore/cpp-pistache/api/PetApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/PetApi.cpp @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model; PetApi::PetApi(std::shared_ptr rtr) { router = rtr; -}; +} void PetApi::init() { setupRoutes(); @@ -201,7 +201,7 @@ void PetApi::upload_file_handler(const Pistache::Rest::Request &request, Pistach } -void PetApi::pet_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void PetApi::pet_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); } diff --git a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp index b9ae6c1d58..d113387773 100644 --- a/samples/server/petstore/cpp-pistache/api/StoreApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/StoreApi.cpp @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model; StoreApi::StoreApi(std::shared_ptr rtr) { router = rtr; -}; +} void StoreApi::init() { setupRoutes(); @@ -58,7 +58,7 @@ void StoreApi::delete_order_handler(const Pistache::Rest::Request &request, Pist } } -void StoreApi::get_inventory_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void StoreApi::get_inventory_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { try { this->get_inventory(response); @@ -111,7 +111,7 @@ void StoreApi::place_order_handler(const Pistache::Rest::Request &request, Pista } -void StoreApi::store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void StoreApi::store_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); } diff --git a/samples/server/petstore/cpp-pistache/api/UserApi.cpp b/samples/server/petstore/cpp-pistache/api/UserApi.cpp index 76846eb5ec..51889d5504 100644 --- a/samples/server/petstore/cpp-pistache/api/UserApi.cpp +++ b/samples/server/petstore/cpp-pistache/api/UserApi.cpp @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model; UserApi::UserApi(std::shared_ptr rtr) { router = rtr; -}; +} void UserApi::init() { setupRoutes(); @@ -170,7 +170,7 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach } } -void UserApi::logout_user_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void UserApi::logout_user_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { try { this->logout_user(response); @@ -208,7 +208,7 @@ void UserApi::update_user_handler(const Pistache::Rest::Request &request, Pistac } -void UserApi::user_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { +void UserApi::user_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist"); }