beached / daw_json_link

Fast, convenient JSON serialization and parsing in C++
https://beached.github.io/daw_json_link/
Boost Software License 1.0
475 stars 31 forks source link

Allow for tagged_variant root class parsing #198

Closed beached closed 3 years ago

beached commented 3 years ago

This is more generally said that a single sub member can describe the structure of the others.


struct ConfigV1 {
  string option1;
};

struct ConfigV2 {
  vector<string> option1;
};

The JSON document can have a mapped/non-mapped member that allows us to know which alternative to parse to.

beached commented 3 years ago

Implemented with https://github.com/beached/daw_json_link/commit/53910a4c9ab03b5f8b2537a123b8ec2ecb044fcb