I am writing a python script that transforms the object to JSON format. I've tried with the jsonpickle and also the jsondumps. But they don't seem to work.
jsonpickle says that "Pickling of instances is not enabled" and jsondumps says that "the object is not serializable".
I am exposing this in boost::python from C++, so here is the Object Model in C++:
struct Hosts {
std::string hostName;
bool isProvider;
bool showVM;
std::vector<std::string> vmList;
bool operator==(Hosts const& h) const { return h.hostName == hostName; }
};
How do I convert the object to JSON?