|
|
@@ -274,16 +274,6 @@ template <typename T> inline bool ctor_as_valid(std::string_view str) {
|
|
|
return true;
|
|
|
} catch (std::exception const &) { return false; }
|
|
|
}
|
|
|
-
|
|
|
-inline bool json_pointer(std::string_view ptr) {
|
|
|
- if (not ptr.empty() && not ptr.starts_with('/')) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- try {
|
|
|
- [[maybe_unused]] ::jvalidate::detail::Pointer _{ptr};
|
|
|
- return true;
|
|
|
- } catch (std::exception const & ex) { return false; }
|
|
|
-}
|
|
|
}
|
|
|
|
|
|
namespace jvalidate {
|
|
|
@@ -305,7 +295,7 @@ private:
|
|
|
{"ipv6", &format::ipv6},
|
|
|
{"iri", nullptr},
|
|
|
{"iri-reference", nullptr},
|
|
|
- {"json-pointer", &format::json_pointer},
|
|
|
+ {"json-pointer", &format::ctor_as_valid<detail::Pointer>},
|
|
|
{"relative-json-pointer", &format::ctor_as_valid<detail::RelativePointer>},
|
|
|
{"regex", nullptr},
|
|
|
{"time", &format::time},
|