WIP: RFC delegate all external references to resolveExternalReference
... not just only urn:jio:
ones
The background story:
While editing instance parameters schemas for ERP5 SR, I used a modified version of https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-configure-json-defaults to "visualize" the result of the json schema.
I tried to update it to integrate RJS_json_form to make a "two way editor", something similar to https://mozilla-services.github.io/react-jsonschema-form/ , the current state is https://codepen.io/jerome-nexedi/pen/dgwGRM (it's using with rjs_json_form verion 9dafc5c3 )
Now I have one problem that resolveExternalReference
is called only for urn:jio:
URLs, but I guess it would be nice that it's called for all URLs.
I tried this attached patch, but it's still not good, because the URL is relative to the gadget URL, ie . it receives https://softinst93095.host.vifib.net/public/rjs_json_form/instance-kumofs-schema.json
and not just ../instance-kumofs-schema.json
How about:
- delegating all external references to
resolveExternalReference
like started here ? - making
resolveExternalReference
receive the reference as relative, "as-is in the schema", ie for this./instance-kumofs-schema.json
ref,resolveExternalReference
would receive"./instance-kumofs-schema.json"
?
/cc @vpelletier @romain @vincentB
PS: the monaco json service also seem to have a problem here, I think it can resolve relative references like ./instance-kumofs-schema.json
but not like ../caucase/instance-caucase-input-schema.json
. That's why I had to do getSchema
in that codepen.
PPS: there's no easier way to use renderjs on codepen ? or https://codesandbox.io/ ?