-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Main Goal:
To provide end users with flexible data output options, we need to implement robust data serialization capabilities for various common formats. This task focuses specifically on building the C++ components responsible for converting our internal data representation into these external formats.
Scope of this Issue:
This issue is focused solely on the implementation of serializers for the specified data response formats. It assumes that:
- A stable, canonical internal C++ data representation (e.g., a specific
struct,std::map, or aVarianttype) for the data to be serialized is already defined and available. - The overall C++ project structure and build system (e.g., CMake) are already set up and can accommodate new C++ modules/libraries.
- Any core service integration will be handled in separate tasks after these serializers are implemented and tested.
Formats to Implement:
- JSON (JavaScript Object Notation)
- Official JSON docs
- More docs here: RFC 8259
- BSON (Binary JSON)
- XML (Extensible Markup Language)
- YAML (YAML Ain't Markup Language)
- CSV (Comma Separated Values)
Acceptance Criteria:
- For each listed data format, a dedicated C++ serialization component (e.g., a class, a function, or a set of functions) is implemented.
- Each serializer correctly converts the agreed-upon internal C++ data structure into the respective external format.
- The output for each format strictly adheres to its official specification.
- Appropriate, well-regarded, and performant third-party C++ libraries are identified, integrated, and utilized for each format where applicable (or a rationale provided for custom implementation).
- Comprehensive unit tests are written for each serializer to ensure correctness across various data scenarios (e.g., empty values, nested structures, different data types).
- Error handling is considered for serialization failures (e.g., invalid input, library issues).
- Basic usage examples are provided for each implemented serializer.
Work Plan / Tasks:
-
[ ] 1. Research & Library Selection:
- For each format (JSON, BSON, XML, YAML, CSV), research and propose the most suitable C++ serialization library. Include a brief justification for each choice.
- Integrate the selected libraries into the project's build system (e.g., CMake).
-
[ ] 2. Implement JSON Serialization:
- Develop C++ code to serialize the internal data representation into JSON.
- Create unit tests for JSON serialization, covering various data types and structures.
-
[ ] 3. Implement BSON Serialization:
- Develop C++ code to serialize the internal data representation into BSON.
- Create unit tests for BSON serialization.
-
[ ] 4. Implement XML Serialization:
- Develop C++ code to serialize the internal data representation into XML.
- Create unit tests for XML serialization, including handling attributes and different element structures.
-
[ ] 5. Implement YAML Serialization:
- Develop C++ code to serialize the internal data representation into YAML.
- Create unit tests for YAML serialization.
-
[ ] 6. Implement CSV Serialization:
- Develop C++ code to serialize the internal data representation into CSV.
- Create unit tests for CSV serialization, considering delimiters, quoting, and row/column handling.
-
[ ] 7. Documentation & Examples:
- Provide internal documentation on how to use each implemented serializer.
- Create small, runnable code examples demonstrating the use of each serializer with sample data.