New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
select2 doesn't refer enumSource of item in array. #1544
Comments
Hi @victorlut. I need the complete schema to reproduce this. Specifically the part related too |
@germanbisurgi Thanks for your reply. I can't share it fully but here's Personas. Personas is correctly located inside document, and it works well unless I use "personas": {
"type": "array",
"title": "Personas",
"format": "table",
"items": {
"type": "object",
"additionalProperties": false,
"title": "Persona",
"format": "table",
"properties": {
"image": {
"type": "string",
"format": "uri",
"qt-uri-protocols": ["https"],
"qt-uri-extensions": [".svg"],
"title": "Image",
"description": "Type Uri here",
"links": [
{
"href": "{{self}}",
"mediaType": "image"
}
]
},
"text": {
"type": "string",
"title": "Text"
}
},
"required": ["text", "image"]
}
} |
Could you provide a similar schema that produces the same error so i can debug this? At first glance i would say that the problem lays the JSON path: "watch": {
"personas": "document.personas"
} It could be necessary to change it depending on the structure of your schema |
Sure. If you change {
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "#/definitions/Document",
"definitions": {
"Document": {
"type": "object",
"id": "document",
"additionalProperties": false,
"properties": {
"personas": {
"type": "array",
"title": "Personas",
"format": "table",
"items": {
"type": "object",
"additionalProperties": false,
"title": "Persona",
"format": "table",
"properties": {
"image": {
"type": "string",
"format": "uri",
"qt-uri-protocols": ["https"],
"qt-uri-extensions": [".svg"],
"title": "Image",
"description": "Type Uri here",
"links": [
{
"href": "{{self}}",
"mediaType": "image"
}
]
},
"text": {
"type": "string",
"title": "Text"
}
},
"required": ["text", "image"]
}
},
"journeys": {
"type": "array",
"title": "Journeys",
"items": {
"type": "object",
"title": "Journey",
"properties": {
"persons": {
"type": "array",
"format": "select2",
"uniqueItems": true,
"description": "You can choose some of Personas list described above",
"items": {
"type": "string",
"name": "person",
"title": "person",
"watch": {
"personas": "document.personas"
},
"enumSource": [
{
"source": "personas",
"title": "{{item.text}}",
"value": "{{item.text}}"
}
]
}
}
}
}
}
},
"title": "Document"
}
}
} |
Move |
It's not working. Does it work on your side? |
yes -> example |
@victorlut It should look like this, right? But the |
Yes, exactly! |
Did anyone found the solution yet? |
General information
select2 doesn't refer enumSource of item in array.
Expected behavior
"persons" should look like a tag element inside the elements of enumSource.
Actual behavior
select2 doesn't refer enumSource of array item. If I refer to enum, it works well. Or if I change the type into string, it works well too. I think, select2 array doesn't refer to enumSource, but enum.
Steps to reproduce the behavior
Direct link to example: https://json-editor.github.io/json-editor/
The text was updated successfully, but these errors were encountered: