feat(schemas): format JSON schema properties for better readability
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-11 13:34:18 +00:00
parent c2a54a4474
commit afa7c9b238
2 changed files with 350 additions and 197 deletions

View File

@@ -41,7 +41,9 @@
"description": "Name of the field."
}
},
"required": ["source"]
"required": [
"source"
]
}
},
"prefilledFields": {
@@ -62,16 +64,22 @@
"description": "JavaScript evaluation string to determine the default value."
}
},
"required": ["eval"]
"required": [
"eval"
]
}
},
"required": ["source", "defaultValue"]
"required": [
"source",
"defaultValue"
]
}
}
},
"required": ["fields"]
"required": [
"fields"
]
},
"defaultSort": {
"type": "object",
"description": "default sort in admin ui lists",
@@ -82,7 +90,11 @@
},
"order": {
"description": "sort order",
"enum": ["ASC", "DESC", "MANUALLY"]
"enum": [
"ASC",
"DESC",
"MANUALLY"
]
}
}
},
@@ -91,7 +103,10 @@
"oneOf": [
{
"type": "string",
"enum": ["edit", "view"]
"enum": [
"edit",
"view"
]
},
{
"type": "object",
@@ -113,156 +128,181 @@
"type": "array",
"description": "list views",
"items": {
"type": "object",
"properties": {
"mediaQuery": {
"type": "string",
"description": "css media query to select this view in ui"
},
"selectionPriority": {
"type": "number",
"description": "priority for selection based on media query"
},
"fileDropArea": {
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"helperText": {
"$ref": "definitions.json#/definitions/i18nString"
},
"targetField": {
"type": "string"
},
"pageAsDropArea": {
"type": "boolean"
}
}
}
},
"oneOf": [
{
"properties": {
"type": {
"enum": ["simpleList", "dashboardSimpleList"]
},
"primaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"secondaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"tertiaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
}
},
"required": ["type", "primaryText"]
"type": "string",
"description": "YAML !include reference to an external view definition file"
},
{
"type": "object",
"properties": {
"type": {
"enum": ["table", "dashboardTable"]
"mediaQuery": {
"type": "string",
"description": "css media query to select this view in ui"
},
"columns": {
"type": "array",
"items": {
"oneOf": [
{
"anyOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"renderValue": {
"description": "render value based on entry ($ variable)",
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
}
}
]
},
{
"allOf": [
{
"$ref": "definitions.json#/definitions/evalExpressions"
},
{
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
}
}
}
]
}
]
},
"minItems": 1
}
},
"required": ["type", "columns"]
},
{
"properties": {
"type": {
"const": "cardList"
"selectionPriority": {
"type": "number",
"description": "priority for selection based on media query"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "boolean"
}
"fileDropArea": {
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"required": ["source"]
"helperText": {
"$ref": "definitions.json#/definitions/i18nString"
},
"targetField": {
"type": "string"
},
"pageAsDropArea": {
"type": "boolean"
}
}
}
},
"required": ["type", "fields"]
"oneOf": [
{
"properties": {
"type": {
"enum": [
"simpleList",
"dashboardSimpleList"
]
},
"primaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"secondaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
},
"tertiaryText": {
"oneOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"$ref": "definitions.json#/definitions/evalExpressions"
}
]
}
},
"required": [
"type",
"primaryText"
]
},
{
"properties": {
"type": {
"enum": [
"table",
"dashboardTable"
]
},
"columns": {
"type": "array",
"items": {
"oneOf": [
{
"anyOf": [
{
"$ref": "definitions.json#/definitions/fieldSource"
},
{
"type": "object",
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
},
"renderValue": {
"description": "render value based on entry ($ variable)",
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
}
}
]
},
{
"allOf": [
{
"$ref": "definitions.json#/definitions/evalExpressions"
},
{
"properties": {
"label": {
"$ref": "definitions.json#/definitions/i18nString"
}
}
}
]
}
]
},
"minItems": 1
}
},
"required": [
"type",
"columns"
]
},
{
"properties": {
"type": {
"const": "cardList"
},
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"label": {
"type": "string"
},
"filter": {
"type": "boolean"
}
},
"required": [
"source"
]
}
}
},
"required": [
"type",
"fields"
]
}
],
"required": [
"type"
]
}
],
"required": ["type"]
]
}
}
}
}
}

View File

