NLOHMANN JSON LIBRARY#

This module is dedicated to implementing the Trustable Software Framework for the Niels Lohmann JSON Library. Initially, it emphasizes ensuring the reliability and correctness of the library’s parsing functionality. The Niels Lohmann JSON Library is recognized for its efficient and straightforward approach to JSON parsing, manipulation, and serialization within modern C++ applications, aiming to provide developers with a flexible and robust tool for managing JSON data structures. The framework seeks to enhance these capabilities, aligning them with rigorous software quality standards to ensure dependable JSON processing across diverse applications.

Overview#

This repository provides the aspired setup for projects using C++ and Bazel as a build system.

General Requirements#

JSON Validation
status: valid
security: NO
safety: ASIL_B
status: valid
reqtype: Functional
safety: ASIL_B
security: NO
satisfies: feat_req__baselibs__json_library

The JSON-Library provides a service to check the well-formedness of JSON data.

JSON Deserialization
status: valid
security: NO
safety: ASIL_B
status: valid
reqtype: Functional
safety: ASIL_B
security: NO
satisfies: feat_req__baselibs__json_library

The JSON-Library parses JSON data according to RFC8259.

User friendly API for information exchange#

Support for programming language idioms
status: valid
security: NO
safety: QM
status: valid
reqtype: Non-Functional
safety: QM
security: NO
satisfies: feat_req__baselibs__json_library

Each public API supports the idioms of its programming language.

Use programming language infrastructure
status: valid
security: NO
safety: QM
status: valid
reqtype: Non-Functional
safety: QM
security: NO
satisfies: feat_req__baselibs__json_library

Each public API uses core infrastructure of its programming language and accompanying standard libraries, whenever possible and meaningful.

Note: This includes error handling.

Full testability for the user facing API#

Fully mockable public API
status: valid
security: NO
safety: QM
status: valid
reqtype: Non-Functional
safety: QM
security: NO
satisfies: feat_req__baselibs__json_library

The public API is fully mockable.

Safety Impact#

JSON library ASIL level
status: valid
security: YES
safety: ASIL_B
status: valid
reqtype: Functional
safety: ASIL_B
security: YES
satisfies: feat_req__baselibs__json_library

The JSON library supports safe communication up to ASIL-B.

Project Layout#

This module includes the following top-level structure:

  • nlohmann_json/include/: C++ source code for the NLOHMANN JSON library

  • nlohmann_json/tests/: Unit and integration tests

  • docs/: Documentation using docs-as-code

  • .github/workflows/: CI/CD pipelines

Quick Start#

To build the module:

bazel build

To run tests:

git submodule init
git submodule update
bazel test //nlohmann_json/tests/src:all_nlohmann_tests --test_output=all

To update the documentation:

bazel run //docs:incremental
python3 -m http.server --directory _build

To generate LaTeX documentation:

apt-get install texlive texlive-latex-extra texlive-fonts-recommended
sphinx-build -b latex . _build/latex
cd _build/latex
pdflatex nlohmannjsonlibrary.tex