MQTTSuite
Loading...
Searching...
No Matches
id-ref.cpp File Reference
#include <nlohmann/json.hpp>
#include <nlohmann/json-schema.hpp>
#include <iostream>
Include dependency graph for id-ref.cpp:

Go to the source code of this file.

Classes

class  json_schema_validator

Functions

int main (void)

Variables

auto schema_draft
auto schema

Function Documentation

◆ main()

int main ( void )

Definition at line 135 of file id-ref.cpp.

136{
138
139 store.insert_schema(schema_draft, {{"#"}});
140
141 for (auto &i : store.schema_store_) {
142 std::cerr << i.first << " " << *i.second << "\n";
143 }
144
145 return 0;
146}
std::map< nlohmann::json_uri, const json * > schema_store_
Definition id-ref.cpp:93
void insert_schema(json &s, std::vector< nlohmann::json_uri > base_uris)
Definition id-ref.cpp:96
auto schema_draft
Definition id-ref.cpp:9

References json_schema_validator::insert_schema(), schema_draft, and json_schema_validator::schema_store_.

Here is the call graph for this function:

Variable Documentation

◆ schema

const json schema
Initial value:
= R"(
{
"id": "http://localhost:1234/scope_change_defs2.json",
"type" : "object",
"properties": {
"list": {"$ref": "#/definitions/baz/definitions/bar"}
},
"definitions": {
"baz": {
"id": "folder/",
"definitions": {
"bar": {
"type": "array",
"items": {"$ref": "folderInteger.json"}
}
}
}
}
})"_json

Definition at line 69 of file id-ref.cpp.

◆ schema_draft

auto schema_draft
Initial value:
= R"(
{
"$id": "http://example.com/root.json",
"definitions": {
"A": { "$id": "#foo" },
"B": {
"$id": "other.json",
"definitions": {
"X": { "$id": "#bar" },
"Y": { "$id": "t/inner.json" }
}
},
"C": {
"$id": "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f",
"definitions": {
"Z": { "$id": "#bar" },
"9": { "$id": "http://example.com/drole.json" }
}
}
}
}
)"_json

Definition at line 9 of file id-ref.cpp.

Referenced by main().