Go to the documentation of this file. 1#include <nlohmann/json-schema.hpp>
8{
9 "$schema": "http://json-schema.org/draft-07/schema#",
10 "$id": "arc.schema.json",
11 "properties": {
12 "angle": {
13 "type": "number",
14 "description": "Radians, from -π to π.",
15 "minimum": -3.14159265358979323846,
16 "maximum": 3.14159265358979323846
17 }
18 }
19})"_json;
23 void error(
const nlohmann::json::json_pointer &ptr,
const json &instance,
const std::string &message)
override
25 if (message !=
"instance exceeds maximum of 3.141592653589793")
26 throw std::invalid_argument(
"Precision print does not work.");
34 auto instance = R"({ "angle": 3.1415927410125732 })"_json;
void error(const nlohmann::json::json_pointer &ptr, const json &instance, const std::string &message) override
void set_root_schema(const json &)
json validate(const json &, error_handler &, const json_uri &initial_uri=json_uri("#")) const