Skip to content

CheckSerializerCompilerPass: do not fail the container compilation when the serializer is disabled #278

Closed

Description

@njoubert-cleverage

Description

CheckSerializerCompilerPass (added for #74) makes the container compilation fail when the Symfony serializer is not enabled. Only 6 services need it: NormalizerTask, DenormalizerTask, SerializerTask, DeserializerTask, NormalizeTransformer, DenormalizeTransformer. An application that does not use them still has to enable framework.serializer.

The same question applies to ValidatorTask and framework.validation.

Proposed fix

  • When no serializer is available, remove the serializer-dependent services (or replace them by a definition throwing the current explicit message when the task/transformer is used), instead of failing at compile time.
  • Keep the message of Display a more explicit error message when symfony serializer is not enabled #74 (enable framework.serializer.enabled) at usage time: a process referencing one of these tasks/transformers fails with it.
  • Same treatment for ValidatorTask if it has the same issue.
  • Drop the compiler pass (or deprecate it, it is a public class).

Note: this relaxes a constraint (the container compiles in more cases), it could also land in a v5 minor version.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None for applications (the error moves from the container compilation to the process execution). CheckSerializerCompilerPass is removed (minor: internal class, unlikely to be used outside the bundle).

Activity

  1. added a commit that references this issue on Oct 14, 2026
  2. njoubert-cleverage commented on Oct 14, 2026

    @njoubert-cleverage
    MemberAuthor

    Fixed by #289 (merged, 47b2990).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions