json-forms icon indicating copy to clipboard operation
json-forms copied to clipboard

$ref?

Open fabifabi opened this issue 8 years ago • 5 comments

$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.

fabifabi avatar Feb 08 '17 14:02 fabifabi

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)

idelvall avatar Feb 09 '17 07:02 idelvall

Hum i understand how to do but will be nice if it is done by the library i think.

fabifabi avatar Mar 29 '17 08:03 fabifabi

working on this...

idelvall avatar Mar 30 '17 08:03 idelvall

Any news regarding this enhancement @idelvall?

mastercoding avatar Jun 01 '17 14:06 mastercoding

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.

idelvall avatar Jun 02 '17 06:06 idelvall