json-editor
json-editor copied to clipboard
Out of order properties
I have the following configuration, However, I observe that my view the sections are coming in the wrong order. Can you give me any suggestions for a fix.
schema:{
"title": "NGLA Schema",
"type": "object",
"options":{
"disable_collapse": true
},
"properties":{
"project": {
"title": "Project",
"$ref": "#/definitions/project"
},
"sources": {
"title": "Source",
"$ref": "#/definitions/source"
},
"type1": {
"title": "Pattern Recognition",
"$ref": "#/definitions/type1"
},
"type2": {
"title": "Type 2 Parameters",
"$ref": "#/definitions/type2"
},
"type3": {
"title": "Sequence Analysis",
"$ref": "#/definitions/type3"
},
"type4": {
"title": "Volume Analysis",
"$ref": "#/definitions/type4"
},
"type5": {
"title": "Type 5 Analysis",
"$ref": "#/definitions/type5"
},
"type6": {
"title": "Type 6 Parameters",
"$ref": "#/definitions/type6"
},
"type7": {
"title": "Type 7 Analysis",
"$ref": "#/definitions/type7"
},
"type8": {
"title": "Type 8 Analysis",
"$ref": "#/definitions/type8"
},
"type9": {
"title": "Type 9 Analysis",
"$ref": "#/definitions/type9"
}
},
The problem seems to come when I introduce an empty property. i.e. one in which I just want a section and no actual key-values to be entered:
"type5":
{
"id": "type5",
"type": "object",
"format": "grid",
"options":{
"disable_collapse": true
}
},
I am facing the same issue. The order of the view is not matching the schema. Any help !
Have you tried implementing property ordering?
https://github.com/jdorn/json-editor#property-ordering
Property ordering works but one would have liked the order to be same the either the schema order or the json order. Is it possible to do that ?
having the same issue, I have large schema, don't wanna use propertyOrder redundantly, since the order is expected to be the same as in schema..