MQTTSuite
Loading...
Searching...
No Matches
issue-229-oneof-default-values.cpp File Reference
#include <iostream>
#include <nlohmann/json-schema.hpp>
Include dependency graph for issue-229-oneof-default-values.cpp:

Go to the source code of this file.

Functions

static void loader (const json_uri &uri, json &schema)
int main (void)

Variables

static const json default_schema

Function Documentation

◆ loader()

void loader ( const json_uri & uri,
json & schema )
static

Definition at line 40 of file issue-229-oneof-default-values.cpp.

41{
43}
auto schema
Definition id-ref.cpp:69
static const json default_schema

References default_schema.

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( void )

Definition at line 45 of file issue-229-oneof-default-values.cpp.

46{
48
49 validator.set_root_schema(default_schema);
50
51 json data = R"({"name": "bar"})"_json;
52 json expected = R"(
53 [
54 {
55 "op": "add",
56 "path": "/code",
57 "value": 2
58 }
59 ]
60 )"_json;
61
nlohmann::json_schema::json_validator validator
nlohmann::json json
static void loader(const json_uri &uri, json &schema)

References default_schema, nlohmann::json_schema::json_validator::json_validator(), loader(), nlohmann::json_schema::json_validator::set_root_schema(), and nlohmann::json_schema::json_validator::validate().

Here is the call graph for this function:

Variable Documentation

◆ default_schema

const json default_schema
static

Definition at line 8 of file issue-229-oneof-default-values.cpp.

Referenced by loader(), and main().