json-editor
json-editor copied to clipboard
Required not working in inner oneof
Hi, need help on this
My schema :
{ "type": "object", "title": "Approved In GPS ?", "options": { "keep_oneof_values": false }, "oneOf": [ { "title": "Yes", "type": "object", "required": [ "approvedInGps", "supDeptId", "poDate", "poNumber", "quantityPurchased", "supDeptId", "exptDeliveryDate", "vendorOrSupplier", "modelOrVersion", "licenseApplicable" ], "properties": { "approvedInGps": { "type": "string", "default": "YES", "options": { "hidden": "true" } }, "poNumber": { "options": { "grid_columns": 4 }, "type": "number", "minimum": 1, "title": "Purchase Order(PO) No." }, "poDate": { "options": { "grid_columns": 4 }, "type": "string", "format": "date", "minLength": 1, "title": "Purchase Date" }, "quantityPurchased": { "options": { "grid_columns": 4 }, "type": "number", "minimum": 1, "maximum": 20, "title": "Quantity Purchased" }, "supDeptId": { "options": { "grid_columns": 4 }, "type": "string", "title": "Supporting Dept. Id", "minLength": 1 }, "exptDeliveryDate": { "options": { "grid_columns": 4 }, "minLength": 1, "type": "string", "format": "date", "title": "Expected Delivery Date" }, "vendorOrSupplier": { "options": { "grid_columns": 4 }, "type": "string", "enum": [ "V1", "V2", "S1", "S2" ], "title": "Vendor/ Supplier" }, "modelOrVersion": { "options": { "grid_columns": 5 }, "type": "string", "title": "Model/ Version" }, "licenseApplicable": { "type": "object", "options": { "grid_columns": 8, "keep_oneof_values": true }, "title": "License Applicable ?", "oneOf": [ { "type": "object", "title": "No", "properties": { "licenseApplicable": { "type": "string", "default": "NO", "options": { "hidden": "true" } } } }, { "title": "Yes", "type": "object", "required": [ "licenseApplicable", "licenseType", "licenseRenewalDate" ], "properties": { "licenseApplicable": { "type": "string", "default": "YES", "options": { "hidden": "true" } }, "licenseType": { "type": "string", "minLength": 1, "title": "License Type" }, "costType": { "options": { "grid_columns": 5 }, "type": "string", "minLength": 1, "title": "Cost Type" }, "licenseEndDate": { "options": { "grid_columns": 5 }, "type": "string", "format": "date", "title": "License End Date" }, "licenseRenewalDate": { "options": { "grid_columns": 5 }, "type": "string", "format": "date", "title": "License Renewal Date" } } } ] } } }, { "title": "No", "type": "object", "required": [ "comment" ], "properties": { "approvedInGps": { "type": "string", "default": "NO", "options": { "hidden": "true" } }, "comment": { "type": "string", "title": "Comment", "minLength": 1 } } } ] }
inner required not working