diff --git a/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml new file mode 100644 index 00000000000..32657b4cf37 --- /dev/null +++ b/bin/configs/cpp-pistache-server-cpp-pistache-nested-schema-refs.yaml @@ -0,0 +1,7 @@ +generatorName: cpp-pistache-server +outputDir: samples/server/petstore/cpp-pistache-nested-schema-refs +inputSpec: modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml +templateDir: modules/openapi-generator/src/main/resources/cpp-pistache-server +additionalProperties: + useStructModel: "false" + addExternalLibs: "true" diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache index ac016229aee..ae6f06a4cf4 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/model-source.mustache @@ -61,7 +61,7 @@ bool {{classname}}::validate(std::stringstream& msg, const std::string& pathPref {{> model-validation-body }} } {{/hasValidation}}{{#required}}{{#isModel}} - if (!m_{{name}}.validate()) { + if (!m_{{name}}.validate(msg, _pathPrefix + ".{{nameInCamelCase}}")) { msg << _pathPrefix << ": {{name}} is invalid;"; success = false; }{{/isModel}}{{/required}}{{/isArray}}{{/vars}}{{/isEnum}}{{#vendorExtensions.x-is-string-enum-container}}{{#anyOf}}{{#-first}} diff --git a/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml b/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml new file mode 100644 index 00000000000..8e03562fb83 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/nested-schema-refs.yaml @@ -0,0 +1,37 @@ +openapi: 3.0.0 +info: + version: 1.0.0 + title: Test swagger file + +paths: + /pet: + get: + tags: + - store + operationId: getNestedObject + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/outerType' +components: + schemas: + outerType: + type: object + required: + - middle + properties: + middle: + $ref: '#/components/schemas/middleType' + middleType: + type: object + required: + - inner + properties: + inner: + $ref: '#/components/schemas/innerType' + innerType: + type: string + \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore b/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore new file mode 100644 index 00000000000..6268881d980 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.gitignore @@ -0,0 +1,3 @@ +build/ +external/ +pistache/ \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES new file mode 100644 index 00000000000..1abc72ab7df --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/FILES @@ -0,0 +1,14 @@ +CMakeLists.txt +README.md +api/ApiBase.h +api/StoreApi.cpp +api/StoreApi.h +impl/StoreApiImpl.cpp +impl/StoreApiImpl.h +main-api-server.cpp +model/Helpers.cpp +model/Helpers.h +model/MiddleType.cpp +model/MiddleType.h +model/OuterType.cpp +model/OuterType.h diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION new file mode 100644 index 00000000000..ecb21862b1e --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0-SNAPSHOT diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt b/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt new file mode 100644 index 00000000000..23269deb0ff --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/CMakeLists.txt @@ -0,0 +1,38 @@ +cmake_minimum_required (VERSION 3.2) + +project(api-server) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pg -g3" ) + +include(ExternalProject) + +set(EXTERNAL_INSTALL_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/external) + +ExternalProject_Add(PISTACHE + GIT_REPOSITORY https://github.com/pistacheio/pistache.git + BUILD_IN_SOURCE true + INSTALL_COMMAND meson setup build --prefix=${EXTERNAL_INSTALL_LOCATION} --libdir=lib && meson install -C build +) + +ExternalProject_Add(NLOHMANN + GIT_REPOSITORY https://github.com/nlohmann/json.git + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DJSON_BuildTests=OFF +) + +include_directories(${EXTERNAL_INSTALL_LOCATION}/include) +link_directories(${EXTERNAL_INSTALL_LOCATION}/lib) + +include_directories(model) +include_directories(api) +include_directories(impl) + +file(GLOB SRCS + ${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp +) + +add_executable(${PROJECT_NAME} ${SRCS} ) +add_dependencies(${PROJECT_NAME} PISTACHE NLOHMANN) +target_link_libraries(${PROJECT_NAME} pistache pthread) diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md b/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md new file mode 100644 index 00000000000..626ce4cc8a8 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/README.md @@ -0,0 +1,48 @@ +# REST API Server for Test swagger file + +## Overview +This API Server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +It uses the [Pistache](https://github.com/oktal/pistache) Framework. + +## Files organization +The Pistache C++ REST server generator creates three folders: +- `api`: This folder contains the handlers for each method specified in the OpenAPI definition. Every handler extracts +the path and body parameters (if any) from the requests and tries to parse and possibly validate them. +Once this step is completed, the main API class calls the corresponding abstract method that should be implemented +by the developer (a basic implementation is provided under the `impl` folder) +- `impl`: As written above, the implementation folder contains, for each API, the corresponding implementation class, +which extends the main API class and implements the abstract methods. +Every method receives the path and body parameters as constant reference variables and a reference to the response +object, that should be filled with the right response and sent at the end of the method with the command: +response.send(returnCode, responseBody, [mimeType]) +- `model`: This folder contains the corresponding class for every object schema found in the OpenAPI specification. + +The main folder contains also a file with a main that can be used to start the server. +Of course, is you should customize this file based on your needs + +## Installation +First of all, you need to download and install the libraries listed [here](#libraries-required). + +Once the libraries are installed, in order to compile and run the server please follow the steps below: +```bash +mkdir build +cd build +cmake .. +make +``` + +Once compiled run the server: + +```bash +cd build +./api-server +``` + +## Libraries required +- [pistache](http://pistache.io/quickstart) +- [JSON for Modern C++](https://github.com/nlohmann/json/#integration): Please download the `json.hpp` file and +put it under the model/nlohmann folder + +## Namespaces +org.openapitools.server.api +org.openapitools.server.model diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h new file mode 100644 index 00000000000..21ce41d1fd6 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/ApiBase.h @@ -0,0 +1,39 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * ApiBase.h + * + * Generalization of the Api classes + */ + +#ifndef ApiBase_H_ +#define ApiBase_H_ + +#include +#include + +namespace org::openapitools::server::api +{ + +class ApiBase { +public: + explicit ApiBase(const std::shared_ptr& rtr) : router(rtr) {}; + virtual ~ApiBase() = default; + virtual void init() = 0; + +protected: + const std::shared_ptr router; +}; + +} // namespace org::openapitools::server::api + +#endif /* ApiBase_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp new file mode 100644 index 00000000000..afeb584db41 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.cpp @@ -0,0 +1,86 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApi.h" +#include "Helpers.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::helpers; +using namespace org::openapitools::server::model; + +const std::string StoreApi::base = ""; + +StoreApi::StoreApi(const std::shared_ptr& rtr) + : ApiBase(rtr) +{ +} + +void StoreApi::init() { + setupRoutes(); +} + +void StoreApi::setupRoutes() { + using namespace Pistache::Rest; + + Routes::Get(*router, base + "/pet", Routes::bind(&StoreApi::get_nested_object_handler, this)); + + // Default handler, called when a route is not found + router->addCustomHandler(Routes::bind(&StoreApi::store_api_default_handler, this)); +} + +std::pair StoreApi::handleParsingException(const std::exception& ex) const noexcept +{ + try { + throw; + } catch (nlohmann::detail::exception &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (org::openapitools::server::helpers::ValidationException &e) { + return std::make_pair(Pistache::Http::Code::Bad_Request, e.what()); + } catch (std::exception &e) { + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what()); + } +} + +std::pair StoreApi::handleOperationException(const std::exception& ex) const noexcept +{ + return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what()); +} + +void StoreApi::get_nested_object_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) { + try { + + + try { + this->get_nested_object(response); + } catch (Pistache::Http::HttpError &e) { + response.send(static_cast(e.code()), e.what()); + return; + } catch (std::exception &e) { + const std::pair errorInfo = this->handleOperationException(e); + response.send(errorInfo.first, errorInfo.second); + return; + } + + } catch (std::exception &e) { + response.send(Pistache::Http::Code::Internal_Server_Error, e.what()); + } + +} + +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"); +} + +} // namespace org::openapitools::server::api + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h new file mode 100644 index 00000000000..c6b96d2c77b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/api/StoreApi.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * StoreApi.h + * + * + */ + +#ifndef StoreApi_H_ +#define StoreApi_H_ + + +#include "ApiBase.h" + +#include +#include +#include + +#include +#include + +#include "OuterType.h" + +namespace org::openapitools::server::api +{ + +class StoreApi : public ApiBase { +public: + explicit StoreApi(const std::shared_ptr& rtr); + ~StoreApi() override = default; + void init() override; + + static const std::string base; + +private: + void setupRoutes(); + + void get_nested_object_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + void store_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response); + + /// + /// Helper function to handle unexpected Exceptions during Parameter parsing and validation. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleParsingException(const std::exception& ex) const noexcept; + + /// + /// Helper function to handle unexpected Exceptions during processing of the request in handler functions. + /// May be overridden to return custom error formats. This is called inside a catch block. + /// Important: When overriding, do not call `throw ex;`, but instead use `throw;`. + /// + virtual std::pair handleOperationException(const std::exception& ex) const noexcept; + + /// + /// + /// + /// + /// + /// + virtual void get_nested_object(Pistache::Http::ResponseWriter &response) = 0; + +}; + +} // namespace org::openapitools::server::api + +#endif /* StoreApi_H_ */ + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh b/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh new file mode 100644 index 00000000000..f7b8d02d3d2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/build_petstore.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# build C++ pistache petstore +# + +mkdir -p build +cd build +cmake .. +make -j diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp new file mode 100644 index 00000000000..93d057d023a --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.cpp @@ -0,0 +1,35 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +#include "StoreApiImpl.h" + +namespace org { +namespace openapitools { +namespace server { +namespace api { + +using namespace org::openapitools::server::model; + +StoreApiImpl::StoreApiImpl(const std::shared_ptr& rtr) + : StoreApi(rtr) +{ +} + +void StoreApiImpl::get_nested_object(Pistache::Http::ResponseWriter &response) { + response.send(Pistache::Http::Code::Ok, "Do some magic\n"); +} + +} +} +} +} + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h new file mode 100644 index 00000000000..29e63657ee3 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/impl/StoreApiImpl.h @@ -0,0 +1,52 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +/* +* StoreApiImpl.h +* +* +*/ + +#ifndef STORE_API_IMPL_H_ +#define STORE_API_IMPL_H_ + + +#include +#include +#include +#include +#include + +#include + + +#include "OuterType.h" + +namespace org::openapitools::server::api +{ + +using namespace org::openapitools::server::model; + +class StoreApiImpl : public org::openapitools::server::api::StoreApi { +public: + explicit StoreApiImpl(const std::shared_ptr& rtr); + ~StoreApiImpl() override = default; + + void get_nested_object(Pistache::Http::ResponseWriter &response); + +}; + +} // namespace org::openapitools::server::api + + + +#endif diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp new file mode 100644 index 00000000000..017c4e493f4 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/main-api-server.cpp @@ -0,0 +1,93 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "pistache/endpoint.h" +#include "pistache/http.h" +#include "pistache/router.h" +#ifdef __linux__ +#include +#include +#include +#endif + +#include "ApiBase.h" + +#include "StoreApiImpl.h" + +#define PISTACHE_SERVER_THREADS 2 +#define PISTACHE_SERVER_MAX_REQUEST_SIZE 32768 +#define PISTACHE_SERVER_MAX_RESPONSE_SIZE 32768 + +static Pistache::Http::Endpoint *httpEndpoint; +#ifdef __linux__ +static void sigHandler [[noreturn]] (int sig){ + switch(sig){ + case SIGINT: + case SIGQUIT: + case SIGTERM: + case SIGHUP: + default: + httpEndpoint->shutdown(); + break; + } + exit(0); +} + +static void setUpUnixSignals(std::vector quitSignals) { + sigset_t blocking_mask; + sigemptyset(&blocking_mask); + for (auto sig : quitSignals) + sigaddset(&blocking_mask, sig); + + struct sigaction sa; + sa.sa_handler = sigHandler; + sa.sa_mask = blocking_mask; + sa.sa_flags = 0; + + for (auto sig : quitSignals) + sigaction(sig, &sa, nullptr); +} +#endif + +using namespace org::openapitools::server::api; + +int main() { +#ifdef __linux__ + std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; + setUpUnixSignals(sigs); +#endif + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(8080)); + + httpEndpoint = new Pistache::Http::Endpoint((addr)); + auto router = std::make_shared(); + + auto opts = Pistache::Http::Endpoint::options() + .threads(PISTACHE_SERVER_THREADS); + opts.flags(Pistache::Tcp::Options::ReuseAddr); + opts.maxRequestSize(PISTACHE_SERVER_MAX_REQUEST_SIZE); + opts.maxResponseSize(PISTACHE_SERVER_MAX_RESPONSE_SIZE); + httpEndpoint->init(opts); + + auto apiImpls = std::vector>(); + + apiImpls.push_back(std::make_shared(router)); + + for (auto api : apiImpls) { + api->init(); + } + + httpEndpoint->setHandler(router->handler()); + httpEndpoint->serve(); + + httpEndpoint->shutdown(); +} diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp new file mode 100644 index 00000000000..57f0f285cf5 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.cpp @@ -0,0 +1,148 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +#include "Helpers.h" +#include + +namespace org::openapitools::server::helpers +{ + +const std::regex regexRfc3339_date(R"(^(\d{4})\-(\d{2})\-(\d{2})$)"); +const std::regex regexRfc3339_date_time( + R"(^(\d{4})\-(\d{2})\-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|([\+\-])(\d{2}):(\d{2}))$)" +); + + +namespace +{ + // Determine if given year is a leap year + // See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C + bool isLeapYear(const uint16_t year) { + return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0)); + } + + bool validateDateValues(const uint16_t year, const uint16_t month, const uint16_t day) { + return !( + (month == 0 || month > 12) + || (day == 0) + || (month == 2 && day > (28 + (isLeapYear(year) ? 1 : 0))) + || (month <= 7 && day > (30 + month % 2)) + || (month >= 8 && day > (31 - month % 2)) + ); + } + + bool validateTimeValues(const uint16_t hours, const uint16_t minutes, const uint16_t seconds) { + return (hours <= 23) && (minutes <= 59) && (seconds <= 60); + } +} + +bool validateRfc3339_date(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date); + return found && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))); +} + +bool validateRfc3339_date_time(const std::string& str) { + std::smatch match; + const bool found = std::regex_search(str, match, regexRfc3339_date_time); + return found + && validateDateValues(static_cast(std::stoi(match[1])), + static_cast(std::stoi(match[2])), + static_cast(std::stoi(match[3]))) + && validateTimeValues(static_cast(std::stoi(match[4])), + static_cast(std::stoi(match[5])), + static_cast(std::stoi(match[6]))); +} + +std::string toStringValue(const std::string &value){ + return std::string(value); +} + +std::string toStringValue(const int32_t value){ + return std::to_string(value); +} + +std::string toStringValue(const int64_t value){ + return std::to_string(value); +} + +std::string toStringValue(const bool value){ + return value ? std::string("true") : std::string("false"); +} + +std::string toStringValue(const float value){ + return std::to_string(value); +} + +std::string toStringValue(const double value){ + return std::to_string(value); +} + +bool fromStringValue(const std::string &inStr, std::string &value){ + value = std::string(inStr); + return true; +} + +bool fromStringValue(const std::string &inStr, int32_t &value){ + try { + value = std::stoi( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, int64_t &value){ + try { + value = std::stol( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, bool &value){ + if (inStr == "true") { + value = true; + return true; + } + if (inStr == "false") { + value = false; + return true; + } + return false; +} + +bool fromStringValue(const std::string &inStr, float &value){ + try { + value = std::stof( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +bool fromStringValue(const std::string &inStr, double &value){ + try { + value = std::stod( inStr ); + } + catch (const std::invalid_argument&) { + return false; + } + return true; +} + +} // namespace org::openapitools::server::helpers diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h new file mode 100644 index 00000000000..93a2a510414 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/Helpers.h @@ -0,0 +1,136 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * Helpers.h + * + * This is the helper class for models and primitives + */ + +#ifndef Helpers_H_ +#define Helpers_H_ + +#include +#include +#include +#include +#include + +namespace org::openapitools::server::helpers +{ + + class ValidationException : public std::runtime_error + { + public: + explicit ValidationException(const std::string& what) + : std::runtime_error(what) + { } + ~ValidationException() override = default; + }; + + /// + /// Validate a string against the full-date definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date(const std::string& str); + + /// + /// Validate a string against the date-time definition of RFC 3339, section 5.6. + /// + bool validateRfc3339_date_time(const std::string& str); + + namespace sfinae_helpers + { + struct NoType {}; + template NoType operator==(const T1&, const T2&); + + template class EqualsOperatorAvailable + { + public: + enum + { + value = !std::is_same< decltype(std::declval() == std::declval()), NoType >::value + }; + }; + } // namespace sfinae_helpers + + + /// + /// Determine if the given vector only has unique elements. T must provide the == operator. + /// + template + bool hasOnlyUniqueItems(const std::vector& vec) + { + static_assert(sfinae_helpers::EqualsOperatorAvailable::value, + "hasOnlyUniqueItems cannot be called, passed template type does not provide == operator."); + if (vec.size() <= 1) + { + return true; + } + // Compare every element of vec to every other element of vec. + // This isn't an elegant way to do this, since it's O(n^2), + // but it's the best solution working only with the == operator. + // This could be greatly improved if our models provided a valid hash + // and/or the < operator + for (size_t i = 0; i < vec.size() - 1; i++) + { + for (size_t j = i + 1; j < vec.size(); j++) + { + if (vec[i] == vec[j]) + { + return false; + } + } + } + return true; + } + + std::string toStringValue(const std::string &value); + std::string toStringValue(const int32_t value); + std::string toStringValue(const int64_t value); + std::string toStringValue(const bool value); + std::string toStringValue(const float value); + std::string toStringValue(const double value); + + bool fromStringValue(const std::string &inStr, std::string &value); + bool fromStringValue(const std::string &inStr, int32_t &value); + bool fromStringValue(const std::string &inStr, int64_t &value); + bool fromStringValue(const std::string &inStr, bool &value); + bool fromStringValue(const std::string &inStr, float &value); + bool fromStringValue(const std::string &inStr, double &value); + template + bool fromStringValue(const std::vector &inStr, std::vector &value){ + try{ + for(auto & item : inStr){ + T itemValue; + if(fromStringValue(item, itemValue)){ + value.push_back(itemValue); + } + } + } + catch(...){ + return false; + } + return value.size() > 0; + } + template + bool fromStringValue(const std::string &inStr, std::vector &value, char separator = ','){ + std::vector inStrings; + std::istringstream f(inStr); + std::string s; + while (std::getline(f, s, separator)) { + inStrings.push_back(s); + } + return fromStringValue(inStrings, value); + } + +} // namespace org::openapitools::server::helpers + +#endif // Helpers_H_ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp new file mode 100644 index 00000000000..aa4251d3bc0 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.cpp @@ -0,0 +1,91 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "MiddleType.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +MiddleType::MiddleType() +{ + m_Inner = ""; + +} + +void MiddleType::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool MiddleType::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool MiddleType::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "MiddleType" : pathPrefix; + + + return success; +} + +bool MiddleType::operator==(const MiddleType& rhs) const +{ + return + + + (getInner() == rhs.getInner()) + + + ; +} + +bool MiddleType::operator!=(const MiddleType& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const MiddleType& o) +{ + j = nlohmann::json::object(); + j["inner"] = o.m_Inner; + +} + +void from_json(const nlohmann::json& j, MiddleType& o) +{ + j.at("inner").get_to(o.m_Inner); + +} + +std::string MiddleType::getInner() const +{ + return m_Inner; +} +void MiddleType::setInner(std::string const& value) +{ + m_Inner = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h new file mode 100644 index 00000000000..795d2989f87 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/MiddleType.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * MiddleType.h + * + * + */ + +#ifndef MiddleType_H_ +#define MiddleType_H_ + + +#include +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class MiddleType +{ +public: + MiddleType(); + virtual ~MiddleType() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const MiddleType& rhs) const; + bool operator!=(const MiddleType& rhs) const; + + ///////////////////////////////////////////// + /// MiddleType members + + /// + /// + /// + std::string getInner() const; + void setInner(std::string const& value); + + friend void to_json(nlohmann::json& j, const MiddleType& o); + friend void from_json(const nlohmann::json& j, MiddleType& o); +protected: + std::string m_Inner; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* MiddleType_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp new file mode 100644 index 00000000000..f3cc1f8076b --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.cpp @@ -0,0 +1,94 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#include "OuterType.h" +#include "Helpers.h" + +#include + +namespace org::openapitools::server::model +{ + +OuterType::OuterType() +{ + +} + +void OuterType::validate() const +{ + std::stringstream msg; + if (!validate(msg)) + { + throw org::openapitools::server::helpers::ValidationException(msg.str()); + } +} + +bool OuterType::validate(std::stringstream& msg) const +{ + return validate(msg, ""); +} + +bool OuterType::validate(std::stringstream& msg, const std::string& pathPrefix) const +{ + bool success = true; + const std::string _pathPrefix = pathPrefix.empty() ? "OuterType" : pathPrefix; + + + if (!m_Middle.validate(msg, _pathPrefix + ".middle")) { + msg << _pathPrefix << ": Middle is invalid;"; + success = false; + } + return success; +} + +bool OuterType::operator==(const OuterType& rhs) const +{ + return + + + (getMiddle() == rhs.getMiddle()) + + + ; +} + +bool OuterType::operator!=(const OuterType& rhs) const +{ + return !(*this == rhs); +} + +void to_json(nlohmann::json& j, const OuterType& o) +{ + j = nlohmann::json::object(); + j["middle"] = o.m_Middle; + +} + +void from_json(const nlohmann::json& j, OuterType& o) +{ + j.at("middle").get_to(o.m_Middle); + +} + +org::openapitools::server::model::MiddleType OuterType::getMiddle() const +{ + return m_Middle; +} +void OuterType::setMiddle(org::openapitools::server::model::MiddleType const& value) +{ + m_Middle = value; +} + + +} // namespace org::openapitools::server::model + diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h new file mode 100644 index 00000000000..df53df3c2be --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/model/OuterType.h @@ -0,0 +1,77 @@ +/** +* Test swagger file +* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +/* + * OuterType.h + * + * + */ + +#ifndef OuterType_H_ +#define OuterType_H_ + + +#include "MiddleType.h" +#include + +namespace org::openapitools::server::model +{ + +/// +/// +/// +class OuterType +{ +public: + OuterType(); + virtual ~OuterType() = default; + + + /// + /// Validate the current data in the model. Throws a ValidationException on failure. + /// + void validate() const; + + /// + /// Validate the current data in the model. Returns false on error and writes an error + /// message into the given stringstream. + /// + bool validate(std::stringstream& msg) const; + + /// + /// Helper overload for validate. Used when one model stores another model and calls it's validate. + /// Not meant to be called outside that case. + /// + bool validate(std::stringstream& msg, const std::string& pathPrefix) const; + + bool operator==(const OuterType& rhs) const; + bool operator!=(const OuterType& rhs) const; + + ///////////////////////////////////////////// + /// OuterType members + + /// + /// + /// + org::openapitools::server::model::MiddleType getMiddle() const; + void setMiddle(org::openapitools::server::model::MiddleType const& value); + + friend void to_json(nlohmann::json& j, const OuterType& o); + friend void from_json(const nlohmann::json& j, OuterType& o); +protected: + org::openapitools::server::model::MiddleType m_Middle; + + +}; + +} // namespace org::openapitools::server::model + +#endif /* OuterType_H_ */ diff --git a/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml b/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml new file mode 100644 index 00000000000..66effbbbfd2 --- /dev/null +++ b/samples/server/petstore/cpp-pistache-nested-schema-refs/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + CppPistacheServerTests_container_type_import + pom + 1.0-SNAPSHOT + C++ Pistache Petstore Server (Container Type Import) + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + build-pistache + integration-test + + exec + + + ./build_petstore.sh + + + + + + + diff --git a/samples/server/petstore/cpp-pistache/.gitignore b/samples/server/petstore/cpp-pistache/.gitignore new file mode 100644 index 00000000000..6268881d980 --- /dev/null +++ b/samples/server/petstore/cpp-pistache/.gitignore @@ -0,0 +1,3 @@ +build/ +external/ +pistache/ \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/build_petstore.sh b/samples/server/petstore/cpp-pistache/build_petstore.sh index 665f09a5054..f7b8d02d3d2 100755 --- a/samples/server/petstore/cpp-pistache/build_petstore.sh +++ b/samples/server/petstore/cpp-pistache/build_petstore.sh @@ -2,7 +2,7 @@ # build C++ pistache petstore # -mkdir build +mkdir -p build cd build cmake .. -make +make -j diff --git a/samples/server/petstore/cpp-pistache/install_pistache.sh b/samples/server/petstore/cpp-pistache/install_pistache.sh deleted file mode 100755 index 271db23faee..00000000000 --- a/samples/server/petstore/cpp-pistache/install_pistache.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# ref: http://pistache.io/quickstart#installing-pistache -# -echo "Installing Pistache ..." - -git clone https://github.com/oktal/pistache.git || true -cd pistache || (echo "Cannot find git clone pistache directory"; exit 1) - -git submodule update --init -mkdir -p build -cd build || (echo "Cannot find build directory"; exit 1) - -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release .. -meson diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object.cpp b/samples/server/petstore/cpp-pistache/model/Inline_object.cpp deleted file mode 100644 index 89638a84566..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#include "Inline_object.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Inline_object::Inline_object() -{ - m_Name = ""; - m_NameIsSet = false; - m_Status = ""; - m_StatusIsSet = false; - -} - -Inline_object::~Inline_object() -{ -} - -void Inline_object::validate() -{ - // TODO: implement validation -} - -void to_json(nlohmann::json& j, const Inline_object& o) -{ - j = nlohmann::json(); - if(o.nameIsSet()) - j["name"] = o.m_Name; - if(o.statusIsSet()) - j["status"] = o.m_Status; -} - -void from_json(const nlohmann::json& j, Inline_object& o) -{ - if(j.find("name") != j.end()) - { - j.at("name").get_to(o.m_Name); - o.m_NameIsSet = true; - } - if(j.find("status") != j.end()) - { - j.at("status").get_to(o.m_Status); - o.m_StatusIsSet = true; - } -} - -std::string Inline_object::getName() const -{ - return m_Name; -} -void Inline_object::setName(std::string const& value) -{ - m_Name = value; - m_NameIsSet = true; -} -bool Inline_object::nameIsSet() const -{ - return m_NameIsSet; -} -void Inline_object::unsetName() -{ - m_NameIsSet = false; -} -std::string Inline_object::getStatus() const -{ - return m_Status; -} -void Inline_object::setStatus(std::string const& value) -{ - m_Status = value; - m_StatusIsSet = true; -} -bool Inline_object::statusIsSet() const -{ - return m_StatusIsSet; -} -void Inline_object::unsetStatus() -{ - m_StatusIsSet = false; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object.h b/samples/server/petstore/cpp-pistache/model/Inline_object.h deleted file mode 100644 index f407884cd88..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object.h +++ /dev/null @@ -1,73 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -/* - * Inline_object.h - * - * - */ - -#ifndef Inline_object_H_ -#define Inline_object_H_ - - -#include -#include - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Inline_object -{ -public: - Inline_object(); - virtual ~Inline_object(); - - void validate(); - - ///////////////////////////////////////////// - /// Inline_object members - - /// - /// Updated name of the pet - /// - std::string getName() const; - void setName(std::string const& value); - bool nameIsSet() const; - void unsetName(); - /// - /// Updated status of the pet - /// - std::string getStatus() const; - void setStatus(std::string const& value); - bool statusIsSet() const; - void unsetStatus(); - - friend void to_json(nlohmann::json& j, const Inline_object& o); - friend void from_json(const nlohmann::json& j, Inline_object& o); -protected: - std::string m_Name; - bool m_NameIsSet; - std::string m_Status; - bool m_StatusIsSet; -}; - -} -} -} -} - -#endif /* Inline_object_H_ */ diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp b/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp deleted file mode 100644 index 0da3bdba2b8..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object_1.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#include "Inline_object_1.h" - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -Inline_object_1::Inline_object_1() -{ - m_AdditionalMetadata = ""; - m_AdditionalMetadataIsSet = false; - m_fileIsSet = false; - -} - -Inline_object_1::~Inline_object_1() -{ -} - -void Inline_object_1::validate() -{ - // TODO: implement validation -} - -void to_json(nlohmann::json& j, const Inline_object_1& o) -{ - j = nlohmann::json(); - if(o.additionalMetadataIsSet()) - j["additionalMetadata"] = o.m_AdditionalMetadata; - if(o.fileIsSet()) - j["file"] = o.m_file; -} - -void from_json(const nlohmann::json& j, Inline_object_1& o) -{ - if(j.find("additionalMetadata") != j.end()) - { - j.at("additionalMetadata").get_to(o.m_AdditionalMetadata); - o.m_AdditionalMetadataIsSet = true; - } - if(j.find("file") != j.end()) - { - j.at("file").get_to(o.m_file); - o.m_fileIsSet = true; - } -} - -std::string Inline_object_1::getAdditionalMetadata() const -{ - return m_AdditionalMetadata; -} -void Inline_object_1::setAdditionalMetadata(std::string const& value) -{ - m_AdditionalMetadata = value; - m_AdditionalMetadataIsSet = true; -} -bool Inline_object_1::additionalMetadataIsSet() const -{ - return m_AdditionalMetadataIsSet; -} -void Inline_object_1::unsetAdditionalMetadata() -{ - m_AdditionalMetadataIsSet = false; -} -std::string Inline_object_1::getFile() const -{ - return m_file; -} -void Inline_object_1::setFile(std::string const& value) -{ - m_file = value; - m_fileIsSet = true; -} -bool Inline_object_1::fileIsSet() const -{ - return m_fileIsSet; -} -void Inline_object_1::unsetfile() -{ - m_fileIsSet = false; -} - -} -} -} -} - diff --git a/samples/server/petstore/cpp-pistache/model/Inline_object_1.h b/samples/server/petstore/cpp-pistache/model/Inline_object_1.h deleted file mode 100644 index a5d90b1754e..00000000000 --- a/samples/server/petstore/cpp-pistache/model/Inline_object_1.h +++ /dev/null @@ -1,73 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -/* - * Inline_object_1.h - * - * - */ - -#ifndef Inline_object_1_H_ -#define Inline_object_1_H_ - - -#include -#include - -namespace org { -namespace openapitools { -namespace server { -namespace model { - -/// -/// -/// -class Inline_object_1 -{ -public: - Inline_object_1(); - virtual ~Inline_object_1(); - - void validate(); - - ///////////////////////////////////////////// - /// Inline_object_1 members - - /// - /// Additional data to pass to server - /// - std::string getAdditionalMetadata() const; - void setAdditionalMetadata(std::string const& value); - bool additionalMetadataIsSet() const; - void unsetAdditionalMetadata(); - /// - /// file to upload - /// - std::string getFile() const; - void setFile(std::string const& value); - bool fileIsSet() const; - void unsetfile(); - - friend void to_json(nlohmann::json& j, const Inline_object_1& o); - friend void from_json(const nlohmann::json& j, Inline_object_1& o); -protected: - std::string m_AdditionalMetadata; - bool m_AdditionalMetadataIsSet; - std::string m_file; - bool m_fileIsSet; -}; - -} -} -} -} - -#endif /* Inline_object_1_H_ */ diff --git a/samples/server/petstore/cpp-pistache/pom.xml b/samples/server/petstore/cpp-pistache/pom.xml index 3b46ac29fc3..1ba35692115 100644 --- a/samples/server/petstore/cpp-pistache/pom.xml +++ b/samples/server/petstore/cpp-pistache/pom.xml @@ -26,16 +26,6 @@ exec-maven-plugin 1.6.0 - - install-pistache - integration-test - - exec - - - ./install_pistache.sh - - build-pistache integration-test