-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider support $ref
in jsonschema
#76
Comments
Hi @comfuture! From your example, it looks like you specifically want to use |
Hi @ollyd, I understand that if $ref is not yet used in the main cases for Remote, it might not be considered for immediate implementation in the near future. If necessary on my end, I will start by preprocessing the schema in a manner similar to the example to achieve the objective. |
@comfuture, thanks for you help, feel free to open a PR supporting local $refs |
Do we have plans to support this? I'm trying to move from react-jsonschema-form to any other solution that have better performance and the $ref and |
@igorbrasileiro, we plan to support local |
Thanks for the great tool
json-schema-form
!it is very helpful because it is headless and can be used in any framework.
In many json schemas generated by other tools (e.g. OpenAPI, Pydantic, ...), you may see the keyword
$ref
which is used to reference another schema. This is a very useful feature to avoid duplication and keep the schema DRY.It would be great if
json-schema-form
can support this feature. I have tried to use it but it seems not working. I have also checked the documentation and the source code but I cannot find any information about this.Most of cases, the
$defs
is defined in the same definition, so it should be easy to implement.ex)
#/$defs/Person
will point to the definition of{"$defs": { "Person": {... } } }
in the same file.So, before parsing the schema, we can resolve the
$ref
and replace it with the actual definition.I've wrote some simple pseudo code to demonstrate how it can be implemented. I hope this will be helpful.
Then, add option to the
createHeadlessForm
function to enable this feature.I hope this feature will be implemented in the future. Thanks!
The text was updated successfully, but these errors were encountered: