Add setSerializer to Component\Serialization\Yaml and deprecate Core\Serialization\Yaml

Created on 14 November 2023, almost 2 years ago

Problem/Motivation

Drupal has two Yaml serialization classes, which is confusing.

  • Drupal\Component\Serialization\Yaml
  • Drupal\Core\Serialization\Yaml

The difference is the latter allows overriding the serializer through Drupal's setting management.

Proposed resolution

Drupal\Component\Serialization\Yaml should have a setSerializer method. DrupalKernel as part of bootEnvironment process could call the method to set the serializer.

Drupal\Component\Serialization\Yaml::setSerializer(Settings::get('yaml_parser_class'))

Remaining tasks

API changes

Adds Drupal\Component\Serialization\Yaml::setSerializer

Deprecates Drupal\Core\Serialization\Yaml

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
BaseΒ  β†’

Last updated 35 minutes ago

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024