Condionally serialize or deserialize JSON #2272
-
First, thank you all for this great library. I am using it to de/serialize data from JSON and up to now it was a regular use case: do it all. But now I need to do it conditionally based in some data attribute classification. This data is a large nested C++ struct and I need to control if I should do to_json and from_json for each one of my attribute types. My first approach was to separate each needed combination in different namespaces and explicitly call the dump/parse that I want. It worked for two types of attributes, now I need to do it for three. My question ... what is the best approach to do it? More context : my attributes types are for a sofware API and could be classified in: CONFIG, NOCONF, FACTORY_CONFIG |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
In order to asses your issue, we need the following information:
|
Beta Was this translation helpful? Give feedback.
In order to asses your issue, we need the following information:
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
What is the expected behavior?
And what is the actual behavior instead?