Description
JSON Schema can be viewed as purely to define data structures and their validation, however there is a growing number of libraries seeking to generate UI for editing the data a JSON Schema defines.
These UI libraries are not interoperable at present and many contain different ways to do the same thing which can reduce the ability to move from one to the other without substantial re-work that could be avoided by a consensus of vocabulary.
There is a valid perspective that an independent format using JSON Schema rather than based on JSON Schema could be required, this does not conflict with the goals of this issue as even an independant format could benefit from users being able to define basic UI properties like enum titles within their data schema. Having a UI Schema does not mean it must define absolutely everything UI related, it may simply provide the groundwork for an independent format to provide a better value proposition to service consumers.
The goals of a JSON Schema UI vocabulary could include:
- defining how a user should expect a data schema to be presented for editing by a library/framework when some validation keywords can be infinitely complex and ambiguous in their intent
- mapping enum values to readable titles proposed solution to document
- what to do with *Of keywords, ie render when enough detail is provided
- using the Hyper Schema to define related assets required for the UI such as dynamic drop down lists or lazy-loaded content
- determine field ordering/display status
- hint / placeholder / information text so description may remain for defining the data model
- additional keyword(s) for linking a UI definition to the core schema object it is defining UI for
- advocating for updates to relative json pointers and other pointer keywords like $data that could benefit more than just UI frameworks
- allowing a UI definition to be combined within a json-schema for single schema file definition or within a separate scope for UI switching
- expected changes to the UI based on validation conditions, for example, the editability, visibility, default value and mandatory status could be updated on the validation of a property/properties
- define widgets/templates and their properties as generically as possible
- defining a method for validation levels info/warn/error
It may well be that there is two components, a vocabulary for defining a core set of UI related properties and behaviours and a separate project for defining a unique format part of or independent of the json-schema-org that extends it into territory that does not fit as well within the structure of a vocabulary the org would want to maintain.
The main goal of this beyond the above list is to find out where the line between the two may lie.
Note: Internationalisation of the UI is a separate concern and should have its own vocabulary discussion if desired, it would not form part of any UI Schema discussions directly.