Commit f1318266 authored by T.J. Corona's avatar T.J. Corona
Browse files

Fix resource link json serialization

parent cce49843
......@@ -21,16 +21,17 @@ namespace nlohmann
smtk::resource::detail::LinkBase adl_serializer<smtk::resource::detail::LinkBase>::from_json(
const json& j)
{
smtk::resource::Surrogate surrogate = smtk::resource::from_json(j);
smtk::resource::Surrogate surrogate = smtk::resource::from_json(j["surrogate"]);
smtk::resource::detail::LinkBase linkBase(std::move(surrogate));
smtk::common::from_json(j, static_cast<smtk::resource::Component::Links::Data&>(linkBase));
smtk::common::from_json(
j["linkData"], static_cast<smtk::resource::Component::Links::Data&>(linkBase));
return linkBase;
}
void adl_serializer<smtk::resource::detail::LinkBase>::to_json(
json& j, const smtk::resource::detail::LinkBase& linkBase)
{
smtk::resource::to_json(j, static_cast<const smtk::resource::Surrogate&>(linkBase));
smtk::common::to_json(j, static_cast<const smtk::resource::Component::Links::Data&>(linkBase));
j["surrogate"] = static_cast<const smtk::resource::Surrogate&>(linkBase);
j["linkData"] = static_cast<const smtk::resource::Component::Links::Data&>(linkBase);
}
}
......@@ -19,10 +19,10 @@ namespace resource
{
void to_json(json& j, const Surrogate& surrogate)
{
j["index"] = surrogate.index();
// j["index"] = surrogate.index();
j["type"] = surrogate.typeName();
j["id"] = surrogate.id();
j["location"] = surrogate.location();
// j["id"] = surrogate.id();
// j["location"] = surrogate.location();
}
Surrogate from_json(const json& j)
......
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