json-forms
json-forms copied to clipboard
$ref?
$ref should do an ajax call (with id of the schema?)
but actually : function getDefinition(path) { var parts = path.split('/'); var def = root; for (var p in parts) { if (p === "0") continue; def = def[parts[p]];
}
return def;
}
i dont understand well what that's doing ! how that's work ? sorry it is more a question than an "issue" perhaps, feel free to close it.
It's doing that http://brutusin.org/json-forms/#11 referencing a definition contained in your actual schema.
Currently If you have different schemas definitions (accessible from HTTP or whatsoever) you can build these superschema in a preprocessing step, although it should not be difficult to add some mechanisms to the library (callback?) to let the user resolve definitions in case they are not present (this is where your ajax calls would be used)
Hum i understand how to do but will be nice if it is done by the library i think.
working on this...
Any news regarding this enhancement @idelvall?
Yes, I forgot to include the follow up. In case of referencing an schema that is not present in your definitions, the schema resolver is invoked. In other words you should create an schema resolver for the form that would make those AJAX calls as needed.