getml / reflect-cpp

A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, BSON, CBOR, flexbuffers, msgpack, TOML, XML, YAML / msgpack.org[C++20]
https://getml.github.io/reflect-cpp/
MIT License
901 stars 76 forks source link

YAML support, possibly by using fkYAML #23

Closed liuzicheng1987 closed 7 months ago

liuzicheng1987 commented 8 months ago

reflect-cpp could use YAML support. YAML is often used to write configurations files and it would be nice to read those in with reflect-cpp.

There is a Reddit user who has developed this YAML library: https://github.com/fktn-k/fkYAML. The code quality seems very high, the documentation is great, even though the project is in its early stages. He is very enthusiastic about the idea of us using this. Of course, there are other libraries out there, so the first task should be to find a good library to interface.

Generally speaking, any serialization format can be integrated by implementing the IsReader and IsWriter concepts, which are documented here: https://github.com/getml/reflect-cpp/blob/main/docs/supporting_your_own_format.md. Since there are several YAML libraries out there, you should only pick libraries for which it is easy to implement these interfaces. Other criteria are code quality and speed.

You should implement tests for this, in the same way the tests are set up for flexbuffers - by providing a Dockerfile that contains a reproducible environment in which the tests can be compiled and run:

https://github.com/getml/reflect-cpp/tree/main/tests/flexbuffers

liuzicheng1987 commented 8 months ago

This library also looks like a strong candidate:

https://github.com/jbeder/yaml-cpp