Talk· DrupalCon Vienna 2017

Using Typed Data and Configuration Schema for Maximum Flexibility

Deep dive into Drupal's Typed Data API and Configuration Schema system for building self-validating, translatable, and developer-friendly modules.

Title slide for Using Typed Data and Configuration Schema for Maximum Flexibility at DrupalCon Vienna 2017
Title slide for Using Typed Data and Configuration Schema for Maximum Flexibility at DrupalCon Vienna 2017

Presented at DrupalCon Vienna 2017 (26-29 September 2017), this talk explains why Drupal's Typed Data API and Configuration Schema matter and how they unlock Configuration Translation, Search API indexing, and Configuration Views.

Why Typed Data & Configuration Schema Matter#

  • Configuration Translation: Automatically knows which configuration keys are human-readable labels vs system booleans or integers.
  • Search API: Maps entity and field properties cleanly to typed index fields (Boolean, Date, Decimal, Integer, String, Fulltext).
  • Configuration Views: Enables Views-based listings and operations over configuration entities.

Typed Data API#

  • Built around @DataType plugins, the TypedDataManager service, and FieldTypePluginManager.
  • Core interfaces: TypedDataInterface, ComplexDataInterface (named/typed properties), PrimitiveInterface (URL, Timestamp, etc.), and ListInterface.
  • Data definitions (DataDefinitionInterface, ListDataDefinition, EntityDataDefinition) separate what a data type is from how it is used.

Configuration Schema#

Defined alongside module config (for example user.settings.yml paired with user.schema.yml), Configuration Schema describes config_object mappings, types (label, boolean, string, integer), and human-readable labels.

Key Benefits#

  • Clearer, self-documenting data structures.
  • Extensible metadata and behaviours (such as translation).
  • Better developer experience (DX) with generic get, set, and validation APIs.
  • Automatic typecasting of configuration values on save and translation of default configuration.
DrupalTyped DataConfiguration SchemaArchitecture