Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

staticjsonv1

No security coverage
View on drupal.org

📘 StaticJSONv1 Module — Documentation

🇬🇧 English Documentation

🚀 Overview

StaticJSONv1 is a Drupal module that provides a way to generate static JSON representations of selected Drupal entities. It allows:

  • Configuration of which entity types and bundles should be exposed as JSON.

  • On-demand retrieval of individual entity JSON via URL.

  • Compression of all generated JSON files into a ZIP archive.

  • Drush commands to generate and compress JSON data.

Note: This module does not rely on core JSON:API or RESTful endpoints; it produces static JSON exports under custom routes defined by the module.

🧩 Features

⚙️ Configuration

At /admin/config/system/settings, administrators can:

  • Select which entity types and bundles should have static JSON exports generated.

  • Define settings used by the JSON generator (e.g., fields to include).

📍 Routes

Route Purpose /staticjson/{bundle}/{id} Returns the JSON for a specific entity (bundle + ID). Example: /staticjson/article/123 /staticjson/compress Generates a ZIP file with all currently exported JSON files Configuration UI /admin/config/system/settings — Select entities to include

🛠 Drush Commands

Command Description staticjson:generate Generates all JSON exports for the configured entities. Must have entities selected in the settings. staticjson:compress Creates a ZIP archive of all current JSON export files.

📌 Usage Examples

Retrieve JSON for an Entity


GET /staticjson/article/123

This returns a static JSON object representing the article entity with ID 123.

Generate All JSON


drush staticjson:generate

Generates static JSON files for all selected entity types and bundles.

Compress All JSON


drush staticjson:compress

Creates a ZIP containing all generated JSON files.

🧠 How It Works

  1. User selects entity types and bundles in the config form.

  2. Drush command (or internal process) iterates over selected entities.

  3. JSON files are written to a directory (e.g., public://staticjson/...).

  4. The /staticjson/... routes serve those files directly.

📦 Notes

  • Ensure the module has write permissions to the directory where JSON files will be stored.

  • This module is primarily designed for decoupled sites or static content generation workflows.

🇪🇸 Documentación en Español

🚀 Resumen

StaticJSONv1 es un módulo para Drupal que permite generar representaciones JSON estáticas de entidades seleccionadas. El módulo ofrece:

  • Configuración de qué tipos de entidad/bundles se van a exportar a JSON.

  • URLs personalizadas para obtener el JSON de una entidad.

  • Compresión de todos los JSON generados en un archivo ZIP.

  • Comandos Drush para generar y comprimir JSON.

Nota: Este módulo no usa JSON:API del núcleo de Drupal. Proporciona rutas propias para servicios JSON estáticos.

🧩 Características

⚙️ Configuración

La página de configuración en /admin/config/system/settings permite:

  • Seleccionar qué tipos de entidad y bundles exportar en JSON.

  • Configurar ajustes usados por el generador.

📍 Rutas

Ruta Descripción /staticjson/{bundle}/{id} Devuelve el JSON de una entidad específica. Ej.: /staticjson/article/123 /staticjson/compress Genera un ZIP con todos los JSON exportados Interfaz de configuración /admin/config/system/settings — Selección de entidades para exportar

🛠 Comandos Drush

Comando Para qué sirve staticjson:generate Genera todos los JSON de las entidades configuradas staticjson:compress Crea un archivo ZIP con todos los JSON actuales

📌 Ejemplos de Uso

Obtener JSON de una Entidad


GET /staticjson/article/123

Retorna el JSON estático de la entidad article con ID 123.

Generar Todos los JSON


drush staticjson:generate

Genera los archivos JSON de las entidades seleccionadas en la configuración.

Comprimir Todos los JSON


drush staticjson:compress

Crea un ZIP con todos los JSON generados hasta el momento.

🧠 ¿Cómo Funciona?

  1. El usuario selecciona los tipos de entidad y bundles en la configuración.

  2. El comando Drush (o proceso interno) recorre esas entidades.

  3. Se escriben archivos JSON en un directorio accesible (por ejemplo, public://staticjson/...).

  4. Las rutas /staticjson/... sirven esos archivos directamente.

📦 Notas

  • Asegúrate de que Drupal tenga permisos de escritura en el directorio donde se guardan los JSON.

  • Este módulo está diseñado normalmente para sitios desacoplados o flujos de trabajo con contenido estático.

Activity

Total releases
1
First release
Jan 2026
Latest release
3 months ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev Jan 11, 2026