Xiangiqgame
AI engine for Xiangqi
Loading...
Searching...
No Matches
json_schema_validate.cpp File Reference

json validation gist, unused by rest of project, but keeping here for reference. More...

#include <iostream>
#include <iomanip>
#include <nlohmann/json-schema.hpp>
Include dependency graph for json_schema_validate.cpp:

Go to the source code of this file.

Functions

int main ()
 

Variables

static json person_schema
 
static json bad_person = {{"age", 42}}
 
static json good_person = {{"name", "Albert"}, {"age", 42}}
 

Detailed Description

json validation gist, unused by rest of project, but keeping here for reference.


Definition in file json_schema_validate.cpp.

Function Documentation

◆ main()

int main ( )

Definition at line 42 of file json_schema_validate.cpp.

Variable Documentation

◆ bad_person

json bad_person = {{"age", 42}}
static

Definition at line 39 of file json_schema_validate.cpp.

◆ good_person

json good_person = {{"name", "Albert"}, {"age", 42}}
static

Definition at line 40 of file json_schema_validate.cpp.

◆ person_schema

json person_schema
static
Initial value:
= R"(
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "A person",
"properties": {
"name": {
"description": "Name",
"type": "string"
},
"age": {
"description": "Age of the person",
"type": "number",
"minimum": 2,
"maximum": 200
}
},
"required": [
"name",
"age"
],
"type": "object"
}
)"_json

Definition at line 13 of file json_schema_validate.cpp.