MCPcopy Create free account
hub / github.com/pboettch/json-schema-validator / boolean

Class boolean

src/json-validator.cpp:1000–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998};
999
1000class boolean : public schema
1001{
1002 bool true_;
1003 void validate(const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override
1004 {
1005 if (!true_) { // false schema
1006 // empty array
1007 // switch (instance.type()) {
1008 // case json::value_t::array:
1009 // if (instance.size() != 0) // valid false-schema
1010 // e.error(ptr, instance, "false-schema required empty array");
1011 // return;
1012 //}
1013
1014 e.error(ptr, instance, "instance invalid as per false-schema");
1015 }
1016 }
1017
1018public:
1019 boolean(json &sch, root_schema *root)
1020 : schema(root), true_(sch) {}
1021};
1022
1023class required : public schema
1024{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected