Skip to content

Commit

Permalink
have additionalProperties DTRT when given a oneOf of internal referen…
Browse files Browse the repository at this point in the history
…ces.
  • Loading branch information
Omri Schwarz committed Apr 15, 2016
1 parent e75d7ad commit 2b71de5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/brutusin-json-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ if (typeof brutusin === "undefined") {
option.value = s.oneOf[i];
appendChild(option, textNode, s);
appendChild(input, option, s);
/* if (value == undefined)
if (value == undefined)
continue;
if (value.hasOwnProperty("type")) {
/* if (value.hasOwnProperty("type")) {
if (ss.hasOwnProperty("properties") ){
if (ss.properties.hasOwnProperty("type")){
var tryit = getSchema(ss.properties.type);
Expand Down Expand Up @@ -509,6 +509,7 @@ if (typeof brutusin === "undefined") {
render(td1, td2, propId, current, pp, propInitialValue);
}
}
// TODO: handle complex additionalProperties type definitions.
if (s.additionalProperties) {
var addPropS = getSchema(s.additionalProperties);
var div = document.createElement("div");
Expand Down Expand Up @@ -818,7 +819,8 @@ if (typeof brutusin === "undefined") {
if (schema.additionalProperties) {
var childProp = name + "[*]";
pseudoSchema.additionalProperties = childProp;
if (schema.additionalProperties.hasOwnProperty("type")) {
if (schema.additionalProperties.hasOwnProperty("type")||
schema.additionalProperties.hasOwnProperty("oneOf")) {
populateSchemaMap(childProp, schema.additionalProperties);
} else {
populateSchemaMap(childProp, SCHEMA_ANY);
Expand Down

0 comments on commit 2b71de5

Please sign in to comment.