json-editor
json-editor copied to clipboard
patternProperties: keys are not shown and can't add additional data instances
I've noticed two issues when using patternProperties:
-
The generated form does not show the value (regex actual match) for keys. In the example below, I would want to see the names Art, Bruce, and Steve on the form.
-
In addition, there is no widget providing the ability in the form to add additional key-value pairs. For example, I have no way of adding the name Mary with the office number 6104.
I used your JSON Editor Example webpage to be able to intepret the following JSON data and schema as shown below.
data:
{
"offices":
{
"Art": "3240",
"Bruce": "4184",
"Steve": "1175"
}
}
schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Employee Offices",
"type": "object",
"properties": {
"offices": {
"title": "Offices",
"description": "Employee Offices",
"type": "object",
"patternProperties": {
"^.*$": {
"type": "string",
"title": "Office #",
"description": "The person's office number"
}
}
}
}
}
This repo is no longer maintained (see also https://github.com/jdorn/json-editor/issues/800)
Development is continued at https://github.com/json-editor/json-editor
For details please visit https://github.com/json-editor/json-editor/issues/5