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": {
"config_file":{
"desciption": "The list of the configuration files",
@@ -8,48 +10,7 @@
}
},
"cons_open" : {
"type":"object",
"properties": {
"protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
},
"telnet_host" : {"type": "string"},
"telnet_port" : {"type": "string"},
"ssh_host": {"type": "string"},
"ssh_user": {"type": "string"},
"ssh_pwd": {"type": "string"},
"serial_port": {"type": "string"},
"serial_baudrate": {"type": "integer"},
"buffered": {"type": "boolean"},
"tcp_host" : {"type": "string"},
"tcp_port" : {"type": "string"},
"terminal_path": {"type":"string"},
"shell": {"type":"string"}
},
"required":["protocol"],
"additionalProperties": false
},
"cons_read": {
"type":"object",
"properties": {
"protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
},
"expected" : {"type": "string"},
"timeout": {"type": "number"},
"mute": {"type": "boolean"}
},
"required":["expected"],
"additionalProperties": false
},
"console" : {
"description": "The let items",
"type": "object",
"items":{
"properties": {
"name": { "type": "string" },
"stop_on_failure":{ "type": "boolean" },
@@ -58,11 +19,105 @@
"no_fail":{ "type": "boolean" },
"doc":{ "type": "string" },
"key":{ "type": "string" },
"report":{ "type": "string"},
"report":{ "$ref": "#/$defs/report_export" },
"condition":{ "type": "string" },
"process_result":{ "type": "string" },
"expeted_result":{ "type": "string"},
"store_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" : {
"type":"object",
"allOf":
[
{ "$ref": "#/$defs/items" },
{
"properties": {
"protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
},
"telnet_host" : {"type": "string" },
"telnet_port" : {"type": "number" },
"ssh_host": {"type": "string" },
"ssh_user": {"type": "string" },
"ssh_pwd": {"type": "string" },
"serial_port": {"type": "string" },
"serial_baudrate": {"type": "integer" },
"buffered": {"type": "boolean" },
"tcp_host" : {"type": "string" },
"tcp_port" : {"type": "number" },
"terminal_path": {"type":"string" },
"shell": {"type":"string" }
},
"required": ["protocol"]
}
]
},
"cons_read": {
"type":"object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties": {
"protocol" : {
"enum": ["telnet", "ssh", "serial", "rawtcp", "terminal"]
},
"expected" : {"type": "string" },
"timeout": {"type": "number" },
"mute": {"type": "boolean" }
},
"required":["expected"]
}
]
},
"console" : {
"description": "The let items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"required": ["steps", "console_name"],
"properties":{
"console_name": {"type":"string" },
"steps": {
"type": "array",
@@ -77,16 +132,20 @@
"read_until": {
"$ref": "#/$defs/cons_read"
},
"close": { "type": "null"}
"close": {
"anyOf": [
{"type": "null"},
{"type": "string"}
]
}
},
"additionalProperties": false
}
}
}
}
]
},
"additionalProperties": false,
"required": ["steps", "console_name"]
},
"json_rpc_console": {
"type":"object",
@@ -97,6 +156,7 @@
"required":["name"],
"additionalProperties": false
},
"json_rpc_udp": {
"type":"object",
"properties": {
@@ -108,6 +168,7 @@
"required":["name"],
"additionalProperties": false
},
"json_rpc_query": {
"type":"object",
"properties": {
@@ -133,21 +194,14 @@
"json_rpc" : {
"description": "The json_rpc items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"required": ["steps"],
"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"},
"expected" : {"type": "string"},
"udp" : { "$ref": "#/defs/json_rpc_udp"},
"udp" : { "$ref": "#/$defs/json_rpc_udp" },
"console" : { "$ref": "#/$defs/json_rpc_console" },
"timeout": {"type": "number" },
"version": {"enum": ["1.0", "2.0"]},
@@ -155,6 +209,7 @@
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties":{
"open": { "type": "null" },
"query": { "$ref": "#/$defs/json_rpc_query" },
@@ -163,217 +218,260 @@
"read_until": { "$ref": "#/$defs/cons_read"
},
"close": { "type": "null" }
},
"additionalProperties": false
}
}
},
"additionalProperties": false,
"required": ["steps"]
}
}
}
]
},
"group" : {
"description": "The group items",
"type": "object",
"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"},
"steps": {
"type": "array",
"items": {
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{ "$ref": "#/$defs/steps" }
]
},
"sequence" : {
"description": "The sequence items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{ "$ref": "#/$defs/steps" },
{
"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" }
"filename": { "type": "string" }
},
"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,
"required": ["steps"]
"properties": {
"time" : {"type":"number"},
"value" : {"type":"number"},
"file" : {"type":"string"},
"func_name" : {"type":"string"},
"eval" : {"type":"string"}
},
"dependentRequired": {
"file" : ["func_name"]
}
}
}
}
]
},
"main" : {
"description": "The Main items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{ "$ref": "#/$defs/steps" },
{
"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"},
"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
"version": { "type": "string" }
}
}
},
"additionalProperties": false,
"required": ["steps"]
]
},
"sleep" : {
"description": "Sleep for X time [secondes",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/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":{ "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"]
}
]
},
"let" : {
"description": "The let items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/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":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"values": {
"anyOf": [
{
"type": "array",
"items": {"type": "object" }
},
{ "type":"object" }
]
}
},
"additionalProperties": false,
"required": ["values"]
}
]
},
"check" : {
"description": "The let items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/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":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"values": {
"type": "array",
"items": {"type": "string" }
}
},
"additionalProperties": false,
"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",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/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":{ "type": "string"},
"condition":{ "type": "string"},
"process_result":{ "type": "string"},
"expeted_result":{ "type": "string"},
"store_result":{ "type": "string"},
"question": { "type": "string" }
},
"additionalProperties": false,
"required": ["question"]
},
"func" : {
"description": "The py_fun and lua_func items",
"type": "object",
"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"},
"file": { "type": "string"},
"func_name": { "type": "string"},
"context_id": { "type": "string"},
"param" : {
"question": { "type": "string" },
"auto_result": { "type": "string" },
"auto_value": { "type": ["number", "string"] },
"filename" : {"type": "string"},
"reference" : {
"type":"array",
"items": { "type":"string"}
}
},
"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" : {
"description": "The py_fun and lua_func items",
"type": "object",
"unevaluatedProperties": false,
"allOf": [
{ "$ref": "#/$defs/items" },
{
"properties":{
"file": { "type": "string" },
"func_name": { "type": "string" },
"context_id": { "type": "string" },
"param" : {
"anyOf": [
{"type": "array"},
{"type": "object"}
]
}
},
"required": ["file", "func_name"]
}
]
},
"report_export": {
@@ -385,19 +483,36 @@
"key": {"type":"string" }
}
},
"report":{
"desciption": "The list of the configuration files",
"type": "object",
"additional_properties":false,
"properties": {
"enabled": {"type":"boolean" },
"log_stored": {"type":"boolean" },
"export": {
"anyOf": [
{
"type": "object",
"properties":{
"html": { "$ref": "#/$defs/report_export" },
"sqlite": { "$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",
"properties": {
"config_file" : { "$ref": "#/$defs/config_file" },
"main": { "$ref": "#/$defs/group" },
"main": { "$ref": "#/$defs/main" },
"report" : { "$ref": "#/$defs/report" }
},