4 ms·
> - What is the best way to map objects to/from JSON? - What is the best way to map objects to/from a database? I'd recommend using the JSON to generate your s
by chimeracoder 9y ago
> - What is the best way to map objects to/from JSON? - What is the best way to map objects to/from a database?
I'd recommend using the JSON to generate your struct definitions, in a schema-like fashion. I wrote a tool to automate that process: https://github.com/ChimeraCoder/gojson https://github.com/ChimeraCoder/gojson
I use this as a step in the build system for the projects, which ensures that the definitions stay in sync with the API clients/servers themselves.