@@ -3,7 +3,6 @@
"title": "JSON Schema tibi-server field meta configuration",
"description": "tibi-server field meta linter",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/minimum"
@@ -11,12 +10,19 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget|inputProps$": { "$comment": "stub for allOf" }
"^x-.*|widget|inputProps$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": { "enum": ["text", "checkbox"] }
"widget": {
"enum": [
"text",
"checkbox"
]
}
}
},
{
@@ -24,23 +30,30 @@
"inputProps": {
"type": "object",
"properties": {
"multiline": { "type": "boolean" }
"multiline": {
"type": "boolean"
}
}
}
}
}
]
},
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": { "enum": ["richtext", "richText"] }
"widget": {
"enum": [
"previewBasedObjectArray"
]
}
}
}
]
@@ -48,11 +61,35 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget|choices$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"required": ["choices"],
"properties": {
"widget": {
"enum": [
"richtext",
"richText"
]
}
}
}
]
},
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget|choices$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"required": [
"choices"
],
"properties": {
"widget": {
"enum": [
@@ -121,7 +158,10 @@
"$ref": "https://raw.githubusercontent.com/rcorp/css-schema/master/schema.json"
}
},
"required": ["id", "name"]
"required": [
"id",
"name"
]
}
}
]
@@ -133,13 +173,18 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["date", "datetime"]
"enum": [
"date",
"datetime"
]
}
}
}
@@ -148,13 +193,18 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["file", "image"]
"enum": [
"file",
"image"
]
}
}
}
@@ -163,13 +213,17 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["json"]
"enum": [
"json"
]
}
}
}
@@ -178,13 +232,17 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget$": { "$comment": "stub for allOf" }
"^x-.*|widget$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["tabs"]
"enum": [
"tabs"
]
}
}
}
@@ -193,13 +251,17 @@
{
"$ref": "#/definitions/minimum",
"patternProperties": {
"^x-.*|widget|foreign$": { "$comment": "stub for allOf" }
"^x-.*|widget|foreign$": {
"$comment": "stub for allOf"
}
},
"allOf": [
{
"properties": {
"widget": {
"enum": ["foreignKey"]
"enum": [
"foreignKey"
]
},
"foreign": {
"additionalProperties": false,
@@ -229,7 +291,9 @@
"render": {
"description": "field name or eval object which returns string",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
},
@@ -263,12 +327,16 @@
{
"properties": {
"widget": {
"enum": ["contentbuilder"]
"enum": [
"contentbuilder"
]
},
"baseHref": {
"description": "base href for relative links inside of ContentBuilder",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObject"
}
@@ -277,10 +345,14 @@
"cssHref": {
"description": "href to css file for use with ContentBuilder",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"type": "array",
"items": { "type": "string" }
"items": {
"type": "string"
}
},
{
"$ref": "definitions.json#/definitions/evalObject"
@@ -307,7 +379,10 @@
"items": {
"type": "object",
"additionalProperties": false,
"required": ["placeholder", "label"],
"required": [
"placeholder",
"label"
],
"properties": {
"placeholder": {
"type": "string",
@@ -327,7 +402,9 @@
"style": {
"description": "css style to inject into ContentBuilder",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObject"
}
@@ -355,7 +432,9 @@
"previewUnfolded": {
"description": "preview for unfolded array element",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
@@ -364,7 +443,9 @@
"previewFolded": {
"description": "preview for folded array element",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
@@ -378,22 +459,35 @@
},
"direction": {
"type": "string",
"enum": ["horizontal", "vertical"]
"enum": [
"horizontal",
"vertical"
]
},
"pathStep": {
"type": "object",
"properties": {
"title": {
"type": "string",
"const": "Zeile"
"type": "string"
},
"icon": {
"type": "string",
"const": "viewSequentialOutline"
"type": "string"
}
},
"required": ["title", "icon"]
"required": [
"title"
]
},
"preview": {
"description": "preview configuration for array elements",
"oneOf": [
{
"type": "string"
},
{
"$ref": "definitions.json#/definitions/evalObjectWithRaw"
}
]
},
"metaElements": {
"oneOf": [
@@ -419,7 +513,9 @@
"type": "string"
}
},
"required": ["source"]
"required": [
"source"
]
},
{
"type": "array",
@@ -435,7 +531,9 @@
"const": "layout"
}
},
"required": ["source"]
"required": [
"source"
]
}
]
},
@@ -479,13 +577,14 @@
}
}
},
"required": ["tabs"]
"required": [
"tabs"
]
}
}
}
]
},
"openapi": {
"type": "object"
},
@@ -493,7 +592,6 @@
"$ref": "definitions.json#/definitions/i18nString",
"description": "label for field"
},
"addElementLabel": {
"$ref": "definitions.json#/definitions/i18nString",
"description": "label for adding element to list"
@@ -522,11 +620,13 @@
}
}
},
"css": {
"description": "css styles for field widgets",
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{
"$comment": "for include tag",
"type": "string"
},
{
"type": "object",
"properties": {
@@ -591,7 +691,9 @@
"dependsOn": {
"description": "depends on rule",
"oneOf": [
{ "type": "string" },
{
"type": "string"
},
{
"type": "object",
"properties": {
@@ -640,15 +742,24 @@
"type": "object",
"additionalProperties": true
},
"defaultValue": {
"description": "default value or code to get the value",
"oneOf": [
{ "type": "array" },
{ "type": "string" },
{ "type": "null" },
{ "type": "boolean" },
{ "type": "number" },
{
"type": "array"
},
{
"type": "string"
},
{
"type": "null"
},
{
"type": "boolean"
},
{
"type": "number"
},
{
"type": "object",
"properties": {
@@ -712,7 +823,9 @@
},
"css": {
"anyOf": [
{ "type": "string" },
{
"type": "string"
},
{
"$ref": "https://raw.githubusercontent.com/rcorp/css-schema/master/schema.json"
},
@@ -728,4 +841,4 @@
]
}
}
}
}