File: make_schema.md

package info (click to toggle)
jsoncons 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 17,584 kB
  • sloc: cpp: 136,382; sh: 33; makefile: 5
file content (49 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
### jsoncons::jsonschema::make_schema: 
(deprecated since 0.174.0) 
(removed in 1.0.0)

```cpp
#include <jsoncons_ext/jsonschema/jsonschema.hpp>

template <typename Json>
std::shared_ptr<json_schema<Json>> make_schema(const Json& schema);  (1)

template <typename Json>
std::shared_ptr<json_schema<Json>> make_schema(const Json& schema,
    const std::string& retrieval_uri);                               (2) (since 0.173.0)

template <typename Json,typename SchemaResolver>
std::shared_ptr<json_schema<Json>> make_schema(const Json& schema,
    const std::string& retrieval_uri, const SchemaResolver& resolver);    (3) (since 0.173.0)

template <typename Json,typename SchemaResolver>
std::shared_ptr<json_schema<Json>> make_schema(const Json& schema, 
    const SchemaResolver& resolver);                                      (4)
```

Returns a `shared_ptr` to a `json_schema<Json>`.

#### Parameters

<table>
  <tr>
    <td>schema</td>
    <td>JSON Schema</td> 
  </tr>
  <tr>
    <td>resolver</td>
    <td>A function object with the signature of <code>resolver</code> being equivalent to 
    <pre>
    Json fun(const <a href="../corelib/utility/uri.md">jsoncons::uri</a>& uri);</pre></td>   
  </tr>
</table>

#### Return value

Returns a `shared_ptr` to a `json_schema<Json>`.

#### Exceptions

(1)-(2) Throws a [schema_error](schema_error.md) if JSON Schema compilation fails.