MQTTSuite
Loading...
Searching...
No Matches
anonymous_namespace{json-validator.cpp}::required Class Reference
Inheritance diagram for anonymous_namespace{json-validator.cpp}::required:
Collaboration diagram for anonymous_namespace{json-validator.cpp}::required:

Public Member Functions

 required (const std::vector< std::string > &r, root_schema *root)
 required (const std::vector< std::string > &r, root_schema *root)
Public Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
virtual ~schema ()=default
 schema (root_schema *root)
virtual const jsondefault_value (const json::json_pointer &, const json &, error_handler &) const
void set_default_value (const json &v)
virtual ~schema ()=default
 schema (root_schema *root)
virtual const jsondefault_value (const json::json_pointer &, const json &, error_handler &) const
void set_default_value (const json &v)

Private Member Functions

void validate (const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override final
void validate (const json::json_pointer &ptr, const json &instance, json_patch &, error_handler &e) const override final

Private Attributes

const std::vector< std::string > required_

Additional Inherited Members

Static Public Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
static std::shared_ptr< schemamake (json &schema, root_schema *root, const std::vector< std::string > &key, std::vector< nlohmann::json_uri > uris)
static std::shared_ptr< schemamake (json &schema, root_schema *root, const std::vector< std::string > &key, std::vector< nlohmann::json_uri > uris)
Protected Member Functions inherited from anonymous_namespace{json-validator.cpp}::schema
virtual std::shared_ptr< schemamake_for_default_ (std::shared_ptr<::schema > &, root_schema *, std::vector< nlohmann::json_uri > &, nlohmann::json &) const
virtual std::shared_ptr< schemamake_for_default_ (std::shared_ptr<::schema > &, root_schema *, std::vector< nlohmann::json_uri > &, nlohmann::json &) const
Protected Attributes inherited from anonymous_namespace{json-validator.cpp}::schema
root_schemaroot_
json default_value_ = nullptr

Detailed Description

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

Constructor & Destructor Documentation

◆ required() [1/2]

anonymous_namespace{json-validator.cpp}::required::required ( const std::vector< std::string > & r,
root_schema * root )
inline

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

1036 : schema(root), required_(r) {}
auto schema
Definition id-ref.cpp:69

References required_, and anonymous_namespace{json-validator.cpp}::schema::schema().

Here is the call graph for this function:

◆ required() [2/2]

anonymous_namespace{json-validator.cpp}::required::required ( const std::vector< std::string > & r,
root_schema * root )
inline

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

1036 : schema(root), required_(r) {}

Member Function Documentation

◆ validate() [1/2]

void anonymous_namespace{json-validator.cpp}::required::validate ( const json::json_pointer & ptr,
const json & instance,
json_patch & ,
error_handler & e ) const
inlinefinaloverrideprivatevirtual

Implements anonymous_namespace{json-validator.cpp}::schema.

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

1028 {
1029 for (auto &r : required_)
1030 if (instance.find(r) == instance.end())
1031 e.error(ptr, instance, "required property '" + r + "' not found in object as a dependency");
1032 }
virtual void error(const json::json_pointer &, const json &, const std::string &)=0
static const auto instance
Definition issue-93.cpp:14

References nlohmann::json_schema::error_handler::error(), and required_.

Here is the call graph for this function:

◆ validate() [2/2]

void anonymous_namespace{json-validator.cpp}::required::validate ( const json::json_pointer & ptr,
const json & instance,
json_patch & ,
error_handler & e ) const
inlinefinaloverrideprivatevirtual

Implements anonymous_namespace{json-validator.cpp}::schema.

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

1028 {
1029 for (auto &r : required_)
1030 if (instance.find(r) == instance.end())
1031 e.error(ptr, instance, "required property '" + r + "' not found in object as a dependency");
1032 }

Member Data Documentation

◆ required_

const std::vector< std::string > anonymous_namespace{json-validator.cpp}::required::required_
private

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

Referenced by required(), and validate().


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