| 998 | }; |
| 999 | |
| 1000 | class 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 | |
| 1018 | public: |
| 1019 | boolean(json &sch, root_schema *root) |
| 1020 | : schema(root), true_(sch) {} |
| 1021 | }; |
| 1022 | |
| 1023 | class required : public schema |
| 1024 | { |
nothing calls this directly
no outgoing calls
no test coverage detected