forked from sony/nmos-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjson_validator.h
36 lines (29 loc) · 972 Bytes
/
json_validator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef CPPREST_JSON_VALIDATOR_H
#define CPPREST_JSON_VALIDATOR_H
#include "cpprest/base_uri.h"
namespace web
{
namespace json
{
class value;
namespace experimental
{
// json validator implementation
namespace details
{
class json_validator_impl;
}
class json_validator
{
public:
// initialize for the specified base URIs using the specified loader
explicit json_validator(std::function<web::json::value(const web::uri&)> load_schema, const std::vector<web::uri>& ids = {});
// validate the specified instance with the schema identified by the specified base URI
void validate(const web::json::value& value, const web::uri& id = {}) const;
private:
std::shared_ptr<details::json_validator_impl> impl;
};
}
}
}
#endif