Lightweight JSON wrapper for persistent config management using StorageManager. More...
Go to the source code of this file.
Classes | |
class | JsonService |
Manages loading and saving of a single JSON document using StorageManager. More... | |
Functions | |
nlohmann::json | mergeDefaults (const nlohmann::json &target, const nlohmann::json &defaults) |
Merge a default JSON structure into a target, preserving existing keys. | |
Part of the PicoFramework application framework. Provides convenience access to a JSON document that can be loaded from and saved to storage. Also supports aliases and direct access to internal nlohmann::json
object.
Definition in file JsonService.h.
nlohmann::json mergeDefaults | ( | const nlohmann::json & | target, |
const nlohmann::json & | defaults | ||
) |
For nested objects, recursion is applied. Used to safely inject default values into config data.
target | Target JSON object to merge into. |
defaults | Default values to apply where keys are missing. |
Merge a default JSON structure into a target, preserving existing keys.
Merge a default JSON structure into a target, preserving existing keys.
Definition at line 26 of file JsonService.cpp.
References mergeDefaults().
Referenced by mergeDefaults().