|
@@ -65,9 +65,7 @@ private:
|
|
|
{"exclusiveMaximum", {{schema::Version::Draft06, &Self::exclusiveMaximum}}},
|
|
{"exclusiveMaximum", {{schema::Version::Draft06, &Self::exclusiveMaximum}}},
|
|
|
{"exclusiveMinimum", {{schema::Version::Draft06, &Self::exclusiveMinimum}}},
|
|
{"exclusiveMinimum", {{schema::Version::Draft06, &Self::exclusiveMinimum}}},
|
|
|
{"format",
|
|
{"format",
|
|
|
- {{schema::Version::Draft04, &Self::warnUnimplemented},
|
|
|
|
|
- {schema::Version::Draft2020_12, nullptr}}},
|
|
|
|
|
- {"format-assertion", {{schema::Version::Draft2020_12, &Self::fatalUnimplemented}}},
|
|
|
|
|
|
|
+ {{schema::Version::Draft04, &Self::format}, {schema::Version::Draft2020_12, nullptr}}},
|
|
|
{"if", {{schema::Version::Draft07, &Self::ifThenElse}}},
|
|
{"if", {{schema::Version::Draft07, &Self::ifThenElse}}},
|
|
|
{"items",
|
|
{"items",
|
|
|
{{schema::Version::Draft04, &Self::itemsTupleOrVector},
|
|
{{schema::Version::Draft04, &Self::itemsTupleOrVector},
|
|
@@ -150,15 +148,6 @@ public:
|
|
|
|
|
|
|
|
// SECTION: Untyped Constraints
|
|
// SECTION: Untyped Constraints
|
|
|
|
|
|
|
|
- static pConstraint warnUnimplemented(detail::ParserContext<A> const & context) {
|
|
|
|
|
- std::cerr << "Unimplemented constraint " << context.where << "\n";
|
|
|
|
|
- return nullptr;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- static pConstraint fatalUnimplemented(detail::ParserContext<A> const & context) {
|
|
|
|
|
- JVALIDATE_THROW(std::runtime_error, "Unimplemented constraint " << context.where);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
static auto type(detail::ParserContext<A> const & context) {
|
|
static auto type(detail::ParserContext<A> const & context) {
|
|
|
static std::unordered_map<std::string_view, adapter::Type> const s_type_names{
|
|
static std::unordered_map<std::string_view, adapter::Type> const s_type_names{
|
|
|
{"null", adapter::Type::Null}, {"boolean", adapter::Type::Boolean},
|
|
{"null", adapter::Type::Null}, {"boolean", adapter::Type::Boolean},
|
|
@@ -314,6 +303,10 @@ public:
|
|
|
return std::make_unique<constraint::PatternConstraint>(context.schema.as_string());
|
|
return std::make_unique<constraint::PatternConstraint>(context.schema.as_string());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ static auto format(detail::ParserContext<A> const & context) {
|
|
|
|
|
+ return std::make_unique<constraint::FormatConstraint>(context.schema.as_string());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// SECTION: Array Constraints
|
|
// SECTION: Array Constraints
|
|
|
|
|
|
|
|
static auto contains(detail::ParserContext<A> const & context) {
|
|
static auto contains(detail::ParserContext<A> const & context) {
|