From 9642d6b2a42c5d62eb603bca28410860e4a4b7b5 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Fri, 26 Apr 2024 03:02:46 -0700 Subject: [PATCH] fix: remove inheritance due to template not overriding --- .../cpp-rest-sdk-client/model-header.mustache | 12 +++++------- .../cpp-rest-sdk-client/model-source.mustache | 6 ++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index c5a91c0e1641..48859cf019e3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -28,18 +28,16 @@ namespace {{this}} { #include class {{declspec}} {{classname}} - : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { public: - {{classname}}(); - virtual ~{{classname}}(); + {{classname}}() = default; + ~{{classname}}() = default; ///////////////////////////////////////////// - /// ModelBase overrides - void validate() override; + void validate(); - web::json::value toJson() const override; + web::json::value toJson() const; template bool fromJson(const web::json::value& json) { @@ -53,7 +51,7 @@ public: return true; } - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; + void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const; template bool fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) { diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 4c3c1abbcfe7..49e9894da568 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -7,6 +7,12 @@ namespace {{this}} { {{/modelNamespaceDeclarations}} {{#oneOf}}{{#-first}} + +void {{classname}}::validate() +{ + // TODO: implement validation +} + const {{classname}}::VariantType& {{classname}}::getVariant() const { return m_variantValue;