MQTTSuite
Loading...
Searching...
No Matches
nlohmann::json_schema::json_validator Class Reference

#include <json-schema.hpp>

Collaboration diagram for nlohmann::json_schema::json_validator:

Public Member Functions

 json_validator (schema_loader=nullptr, format_checker=nullptr, content_checker=nullptr)
 json_validator (const json &, schema_loader=nullptr, format_checker=nullptr, content_checker=nullptr)
 json_validator (json &&, schema_loader=nullptr, format_checker=nullptr, content_checker=nullptr)
 json_validator (json_validator &&)
json_validatoroperator= (json_validator &&)
 json_validator (json_validator const &)=delete
json_validatoroperator= (json_validator const &)=delete
 ~json_validator ()
void set_root_schema (const json &)
void set_root_schema (json &&)
json validate (const json &) const
json validate (const json &, error_handler &, const json_uri &initial_uri=json_uri("#")) const

Private Attributes

std::unique_ptr< root_schemaroot_

Detailed Description

Definition at line 166 of file json-schema.hpp.

Constructor & Destructor Documentation

◆ json_validator() [1/5]

nlohmann::json_schema::json_validator::json_validator ( schema_loader loader = nullptr,
format_checker format = nullptr,
content_checker content = nullptr )

Definition at line 1457 of file json-validator.cpp.

1460 : root_(std::unique_ptr<root_schema>(new root_schema(std::move(loader),
1461 std::move(format),
1462 std::move(content))))
1463{
1464}
static void content(const std::string &contentEncoding, const std::string &contentMediaType, const json &instance)
std::unique_ptr< root_schema > root_
static void loader(const json_uri &uri, json &schema)

References root_, and nlohmann::json_schema::root_schema::root_schema().

Referenced by json_validator(), json_validator(), main(), main(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ json_validator() [2/5]

nlohmann::json_schema::json_validator::json_validator ( const json & schema,
schema_loader loader = nullptr,
format_checker format = nullptr,
content_checker content = nullptr )

Definition at line 1466 of file json-validator.cpp.

1470 : json_validator(std::move(loader),
1471 std::move(format),
1472 std::move(content))
1473{
1475}
json_validator(schema_loader=nullptr, format_checker=nullptr, content_checker=nullptr)
auto schema
Definition id-ref.cpp:69

References json_validator(), and set_root_schema().

Referenced by mqtt::bridge::lib::BridgeStore::loadAndValidate(), mqtt::lib::JsonMappingReader::readMappingFromFile(), should_throw(), and nlohmann::json_patch::validateJsonPatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ json_validator() [3/5]

nlohmann::json_schema::json_validator::json_validator ( json && schema,
schema_loader loader = nullptr,
format_checker format = nullptr,
content_checker content = nullptr )

Definition at line 1477 of file json-validator.cpp.

1482 : json_validator(std::move(loader),
1483 std::move(format),
1484 std::move(content))
1485{
1486 set_root_schema(std::move(schema));
1487}

References json_validator(), and set_root_schema().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ json_validator() [4/5]

nlohmann::json_schema::json_validator::json_validator ( json_validator && )
default

◆ json_validator() [5/5]

nlohmann::json_schema::json_validator::json_validator ( json_validator const & )
delete

◆ ~json_validator()

nlohmann::json_schema::json_validator::~json_validator ( )
default

Member Function Documentation

◆ operator=() [1/2]

json_validator & nlohmann::json_schema::json_validator::operator= ( json_validator && )
default

◆ operator=() [2/2]

json_validator & nlohmann::json_schema::json_validator::operator= ( json_validator const & )
delete

◆ set_root_schema() [1/2]

void nlohmann::json_schema::json_validator::set_root_schema ( const json & schema)

Definition at line 1495 of file json-validator.cpp.

1496{
1497 root_->set_root_schema(schema);
1498}

References root_, and nlohmann::json_schema::root_schema::set_root_schema().

Referenced by json_validator(), main(), main(), main(), and anonymous_namespace{issue-105-verbose-combination-errors.cpp}::validate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_root_schema() [2/2]

void nlohmann::json_schema::json_validator::set_root_schema ( json && schema)

Definition at line 1500 of file json-validator.cpp.

1501{
1502 root_->set_root_schema(std::move(schema));
1503}

References root_, and nlohmann::json_schema::root_schema::set_root_schema().

Referenced by json_validator().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate() [1/2]

json nlohmann::json_schema::json_validator::validate ( const json & instance) const

Definition at line 1505 of file json-validator.cpp.

1506{
1507 throwing_error_handler err;
1508 return validate(instance, err);
1509}
static const auto instance
Definition issue-93.cpp:14

References validate().

Referenced by mqtt::bridge::lib::BridgeStore::loadAndValidate(), main(), main(), anonymous_namespace{issue-105-verbose-combination-errors.cpp}::validate(), and nlohmann::json_patch::validateJsonPatch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate() [2/2]

json nlohmann::json_schema::json_validator::validate ( const json & instance,
error_handler & err,
const json_uri & initial_uri = json_uri("#") ) const

Definition at line 1511 of file json-validator.cpp.

1512{
1513 json::json_pointer ptr;
1514 json_patch patch;
1515 root_->validate(ptr, instance, patch, err, initial_uri);
1516 return patch;
1517}

References root_, and nlohmann::json_schema::root_schema::validate().

Referenced by main(), main(), main(), anonymous_namespace{issue-105-verbose-combination-errors.cpp}::validate(), and validate().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ root_

std::unique_ptr<root_schema> nlohmann::json_schema::json_validator::root_
private

Definition at line 168 of file json-schema.hpp.

Referenced by json_validator(), set_root_schema(), set_root_schema(), and validate().


The documentation for this class was generated from the following files: