forked from loafle/openapi-generator-original
[cpp-pistache-server]: Fix build with pistache master branch (#10829)
* fix(cpp-pistache-server): meson/cmake build * fix(cpp-pistache-server): Upgrade to C++17 and use std::optional * feat(cpp-pistache-server): Disable running tests during build of nlohmann/json * feat(samples): Update server/petstore/cpp-pistache
This commit is contained in:
@@ -211,19 +211,19 @@ void UserApi::login_user_handler(const Pistache::Rest::Request &request, Pistach
|
||||
|
||||
// Getting the query params
|
||||
auto usernameQuery = request.query().get("username");
|
||||
Pistache::Optional<std::string> username;
|
||||
if(!usernameQuery.isEmpty()){
|
||||
std::optional<std::string> username;
|
||||
if(usernameQuery.has_value()){
|
||||
std::string valueQuery_instance;
|
||||
if(fromStringValue(usernameQuery.get(), valueQuery_instance)){
|
||||
username = Pistache::Some(valueQuery_instance);
|
||||
if(fromStringValue(usernameQuery.value(), valueQuery_instance)){
|
||||
username = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
auto passwordQuery = request.query().get("password");
|
||||
Pistache::Optional<std::string> password;
|
||||
if(!passwordQuery.isEmpty()){
|
||||
std::optional<std::string> password;
|
||||
if(passwordQuery.has_value()){
|
||||
std::string valueQuery_instance;
|
||||
if(fromStringValue(passwordQuery.get(), valueQuery_instance)){
|
||||
password = Pistache::Some(valueQuery_instance);
|
||||
if(fromStringValue(passwordQuery.value(), valueQuery_instance)){
|
||||
password = valueQuery_instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user