Skip to content

Commit

Permalink
fix: remove inheritance due to template not overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Apr 26, 2024
1 parent 54c869a commit 9642d6b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,16 @@ namespace {{this}} {
#include <variant>

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<typename Target>
bool fromJson(const web::json::value& json) {
Expand All @@ -53,7 +51,7 @@ public:
return true;
}

void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const override;
void toMultipart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) const;

template<typename Target>
bool fromMultiPart(std::shared_ptr<MultipartFormData> multipart, const utility::string_t& namePrefix) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
namespace {{this}} {
{{/modelNamespaceDeclarations}}
{{#oneOf}}{{#-first}}

void {{classname}}::validate()
{
// TODO: implement validation
}

const {{classname}}::VariantType& {{classname}}::getVariant() const
{
return m_variantValue;
Expand Down

0 comments on commit 9642d6b

Please sign in to comment.