Adding many items to the JSON parser

This commit is contained in:
2026-05-24 15:26:11 +02:00
parent 8791a2e3f3
commit 2a5e0bebd4

View File

@@ -1,4 +1,6 @@
{ {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": { "$defs": {
"config_file":{ "config_file":{
"desciption": "The list of the configuration files", "desciption": "The list of the configuration files",
@@ -8,61 +10,114 @@
} }
}, },
"items":{
"properties": {
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean" },
"execute_on_stop":{ "type": "boolean" },
"skipped":{ "type": "boolean" },
"no_fail":{ "type": "boolean" },
"doc":{ "type": "string" },
"key":{ "type": "string" },
"report":{ "$ref": "#/$defs/report_export" },
"condition":{ "type": "string" },
"process_result":{ "type": "string" },
"expected_result":{ },
"store_result":{ "type": "string" }
}
},
"steps" : {
"required": ["steps"],
"properties": {
"version": { "type": "string" },
"steps": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties":{
"let": { "$ref": "#/$defs/let" },
"check": { "$ref": "#/$defs/check" },
"dialog_question": { "$ref": "#/$defs/dialog" },
"dialog_message": { "$ref": "#/$defs/dialog" },
"dialog_note": { "$ref": "#/$defs/dialog" },
"dialog_value": { "$ref": "#/$defs/dialog" },
"dialog_image": { "$ref": "#/$defs/dialog" },
"lua_func": { "$ref": "#/$defs/func" },
"py_func": { "$ref": "#/$defs/func" },
"console": { "$ref": "#/$defs/console" },
"sleep": { "$ref": "#/$defs/sleep" },
"json_rpc": { "$ref": "#/$defs/json_rpc" },
"group": { "$ref": "#/$defs/group" },
"sequence": { "$ref": "#/$defs/sequence" },
"report": { "$ref": "#/$defs/report" },
"loop": { "$ref": "#/$defs/loop" },
"git": { "$ref": "#/$defs/git" },
"unittest": { "$ref": "#/$defs/unittest" }
}
}
}
}
},
"cons_open" : { "cons_open" : {
"type":"object", "type":"object",
"allOf":
[
{ "$ref": "#/$defs/items" },
{
"properties": { "properties": {
"protocol" : { "protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"] "enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
}, },
"telnet_host" : {"type": "string"}, "telnet_host" : {"type": "string" },
"telnet_port" : {"type": "string"}, "telnet_port" : {"type": "number" },
"ssh_host": {"type": "string"}, "ssh_host": {"type": "string" },
"ssh_user": {"type": "string"}, "ssh_user": {"type": "string" },
"ssh_pwd": {"type": "string"}, "ssh_pwd": {"type": "string" },
"serial_port": {"type": "string"}, "serial_port": {"type": "string" },
"serial_baudrate": {"type": "integer"}, "serial_baudrate": {"type": "integer" },
"buffered": {"type": "boolean"}, "buffered": {"type": "boolean" },
"tcp_host" : {"type": "string"}, "tcp_host" : {"type": "string" },
"tcp_port" : {"type": "string"}, "tcp_port" : {"type": "number" },
"terminal_path": {"type":"string"}, "terminal_path": {"type":"string" },
"shell": {"type":"string"} "shell": {"type":"string" }
}, },
"required":["protocol"], "required": ["protocol"]
"additionalProperties": false }
]
}, },
"cons_read": { "cons_read": {
"type":"object", "type":"object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties": { "properties": {
"protocol" : { "protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"] "enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
}, },
"expected" : {"type": "string"}, "expected" : {"type": "string" },
"timeout": {"type": "number"}, "timeout": {"type": "number" },
"mute": {"type": "boolean"} "mute": {"type": "boolean" }
}, },
"required":["expected"], "required":["expected"]
"additionalProperties": false }
]
}, },
"console" : { "console" : {
"description": "The let items", "description": "The let items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"required": ["steps", "console_name"],
"properties":{ "properties":{
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean"},
"execute_on_stop":{ "type": "boolean"},
"skipped":{ "type": "boolean"},
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"console_name": {"type":"string" }, "console_name": {"type":"string" },
"steps": { "steps": {
"type": "array", "type": "array",
@@ -77,44 +132,50 @@
"read_until": { "read_until": {
"$ref": "#/$defs/cons_read" "$ref": "#/$defs/cons_read"
}, },
"close": { "type": "null"} "close": {
"anyOf": [
{"type": "null"},
{"type": "string"}
]
}
}, },
"additionalProperties": false "additionalProperties": false
} }
} }
}
}
]
}, },
"additionalProperties": false,
"required": ["steps", "console_name"]
},
"json_rpc_console": { "json_rpc_console": {
"type":"object", "type":"object",
"properties": { "properties": {
"name" : {"type": "string"}, "name" : {"type": "string" },
"prompt" : {"type": "string"} "prompt" : {"type": "string" }
}, },
"required":["name"], "required":["name"],
"additionalProperties": false "additionalProperties": false
}, },
"json_rpc_udp": { "json_rpc_udp": {
"type":"object", "type":"object",
"properties": { "properties": {
"server" : {"type": "string"}, "server" : {"type": "string" },
"udp_snd_port" : {"type": "integer"}, "udp_snd_port" : {"type": "integer" },
"udp_rcv_port" : {"type": "integer"}, "udp_rcv_port" : {"type": "integer" },
"bufsize" : {"type": "integer"} "bufsize" : {"type": "integer" }
}, },
"required":["name"], "required":["name"],
"additionalProperties": false "additionalProperties": false
}, },
"json_rpc_query": { "json_rpc_query": {
"type":"object", "type":"object",
"properties": { "properties": {
"method" : { "type": "string"}, "method" : { "type": "string" },
"params" : { "type": "array"}, "params" : { "type": "array" },
"id" : {"type": "integer"}, "id" : {"type": "integer" },
"no_wait" : {"type": "boolean"} "no_wait" : {"type": "boolean" }
}, },
"required":["method"], "required":["method"],
"additionalProperties": false "additionalProperties": false
@@ -123,8 +184,8 @@
"json_rpc_receive": { "json_rpc_receive": {
"type":"object", "type":"object",
"properties": { "properties": {
"id" : {"type": "integer"}, "id" : {"type": "integer" },
"timeout" : {"type": "number"} "timeout" : {"type": "number" }
}, },
"required":["id"], "required":["id"],
"additionalProperties": false "additionalProperties": false
@@ -133,271 +194,325 @@
"json_rpc" : { "json_rpc" : {
"description": "The json_rpc items", "description": "The json_rpc items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"required": ["steps"],
"properties":{ "properties":{
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean"}, "udp" : { "$ref": "#/$defs/json_rpc_udp" },
"execute_on_stop":{ "type": "boolean"}, "console" : { "$ref": "#/$defs/json_rpc_console" },
"skipped":{ "type": "boolean"}, "timeout": {"type": "number" },
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"expected" : {"type": "string"},
"udp" : { "$ref": "#/defs/json_rpc_udp"},
"console" : { "$ref": "#/$defs/json_rpc_console"},
"timeout": {"type": "number"},
"version": {"enum": ["1.0", "2.0"]}, "version": {"enum": ["1.0", "2.0"]},
"steps": { "steps": {
"type": "array", "type": "array",
"items": { "items": {
"type": "object", "type": "object",
"additionalProperties": false,
"properties":{ "properties":{
"open": { "type": "null"}, "open": { "type": "null" },
"query": { "$ref": "#/$defs/json_rpc_query" }, "query": { "$ref": "#/$defs/json_rpc_query" },
"receive": { "$ref": "#/$defs/json_rpc_receive" }, "receive": { "$ref": "#/$defs/json_rpc_receive" },
"writeln": { "type": "string" }, "writeln": { "type": "string" },
"read_until": { "$ref": "#/$defs/cons_read" "read_until": { "$ref": "#/$defs/cons_read"
}, },
"close": { "type": "null"} "close": { "type": "null" }
},
"additionalProperties": false
} }
} }
}, }
"additionalProperties": false, }
"required": ["steps"] }
]
}, },
"group" : { "group" : {
"description": "The group items", "description": "The group items",
"type": "object", "type": "object",
"properties":{ "unevaluatedProperties": false,
"name": { "type": "string" }, "allOf": [
"stop_on_failure":{ "type": "boolean"}, { "$ref": "#/$defs/items" },
"execute_on_stop":{ "type": "boolean"}, { "$ref": "#/$defs/steps" }
"skipped":{ "type": "boolean"}, ]
"no_fail":{ "type": "boolean"}, },
"doc":{ "type": "string"},
"key":{ "type": "string"}, "sequence" : {
"report":{ "type": "string"}, "description": "The sequence items",
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"steps": {
"type": "array",
"items": {
"type": "object", "type": "object",
"properties":{ "unevaluatedProperties": false,
"let": { "$ref": "#/$defs/let" }, "allOf": [
"check": { "$ref": "#/$defs/check" }, { "$ref": "#/$defs/items" },
"dialog_message": { "$ref": "#/$defs/dialog_txt" }, { "$ref": "#/$defs/steps" },
"dialog_note": { "$ref": "#/$defs/dialog_txt" }, {
"dialog_value": { "$ref": "#/$defs/dialog_txt" }, "properties": {
"lua_func": { "$ref": "#/$defs/func" }, "filename": { "type": "string" }
"py_func": { "$ref": "#/$defs/func" },
"console": { "$ref": "#/$defs/console" },
"json_rpc": { "$ref": "#/$defs/json_rpc" },
"group": { "$ref": "#/$defs/group" }
}, },
"additionalProperties": false "required": ["filename"]
}
} }
]
}, },
"loop" : {
"description": "The loop items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{ "$ref": "#/$defs/steps" },
{
"properties": {
"iterator": { },
"exit_condition": {
"description": "the posibility to stop the loop",
"type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": ["steps"] "properties": {
"time" : {"type":"number"},
"value" : {"type":"number"},
"file" : {"type":"string"},
"func_name" : {"type":"string"},
"eval" : {"type":"string"}
},
"dependentRequired": {
"file" : ["func_name"]
}
}
}
}
]
}, },
"main" : { "main" : {
"description": "The Main items", "description": "The Main items",
"type": "object", "type": "object",
"properties":{ "unevaluatedProperties": false,
"name": { "type": "string" }, "allOf": [
"stop_on_failure":{ "type": "boolean"}, { "$ref": "#/$defs/items" },
"execute_on_stop":{ "type": "boolean"}, { "$ref": "#/$defs/steps" },
"skipped":{ "type": "boolean"}, {
"no_fail":{ "type": "boolean"}, "properties": {
"doc":{ "type": "string"}, "version": { "type": "string" }
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"version": { "type": "string"},
"steps": {
"type": "array",
"items": {
"type": "object",
"properties":{
"let": { "$ref": "#/$defs/let" },
"check": { "$ref": "#/$defs/check" },
"dialog_message": { "$ref": "#/$defs/dialog_txt" },
"dialog_note": { "$ref": "#/$defs/dialog_txt" },
"dialog_value": { "$ref": "#/$defs/dialog_txt" },
"lua_func": { "$ref": "#/$defs/func" },
"py_func": { "$ref": "#/$defs/func" },
"console": { "$ref": "#/$defs/console" },
"json_rpc": { "$ref": "#/$defs/json_rpc" },
"group": { "$ref": "#/$defs/group" }
},
"additionalProperties": false
} }
} }
}, ]
"additionalProperties": false,
"required": ["steps"]
}, },
"sleep" : { "sleep" : {
"description": "Sleep for X time [secondes", "description": "Sleep for X time [secondes",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{ "properties":{
"name": { "type": "string" }, "dialog": { "type": "boolean" },
"stop_on_failure":{ "type": "boolean"}, "timeout": { "type": "number" }
"execute_on_stop":{ "type": "boolean"},
"skipped":{ "type": "boolean"},
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"dialog": { "type": "boolean"},
"timeout": { "type": "number"}
}, },
"additionalProperties": false,
"required": ["timeout"] "required": ["timeout"]
}
]
}, },
"let" : { "let" : {
"description": "The let items", "description": "The let items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{ "properties":{
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean"},
"execute_on_stop":{ "type": "boolean"},
"skipped":{ "type": "boolean"},
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"values": { "values": {
"anyOf": [
{
"type": "array", "type": "array",
"items": {"type": "object" } "items": {"type": "object" }
},
{ "type":"object" }
]
} }
}, },
"additionalProperties": false,
"required": ["values"] "required": ["values"]
}
]
}, },
"check" : { "check" : {
"description": "The let items", "description": "The let items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{ "properties":{
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean"},
"execute_on_stop":{ "type": "boolean"},
"skipped":{ "type": "boolean"},
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"values": { "values": {
"type": "array", "type": "array",
"items": { "type": "string" } "items": {"type": "string" }
} }
}, },
"additionalProperties": false,
"required": ["values"] "required": ["values"]
}
]
}, },
"dialog_txt" : { "git" : {
"description": "The git items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{
"repo": { "type": "string" }
},
"required": ["repo"]
}
]
},
"unittest" : {
"description": "The unittest items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{
"test_file": { "type": "string" },
"test_method": {
"anyOf": [
{"type":"string"},
{
"type":"array",
"items": {"type":"string"}
}
]
}
},
"required": ["test_file"]
}
]
},
"dialog" : {
"description": "The let items", "description": "The let items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{ "properties":{
"name": { "type": "string" }, "question": { "type": "string" },
"stop_on_failure":{ "type": "boolean"}, "auto_result": { "type": "string" },
"execute_on_stop":{ "type": "boolean"}, "auto_value": { "type": ["number", "string"] },
"skipped":{ "type": "boolean"}, "filename" : {"type": "string"},
"no_fail":{ "type": "boolean"}, "reference" : {
"doc":{ "type": "string"}, "type":"array",
"key":{ "type": "string"}, "items": { "type":"string"}
"report":{ "type": "string"}, }
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"question": { "type": "string" }
}, },
"additionalProperties": false,
"required": ["question"] "required": ["question"]
}
]
}, },
"dialog_choice" : {
"description": "The one choi items",
"type": "object",
"additionalProperties": false,
"properties":{
"name": { "type": "string" },
"description": { "type": "string" },
"icon": { "type": "string"},
"choices": {
"type":"array",
"items": { "$ref": "#/$defs/dialog_choice" }
}
},
"required": ["name", "description"]
},
"dialog_choices" : {
"description": "The dialog choices items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{
"name": { "type": "string" },
"question": { "type": "string" },
"icon": { "type": "string"},
"choices": {
"type":"array",
"items": { "$ref": "#/$defs/dialog_choice" }
}
},
"required": ["question"]
}
]
},
"func" : { "func" : {
"description": "The py_fun and lua_func items", "description": "The py_fun and lua_func items",
"type": "object", "type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{ "properties":{
"name": { "type": "string" }, "file": { "type": "string" },
"stop_on_failure":{ "type": "boolean"}, "func_name": { "type": "string" },
"execute_on_stop":{ "type": "boolean"}, "context_id": { "type": "string" },
"skipped":{ "type": "boolean"},
"no_fail":{ "type": "boolean"},
"doc":{ "type": "string"},
"key":{ "type": "string"},
"report":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"file": { "type": "string"},
"func_name": { "type": "string"},
"context_id": { "type": "string"},
"param" : { "param" : {
"type": "array", "anyOf": [
"items": { "type": "string" } {"type": "array"},
{"type": "object"}
]
} }
}, },
"additionalProperties": false,
"required": ["file", "func_name"] "required": ["file", "func_name"]
}
]
}, },
"report_export": { "report_export": {
"type": "object", "type": "object",
"properties": { "properties": {
"path": {"type":"string"}, "path": {"type":"string" },
"file_name": {"type":"string"}, "file_name": {"type":"string" },
"pattern": {"type":"string"}, "pattern": {"type":"string" },
"key": {"type":"string"} "key": {"type":"string" }
} }
}, },
"report":{ "report":{
"desciption": "The list of the configuration files", "desciption": "The list of the configuration files",
"type": "object", "type": "object",
"additional_properties":false,
"properties": { "properties": {
"enabled": {"type":"boolean"}, "enabled": {"type":"boolean" },
"log_stored": {"type":"boolean"}, "log_stored": {"type":"boolean" },
"export": { "export": {
"anyOf": [
{
"type": "object", "type": "object",
"properties":{ "properties":{
"html": { "$ref": "#/$defs/report_export" }, "html": { "$ref": "#/$defs/report_export" },
"sqlite": { "$ref": "#/$defs/report_export" }, "sqlite": { "$ref": "#/$defs/report_export" },
"junit": { "$ref": "#/$defs/report_export" } "junit": { "$ref": "#/$defs/report_export" }
} }
},
{
"type": "array",
"items": {
"type":"object",
"properties":{
"html": { "$ref": "#/$defs/report_export" },
"sqlite": { "$ref": "#/$defs/report_export" },
"junit": { "$ref": "#/$defs/report_export" }
}
}
}
]
} }
} }
} }
@@ -407,7 +522,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"config_file" : { "$ref": "#/$defs/config_file" }, "config_file" : { "$ref": "#/$defs/config_file" },
"main": { "$ref": "#/$defs/group" }, "main": { "$ref": "#/$defs/main" },
"report" : { "$ref": "#/$defs/report" } "report" : { "$ref": "#/$defs/report" }
}, },