https://github.com/dokempf/cerberus-cpp
YAML Validation library for C++
https://github.com/dokempf/cerberus-cpp
cpp validation validation-schema yaml
Last synced: 8 months ago
JSON representation
YAML Validation library for C++
- Host: GitHub
- URL: https://github.com/dokempf/cerberus-cpp
- Owner: dokempf
- License: mit
- Created: 2020-11-20T12:21:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T09:00:01.000Z (almost 2 years ago)
- Last Synced: 2025-02-02T06:51:10.455Z (over 1 year ago)
- Topics: cpp, validation, validation-schema, yaml
- Language: C++
- Homepage:
- Size: 158 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: COPYING.md
Awesome Lists containing this project
README
[](https://github.com/dokempf/cerberus-cpp/actions/workflows/ci.yml)
[](https://cerberus-cpp.readthedocs.io/en/latest/?badge=latest)
[](https://codecov.io/gh/dokempf/cerberus-cpp)
# What is cerberus-cpp
cerberus-cpp is a schema validation tool for YAML data written in C++.
It reimplements a subset of the schema validation of the Python tool [cerberus](https://github.com/pyeve/cerberus)
in the C++ language. This allows the same schemas to be used in Python
and C++ projects, as well as projects that mix these languages.
For YAML parsing, cerberus-cpp relies on the well-established [yaml-cpp](https://github.com/jbeder/yaml-cpp)
library.
# Core Features
* Simple, yet powerful definition of validation schema
* Validation of arbitrarily nested data
* Modern C++11 design
* Schema are implemented in the same language as the data - no DSLs to learn!
* Validation of schemas against a schema that is incrementally built from rules definitions
* Registration of custom validation and normalization rules
* Registration of custom types
* Compatibility with a well-established Python package
# Prerequisites
Cerberus-cpp is header-only, so it should be fairly easy to get up and running.
It requires the following software to be available:
* A C++14-compliant C++ compiler
* CMake >= 3.11
* The [yaml-cpp](https://github.com/jbeder/yaml-cpp) library version >= 0.6, e.g. by installing
the Debian/Ubuntu package `libyaml-cpp-dev`.
# Documentation
For usage examples, detailed instructions and an overview on the compatibility
with the Python package, check out the
[cerberus-cpp documentation](https://cerberus-cpp.readthedocs.io)