Ajout du validateur json + correctif factory metadata
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
add_test_simple_schema(Issue::209
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/entities.schema.json
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/instance.json)
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://example.invalid/color.schema.json",
|
||||
"title": "color",
|
||||
"description": "X11/HTML/CSS color name as a JSON string",
|
||||
"type": "string",
|
||||
"enum": [ "White", "Black", "Red" ]
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "https://example.invalid/entities.schema.json",
|
||||
"title": "Entities",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": [ "name" ],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"fg": { "$ref": "color.schema.json", "default": "Black" }
|
||||
}
|
||||
}
|
||||
}
|
||||
10
lib/All/json-schema-validator/test/issue-209/instance.json
Normal file
10
lib/All/json-schema-validator/test/issue-209/instance.json
Normal file
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"name": "player",
|
||||
"fg": "White"
|
||||
},
|
||||
{
|
||||
"name": "enemy",
|
||||
"fg": "Red"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user