Hello,
i have a complex structure with many levels. It looks fine so far, but now i want to change some options like “elementLabelProp”: “type” for a deep array (“styleRule”). Also this is only the beginning, it will get more deeper levels.
- Is it possible to work with deep structures?
- can i export the generated uiSchema.json or is there a ui generator for the data-schema?
- can i set the options of a specific element?
schema
{
"definitions": {
"styleRule": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"title": "default",
"properties": {
"type": {
"type": "string",
"enum": ["default"],
"default": "default"
},
"output": {
"type": "string"
}
}
},
{
"type": "object",
"title": "min",
"properties": {
"type": {
"type": "string",
"enum": ["default"],
"default": "default"
},
"output": {
"type": "string"
}
}
},
{
"type": "object",
"title": "category",
"properties": {
"type": {
"type": "string",
"enum": ["default"],
"default": "default"
},
"output": {
"type": "string"
}
}
}
]
}
},
"layer": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"type": {
"type": "string",
"enum": ["fill", "line"]
},
"styleRules": {
"type": "object",
"properties": {
"color": {
"$ref": "#/definitions/styleRule"
}
}
}
}
},
"atlas": {
"source": {
"type": "object",
"title": "Source",
"properties": {
"type": {
"type": "string",
"enum": ["vector", "geojson"],
"default": "vector"
},
"provider": {
"type": "string",
"enum": ["tileserver", "publicTileserver"],
"default": "tileserver"
},
"providerId": {
"type": "string"
},
"maxzoom": {
"type": "number",
"default": 18
},
"minzoom": {
"type": "number",
"default": 5
}
},
"required": ["label"]
}
},
"sectionObj": {
"type": "object",
"title": "New Section",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"parentId": {
"type": "string"
},
"childrenType": {
"type": "string",
"enum": ["switch", "radio"]
},
"activityControlType": {
"type": "string",
"enum": ["switch", "icon"]
}
},
"required": ["label"]
}
},
"type": "object",
"properties": {
"mainType": {
"type": "string",
"enum": ["layerPackage"]
},
"section": {
"oneOf": [
{
"type": "string",
"title": "parentId",
"minLength": 1
},
{
"type": "null",
"title": "unset",
"minLength": 1
},
{
"$ref": "#/definitions/sectionObj"
}
]
},
"source": {
"$ref": "#/definitions/atlas/source"
},
"layers": {
"type": "array",
"items": { "$ref": "#/definitions/layer" }
}
}
}
ui-schema
{
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"label": "MainType",
"scope": "#/properties/mainType"
},
{
"type": "Group",
"label": "Section",
"elements": [
{
"type": "Control",
"label": "MainSection",
"scope": "#/properties/section"
}
]
},
{
"type": "Control",
"label": "Main Source",
"scope": "#/properties/source"
},
{
"type": "Control",
"label": "layers",
"scope": "#/properties/layers",
"options": {
"showSortButtons": true
}
}
]
}