Closed wicast closed 1 month ago
This is currently unsupported, but it shouldn't be hard to do.
I actually haven't used this feature with serde. I think the syntax could look like this:
struct Person {
std::string first_name;
std::string last_name;
int age;
rfl::Skip<std::string> town;
};
This would prevent the field from being skipped during serialization and deserialization. We could also include rfl::SkipSerialializing
and rfl::SkipDeserializing
, just like serde.
@wicast , there is a draft in this branch:
https://github.com/getml/reflect-cpp/tree/f/skip
It's not documented yet, but it basically works as we discussed:
https://github.com/getml/reflect-cpp/blob/f/skip/tests/json/test_skip.cpp
What do you think? Is this what you wanted?
Good enough for me, thank you.
I want to skip fields like: https://serde.rs/attr-skip-serializing.html