Facilitate generation of schema definitions of Drupal 8 data models as produced by Serialization for Drupal 8 REST. Currently supported: JSON Schema for JSON, HAL JSON, and JSON API serialized Drupal Content Entities.

What is a (non-Database) Schema for Drupal?

A schema is a declarative definition of an entity's makeup. A way of describing the different pieces that make up the entity, much like an interface defines a class and exactly like an XML DTD describes an XML document. This project uses Drupal's new Typed Data system to facilitate the creation of schemas for your site.

This is especially powerful in conjunction with the Drupal REST system, as your content model schemata can help with testing, client code generation, documentation generation, and more, especially in conjunction with external tools that process schemas.

All Entity Types and Bundles have a schema automatically via the Schemata module.

Requirements

While Schemata will work on Drupal 8.2, the schema will only apply on Drupal 8.3 or with #2751325: All serialized values are strings, should be integers/booleans when appropriate patched into your version of Drupal core.

Schemata-the-module is a dependency for a sub-module that provides a first schema format: Schemata JSON Schema. This adds JSON Schema descriptions of JSON, HAL JSON, and JSON API

From a "product" standpoint, JSON Schema is the valuable thing, and Schemata the technical dependency. Only install Schemata if you plan to install a module that provides a Serializer implementation that can use it.

Schemata-powered Projects

Use the Docson module to visualize the JSON Schemas generated by the Schemata module.

Use the OpenAPI module to create schemas defining your REST resources.

Architecture & Development

For more on the architecture and configuration, please see the README

Development

If you wish to contribute to development of this project, please submit Pull Requests on Github

Automated Testing is handled with Travis-CI.

Supporting organizations: 
sponsors maintenance
sponsored creation

Project information

Releases