will json parse works for JSON schema inheritance #2246
Answered
by
nlohmann
praveensoma
asked this question in
Q&A
-
for example i have base.json with one std::string in it. if i include it in derive.json and convert to c++ using quicktype. what's happening is class Id {
public:
Id() = default;
virtual ~Id() = default;
private:
std::string _id;
public:
const std::string & get_id() const { return _id; }
std::string & get_mutable_id() { return _id; }
void set_id(const std::string & value) { this->_id = value; }
};
class Derived{
public:
Derived() = default;
virtual ~Derived() = default;
private:
Id m_id;
public:
const Id & get_id() const { return m_id; }
Id & get_mutable_id() { return m_id; }
void set_id(const Id & value) { this->m_id = value; }
}; what is the correct JSON object format for Derived class |
Beta Was this translation helpful? Give feedback.
Answered by
nlohmann
Jul 7, 2020
Replies: 1 comment 6 replies
-
I am not sure what you want to achieve. |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
nlohmann
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am not sure what you want to achieve.