Skip to content

Commit

Permalink
- Removing attempt to handle enum in api parameter : to early to try …
Browse files Browse the repository at this point in the history
…this correction
  • Loading branch information
mlebihan committed May 28, 2024
1 parent cd1e67d commit e244419
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,6 @@ public:
friend {{declspec}} void from_json(const nlohmann::json& j, {{classname}}& o);{{#vendorExtensions.x-is-string-enum-container}}{{#anyOf}}{{#-first}}
friend {{declspec}} void to_json(nlohmann::json& j, const {{{this}}}& o);
friend {{declspec}} void from_json(const nlohmann::json& j, {{{this}}}& o);{{/-first}}{{/anyOf}}{{/vendorExtensions.x-is-string-enum-container}}

{{#isEnum}}
/// <summary>
/// From enumerated value e{{classname}} to string value
/// </summary>
static std::string toStringValue(const {{classname}}::e{{classname}} &value) const;
static std::string toStringValue(const {{classname}} &value) const;
{{/isEnum}}

{{#isEnum}}
/// <summary>
/// From string value to enumerated value e{{classname}}
/// </summary>
static bool fromStringValue(const std::string &inStr, {{classname}}::e{{classname}} &value);
static bool fromStringValue(const std::string &inStr, {{classname}} &value);
{{/isEnum}}

protected:
{{#vars}}
{{{dataType}}} m_{{name}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,41 +181,6 @@ void {{classname}}::setEnumValue({{{this}}}::e{{{this}}} value)
m_value.setValue(value);
}{{/-first}}{{/anyOf}}{{/vendorExtensions.x-is-string-enum-container}}

{{#isEnum}}
/// <summary>
/// From enumerated value eVideoPrivacySet to string value
/// </summary>
std::string {{classname}}::toStringValue(const {{classname}}::e{{classname}} &value)
{
return "ukn";
}

std::string {{classname}}::toStringValue(const {{classname}} &value)
{
return "ukn";
}

/// <summary>
/// From string value to enumerated value e{{classname}}
/// </summary>
bool {{classname}}::fromStringValue(const std::string &inStr, {{classname}}::e{{classname}} &value)
{
// TODO get value
{{classname}}::e{{classname}} dummy;
return true;
// TODO throw if invalid value
}

bool {{classname}}::fromStringValue(const std::string &inStr, {{classname}} &value)
{
// TODO get value
{{classname}}::e{{classname}} dummy;
return true;
// TODO throw if invalid value
}

{{/isEnum}}

} // namespace {{modelNamespace}}

{{/model}}
Expand Down

0 comments on commit e244419

Please sign in to comment.