24#ifndef SQL_JSON_SCHEMA_H_INCLUDED
25#define SQL_JSON_SCHEMA_H_INCLUDED
145 const char *json_schema_str,
146 size_t json_schema_length,
173 size_t json_schema_length,
177 bool is_valid(
const char *document_str,
size_t document_length,
Error handler to be used when parsing JSON schemas and validating JSON objects using a JSON schema.
Definition: json_error_handler.h:79
Json_schema_validation_report contains a more detailed report about a failed JSON Schema validation.
Definition: json_schema.h:72
const std::string & schema_location() const
Definition: json_schema.h:81
const std::string & document_location() const
Definition: json_schema.h:95
std::string m_schema_location
Definition: json_schema.h:116
std::string human_readable_reason() const
Definition: json_schema.cc:296
const std::string & schema_failed_keyword() const
Definition: json_schema.h:87
std::string m_document_location
Definition: json_schema.h:118
void set_error_report(std::string &&schema_location, const char *schema_failed_keyword, std::string &&document_location)
Populates the object with validation information.
Definition: json_schema.h:107
std::string m_schema_failed_keyword
Definition: json_schema.h:117
Json_schema_validator_impl is an object that contains a JSON Schema that can be re-used multiple time...
Definition: json_schema.cc:49
This is just a facade to the Json_schema_validator and it is used to hide the dependency on the rapid...
Definition: json_schema.h:155
Json_schema_validator_impl * m_json_schema_validator
Definition: json_schema.h:157
bool is_valid(const char *document_str, size_t document_length, const JsonSchemaErrorHandler &error_handler, const JsonErrorHandler &depth_handler, bool *is_valid, Json_schema_validation_report *report) const
Definition: json_schema.cc:199
~Json_schema_validator()
Definition: json_schema.cc:209
bool initialize(MEM_ROOT *mem_root, const char *json_schema_str, size_t json_schema_length, const JsonSchemaErrorHandler &error_handler, const JsonErrorHandler &depth_handler)
Initialize a Json_schema_validator_impl, allocated on a given MEM_ROOT.
Definition: json_schema.cc:184
bool is_initialized() const
Definition: json_schema.h:181
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
std::function< void()> JsonErrorHandler
Definition: json_error_handler.h:36
bool is_valid_json_schema(const char *document_str, size_t document_length, const char *json_schema_str, size_t json_schema_length, const JsonSchemaErrorHandler &error_handler, const JsonErrorHandler &depth_handler, bool *is_valid, Json_schema_validation_report *report)
This function will validate a JSON document against a JSON Schema using the validation provided by ra...
Definition: json_schema.cc:162
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
bool is_valid(const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *is_valid) noexcept
Decides if a geometry is valid.
Definition: is_valid.cc:95
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83