blob: d7ab38f2944607c23d0a502fe8852b3ed92d71d2 [file] [log] [blame]
Patrick Venture5426c342019-02-11 12:03:30 -08001#pragma once
2
3#include <nlohmann/json.hpp>
Patrick Venturea83a3ec2020-08-04 09:52:05 -07004
Patrick Venture5426c342019-02-11 12:03:30 -08005#include <string>
6
7using json = nlohmann::json;
8
9/**
10 * Given json data, validate the minimum.
11 * The json data must be valid, and must contain two keys:
12 * sensors, and zones.
13 *
14 * @param[in] data - the json data.
15 * @return nothing - throws exceptions on invalid bits.
16 */
17void validateJson(const json& data);
18
19/**
20 * Given a json configuration file, parse it.
21 *
22 * There must be at least one sensor, and one zone.
23 * That one zone must contain at least one PID.
24 *
25 * @param[in] path - path to the configuration
26 * @return the json data.
27 */
28json parseValidateJson(const std::string& path);