When working with CKEditor 5 Source Editing in Drupal 11, you might run into validation errors caused by the SourceEditingRedundantTagsConstraintValidator. This validator prevents saving HTML that Drupal considers redundant or not allowed.
In some cases, you may want to disable this validation entirely — for example, when you need more control over the markup or are handling validation elsewhere.
The cleanest way to do this is by overriding the validator service.
In your custom module, add the following to my_module.services.yml: