Skip to content

Commit

Permalink
[C++][Pistache] Fix warnings (OpenAPITools#3238)
Browse files Browse the repository at this point in the history
* [C++][Pistache] Fix warnings

Remove unecessary semicolon (Wpedantic)
Remove unused parameter name (Wunused-parameter)

* [C++][Pistache] Update Petstore sample
  • Loading branch information
muttleyxd authored and etherealjoy committed Jun 28, 2019
1 parent e46bd7d commit 731b162
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ using namespace {{modelNamespace}};{{/hasModelImport}}

{{classname}}::{{classname}}(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
};
}

void {{classname}}::init() {
setupRoutes();
Expand All @@ -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
Expand Down Expand Up @@ -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");
}

Expand Down
4 changes: 2 additions & 2 deletions samples/server/petstore/cpp-pistache/api/PetApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model;

PetApi::PetApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
};
}

void PetApi::init() {
setupRoutes();
Expand Down Expand Up @@ -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");
}

Expand Down
6 changes: 3 additions & 3 deletions samples/server/petstore/cpp-pistache/api/StoreApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model;

StoreApi::StoreApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
};
}

void StoreApi::init() {
setupRoutes();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
}

Expand Down
6 changes: 3 additions & 3 deletions samples/server/petstore/cpp-pistache/api/UserApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace org::openapitools::server::model;

UserApi::UserApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
};
}

void UserApi::init() {
setupRoutes();
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 731b162

Please sign in to comment.