JSON input
Paste JSON, optionally name the root type, then generate.
Your C++ struct code will appear here.
Convert JSON into C++ structs using STL types. Get std::string, std::vector, std::optional, and nested structs with the needed includes.
Paste JSON, optionally name the root type, then generate.
Your C++ struct code will appear here.
The generator maps JSON types onto the standard library: strings to std::string, numbers to int or double, booleans to bool, arrays to std::vector, and uncertain fields to std::optional. The required #include lines are emitted at the top.
With nlohmann/json, deserialization is nearly automatic: define the structs, then call j.get