Support of prefixed schema extensions
See original GitHub issueHi there,
in order to better distinguish schema extensions from standardized keywords, I think it would make sense to add compliant alternative names. Thus, no old code needs to be changed and new code can clearly distinguish between schema and extension.
Looks like three key words are involved:
Name | Prefixed Name |
---|---|
fieldsets | x-field-sets |
widget | x-widget |
visibleIf | x-visible-if |
(I hope the list is complete…)
The reason why I write this is that I want to create the schemas from Java POJOs (at first only out of curiosity). There it would be very unclean, in my opinion, to define such properties without a prefix there. If there is any interest in this topic, I will gladly report on it.
Moreover, I have unfortunately not found the code, which e.g. makes a { "widget": { "id": "string" }
from { "widget": "string" }
. I don’t know if I could do an implementation without help. Alternatively I could of course run a crappy recursive algorithm over the schema 😉
Thanks in advance!
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (7 by maintainers)
Top GitHub Comments
Support of prefixed schema extension came with commit d7c3d8f3dadf9a8bcbaa0ba004452efc28372b72 See also : https://stackblitz.com/edit/ngx-schema-form-customs-widgets-223?file=src/app/myform/schema-form.json
My 50 cent:
We keep ngx-schema-form json schema extension in a separate file.
We call this file schemaform.json.
At compile time the standard json schema and the schemaform.json get merged together. (There are plenty deep merge libs out there)
This is driven by the fact that mostly the standard json schema cames from the backend.