Is there a reference specification for the JSON representation of a form?

I am somewhat out of my depth so this question may be naive. I have been trying to build a website which can make and use HTML forms and I want to base them on a data representation such as JSON. I did find a specification for Google Forms at REST Resource: forms  |  Google Forms  |  Google for Developers which is exactly the type of document I am looking for except that I thought JSONForms might be a better choice. However I have been unable to find an a resource analogous to the Google Forms one above for JSONForms. I have seen plenty of examples in the JSONForms documentation at What is JSON Forms? - JSON Forms but I have not seen a comprehensive specification.

If someone could point me to such a document or explain where I am misinformed on this issue I would be very grateful.

Hi @Stephen,

JSON Forms is a form rendering framework for data modeled in JSON Schema. It utilizes two primary JSON-based specifications to define and render forms:

  • JSON Schema: JSON Schema is a standardized format for defining the structure, constraints, and validation rules of JSON data. See here for more information.
  • JSON Forms UI Schema: While JSON Schema defines what data is required, the UI Schema dictates how this data is presented to the user. It describes the layout and organization of the form elements. This is a specialized format only leveraged by JSON Forms itself. See our documentation for more information.

Unfortunately I do not really understand your answer. I am looking for a specification analogous to the Google Forms one I linked to in my question. I imagine (perhaps wrongly) that JSONForms would specify a particular way that a given form or part of a form should be rendered in JSON in order for it to be valid.

For example 3 HTML input elements with type attribute values of radio all with the same name (“blah”) might be validly represented in JSONForms like the one below whereas other structures while being valid JSON and sensible would not be valid JSONForms:

question: {
  category: "radio",
  label: "do you understand JSONForms",
  options: [
    "yes",
    "no",
    "not sure",
  ]

Does JSONForms include a specification of this nature analagous to the Googe Forms document linked to in my question?

If I understand correctly you are asking for the specification of JSON Schema. See here for the official website and here for an introduction guide.

JSON Schema itself only allows to specify the structure of the resulting JSON object. We generate a default UI for the most common cases of JSON Schema. By structuring the JSON Schema and optionally adding some additional description via the UI Schema, we then render a form.