[JSONSchemaBridge] Export `resolveIfNeeded` function
lordrip opened this issue · 3 comments
Currently, we have partial support for oneOf
keywords in uniforms, and as discussed in #863, one of the proposed workarounds is to process the schema before passing it to the form.
This can easily done for schemas that don't use $ref
, in case a reference schema is used, it would be beneficial to have available the resolveRefIfNeeded
function
The goal for this issue is to export the aforementioned function, either through a standalone export or as a protected method of the JSONSchemaBridge
class
If this is approved, I can provide a PR exporting this function 😃
Hi @lordrip,
Currently, this function is internal, and we can change it however we want without considering backward compatibility. If we export it, we will have to commit to its signature and support it.
There is also #1278 on the plate, and resolveRefIfNeeded
might play a role here.
Another workaround, for now, would be to just copy the function into your codebase because it's not that big:
uniforms/packages/uniforms-bridge-json-schema/src/JSONSchemaBridge.ts
Lines 14 to 49 in eed59c6
I'm also considering going with export function experimental_resolveRefIfNeeded
to mark that its API might break. That would be the middle ground between your needs and our commitment.
Let me know what you think.
Thanks for the answer @kestarumper.
I agree that exporting the function will increase the API surface area, I'll copy the function in the meantime, to move forward. I'll close the issue. Thanks once again for taking the time.