Skip to content
Snippets Groups Projects
Commit ddc624da authored by Stefan Spettel's avatar Stefan Spettel
Browse files

refact(model): add NSSF specific helpers

parent 2443bd60
No related branches found
No related tags found
2 merge requests!29Fix UDM common models,!27Add curl timeout parameter
This commit is part of merge request !27. Comments created here will be created in the context of that merge request.
......@@ -154,6 +154,22 @@ bool fromStringValue(
return true;
}
bool fromStringValue(
const std::string& inStr, oai::model::common::NFType& value) {
nlohmann::json json_value = nlohmann::json::parse(inStr);
from_json(json_value, value);
if (value.getEnumValue() ==
NFType_anyOf::eNFType_anyOf::INVALID_VALUE_OPENAPI_GENERATED)
return false;
return true;
}
bool fromStringValue(const std::string& inStr, oai::model::common::Tai& value) {
nlohmann::json::parse(inStr.c_str()).get_to(value);
return true;
}
bool validate_regex(
const std::string& regex, const std::string& value, std::stringstream& msg,
const std::string& pathPrefix) {
......
......@@ -27,6 +27,8 @@
#include <nlohmann/json.hpp>
#include "PlmnId.h"
#include "Snssai.h"
#include "NFType.h"
#include "Tai.h"
namespace oai::model::common::helpers {
......@@ -111,6 +113,9 @@ bool fromStringValue(
const std::string& inStr, oai::model::common::PlmnId& value);
bool fromStringValue(
const std::string& inStr, oai::model::common::Snssai& value);
bool fromStringValue(
const std::string& inStr, oai::model::common::NFType& value);
bool fromStringValue(const std::string& inStr, oai::model::common::Tai& value);
template<typename T>
bool fromStringValue(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment