You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a method to CSVRow that converts it to a valid JSON string.
Strings should contain minimal whitespace
Characters that have special meaning in JSON need to be escaped properly
Method should throw an error if non-Unicode characters are found
Add unit tests for above method
For example, if there's a row with column names "Artist" and "Album" with entries "Florida Georgia Line" and "Here's To The Good Times" respectively, then the output should be
{"Artist":"Florida Georgia Line","Album":"Here's To The Good Times"}
Suggestions
We may consider using another C++ library to handle JSON serializing instead of implementing it ourselves. That library can then be added as an optional dependency, e.g. users will need to have that library to use JSON serialization. For unit tests, that library can be included under the /tests/ directory.
Requirements
CSVRow
that converts it to a valid JSON string.For example, if there's a row with column names "Artist" and "Album" with entries "Florida Georgia Line" and "Here's To The Good Times" respectively, then the output should be
Suggestions
We may consider using another C++ library to handle JSON serializing instead of implementing it ourselves. That library can then be added as an optional dependency, e.g. users will need to have that library to use JSON serialization. For unit tests, that library can be included under the
/tests/
directory.Suggested library: https://github.com/nlohmann/json
References
The text was updated successfully, but these errors were encountered: