Commit 69a3d3a6 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Fix issue for json parser

parent 4d08cf67
......@@ -43,10 +43,16 @@ void PduSessionType::validate() {
// TODO: implement validation
}
void to_json(nlohmann::json &j, const PduSessionType &o) {
j = nlohmann::json();
void PduSessionType::set_value(std::string value) { this->value = value; }
void PduSessionType::get_value(std::string &value) const {
value = this->value;
}
std::string PduSessionType::get_value() const { return value; }
void from_json(const nlohmann::json &j, PduSessionType &o) {}
void to_json(nlohmann::json &j, const PduSessionType &o) { j = o.get_value(); }
} // namespace oai::udr::model
void from_json(const nlohmann::json &j, PduSessionType &o) {
o.set_value(j.get<std::string>());
}
} // namespace oai::udr::model
......@@ -47,21 +47,26 @@ namespace oai::udr::model {
///
/// </summary>
class PduSessionType {
public:
public:
PduSessionType();
virtual ~PduSessionType();
void validate();
void set_value(std::string value);
void get_value(std::string &value) const;
std::string get_value() const;
/////////////////////////////////////////////
/// PduSessionType members
friend void to_json(nlohmann::json &j, const PduSessionType &o);
friend void from_json(const nlohmann::json &j, PduSessionType &o);
protected:
protected:
std::string value;
};
} // namespace oai::udr::model
} // namespace oai::udr::model
#endif /* PduSessionType_H_ */
......@@ -44,9 +44,11 @@ void PreemptionCapability::validate() {
}
void to_json(nlohmann::json &j, const PreemptionCapability &o) {
j = nlohmann::json();
j = o.get_value();
}
void from_json(const nlohmann::json &j, PreemptionCapability &o) {}
void from_json(const nlohmann::json &j, PreemptionCapability &o) {
o.set_value(j.get<std::string>());
}
} // namespace oai::udr::model
} // namespace oai::udr::model
......@@ -47,7 +47,7 @@ namespace oai::udr::model {
///
/// </summary>
class PreemptionCapability {
public:
public:
PreemptionCapability();
virtual ~PreemptionCapability();
......@@ -59,9 +59,10 @@ public:
friend void to_json(nlohmann::json &j, const PreemptionCapability &o);
friend void from_json(const nlohmann::json &j, PreemptionCapability &o);
protected:
protected:
std::string value;
};
} // namespace oai::udr::model
} // namespace oai::udr::model
#endif /* PreemptionCapability_H_ */
......@@ -44,9 +44,11 @@ void PreemptionVulnerability::validate() {
}
void to_json(nlohmann::json &j, const PreemptionVulnerability &o) {
j = nlohmann::json();
j = o.get_value();
}
void from_json(const nlohmann::json &j, PreemptionVulnerability &o) {}
void from_json(const nlohmann::json &j, PreemptionVulnerability &o) {
o.set_value(j.get<std::string>());
}
} // namespace oai::udr::model
} // namespace oai::udr::model
......@@ -47,7 +47,7 @@ namespace oai::udr::model {
///
/// </summary>
class PreemptionVulnerability {
public:
public:
PreemptionVulnerability();
virtual ~PreemptionVulnerability();
......@@ -59,9 +59,10 @@ public:
friend void to_json(nlohmann::json &j, const PreemptionVulnerability &o);
friend void from_json(const nlohmann::json &j, PreemptionVulnerability &o);
protected:
protected:
std::string value;
};
} // namespace oai::udr::model
} // namespace oai::udr::model
#endif /* PreemptionVulnerability_H_ */
......@@ -43,8 +43,10 @@ void SscMode::validate() {
// TODO: implement validation
}
void to_json(nlohmann::json &j, const SscMode &o) { j = nlohmann::json(); }
void to_json(nlohmann::json &j, const SscMode &o) { j = o.get_value(); }
void from_json(const nlohmann::json &j, SscMode &o) {}
void from_json(const nlohmann::json &j, SscMode &o) {
o.set_value(j.get<std::string>());
}
} // namespace oai::udr::model
} // namespace oai::udr::model
......@@ -47,7 +47,7 @@ namespace oai::udr::model {
///
/// </summary>
class SscMode {
public:
public:
SscMode();
virtual ~SscMode();
......@@ -59,9 +59,10 @@ public:
friend void to_json(nlohmann::json &j, const SscMode &o);
friend void from_json(const nlohmann::json &j, SscMode &o);
protected:
protected:
std::string value;
};
} // namespace oai::udr::model
} // namespace oai::udr::model
#endif /* SscMode_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment