| 939 | |
| 940 | public: |
| 941 | numeric(const json &sch, root_schema *root, std::set<std::string> &kw) |
| 942 | : schema(root) |
| 943 | { |
| 944 | auto attr = sch.find("maximum"); |
| 945 | if (attr != sch.end()) { |
| 946 | maximum_ = {true, attr.value().get<T>()}; |
| 947 | kw.insert("maximum"); |
| 948 | } |
| 949 | |
| 950 | attr = sch.find("minimum"); |
| 951 | if (attr != sch.end()) { |
| 952 | minimum_ = {true, attr.value().get<T>()}; |
| 953 | kw.insert("minimum"); |
| 954 | } |
| 955 | |
| 956 | attr = sch.find("exclusiveMaximum"); |
| 957 | if (attr != sch.end()) { |
| 958 | exclusiveMaximum_ = true; |
| 959 | maximum_ = {true, attr.value().get<T>()}; |
| 960 | kw.insert("exclusiveMaximum"); |
| 961 | } |
| 962 | |
| 963 | attr = sch.find("exclusiveMinimum"); |
| 964 | if (attr != sch.end()) { |
| 965 | exclusiveMinimum_ = true; |
| 966 | minimum_ = {true, attr.value().get<T>()}; |
| 967 | kw.insert("exclusiveMinimum"); |
| 968 | } |
| 969 | |
| 970 | attr = sch.find("multipleOf"); |
| 971 | if (attr != sch.end()) { |
| 972 | multipleOf_ = {true, attr.value().get<json::number_float_t>()}; |
| 973 | kw.insert("multipleOf"); |
| 974 | } |
| 975 | } |
| 976 | }; |
| 977 | |
| 978 | class null : public schema |