Plugins
json_schema_validator.hpp
Go to the documentation of this file.
1
/*
2
* JSON schema validator for JSON for modern C++
3
*
4
* Copyright (c) 2016-2019 Patrick Boettcher <p@yai.se>.
5
*
6
* SPDX-License-Identifier: MIT
7
*
8
*/
9
10
#ifndef __H__UG__JSON_SCHEMA_VALIDATOR_HPP__
11
#define __H__UG__JSON_SCHEMA_VALIDATOR_HPP__
12
13
#include <nlohmann/json-schema.hpp>
14
15
#include <fstream>
16
#include <iostream>
17
18
#include "
ug.h
"
19
#include "
common/error.h
"
20
#include "
common/log.h
"
21
#include "
common/util/smart_pointer.h
"
22
23
24
25
26
27
28
29
namespace
ug
30
{
31
namespace
JSONToolkit
32
{
33
34
struct
JSONSchemaValidator
:
public
nlohmann::json_schema::json_validator
35
{
36
37
typedef
nlohmann::json_schema::json_validator
base_type
;
38
39
JSONSchemaValidator
();
40
41
~JSONSchemaValidator
(){};
42
44
void
init
(nlohmann::json& schema);
45
47
bool
validate_document
(nlohmann::json& document);
48
49
};
50
51
}
// namespace JSONToolkit
52
53
}
// namespace ug
54
55
#endif
// __H__UG__JSON_SCHEMA_VALIDATOR_HPP__
error.h
log.h
ug
smart_pointer.h
ug::JSONToolkit::JSONSchemaValidator
Definition:
json_schema_validator.hpp:35
ug::JSONToolkit::JSONSchemaValidator::validate_document
bool validate_document(nlohmann::json &document)
Do the actual validation of the document.
Definition:
json_schema_validator.cpp:68
ug::JSONToolkit::JSONSchemaValidator::~JSONSchemaValidator
~JSONSchemaValidator()
Definition:
json_schema_validator.hpp:41
ug::JSONToolkit::JSONSchemaValidator::base_type
nlohmann::json_schema::json_validator base_type
Definition:
json_schema_validator.hpp:37
ug::JSONToolkit::JSONSchemaValidator::JSONSchemaValidator
JSONSchemaValidator()
Definition:
json_schema_validator.cpp:48
ug::JSONToolkit::JSONSchemaValidator::init
void init(nlohmann::json &schema)
Set root.
Definition:
json_schema_validator.cpp:53
ug.h
plugins
JSONToolkit
src
json_schema_validator.hpp
Generated on Mon Dec 23 2024 01:11:23 for Plugins by
1.9.1