Drupal is a registered trademark of Dries Buytaert

json_form_widget

17 sites No security coverage
View on drupal.org
JSON Form Widget

This module provides a versatile way to create Drupal form elements from a JSON schema. Why would you need to create a form from JSON? This allows for a wide range of flexibility when customizing a content type without hard coding every field.

The inspiration for this module and the syntax for the UI Schema come from react-jsonschema-form. While the UI schemas are not actually interoperable at this time, and RJSF supports more features of JSON-Schema than this module is currently able to, we hope to close that gap over time.

TIP: A good way to visualize what this module is doing is to use RJSF team's react-jsonschema-form playground as this modules functionality is largely similar in regards to how the schema translates to different form fields/structure.

Plugin

This module requires a plugin to provide a "widget" that will supply the schema(s) that define the fields of the form(s). At the moment, the module does not ship with a standalone plugin, so can be thought of as an "API module" (we hope to change this situation soon). JSON Form Widget was originally part of the DKAN module, and a working example of a widget plugin can be seen in the DKAN codebase.

Using a combination of "router", "helper", and "handler" classes, as well as some extensions on Drupal core elements, a widget plugin needs to implement its own logic to retrieve the correct JSON Schema. JSON Form Widget then builds the form according to the retrieved schema and any schema user interface options if supplied (see SchemaUiHandler.php and its contained methods for more information about UI options).

The examples section of this README can be used to understand how different field types translate directly to Drupal form elements and subsequently, how they would look within the Drupal user interface. They come from the default schemas in DKAN but represent most of what is currently available from JSON Form Widget, no matter where your schema comes from.

Activity

Total releases
3
First release
Sep 2025
Latest release
1 week ago
Release cadence
73 days
Stability
0% stable

Release Timeline

Releases

Version Type Release date
1.0.0-alpha2 Pre-release Feb 19, 2026
1.0.0-alpha1 Pre-release Dec 11, 2025
1.x-dev Dev Sep 26, 2025