macpaw/symfony-deprecated-routes

Symfony Deprecated Routes Annotations

v1.1.0 2025-01-07 10:19 UTC

README

Symfony Deprecated Routes Bundle offers to mark some api routes as deprecated.

Installation

Use Composer to install the bundle:

composer require macpaw/symfony-messenger-bundle

Setup bundle

Enable the bundle by adding it to the list of registered bundles in config/bundles.php

// config/bundles.php

return [
            Macpaw\SymfonyDeprecatedRoutes\DeprecatedRoutesBundle::class => ['all' => true],
        // ...
    ];

Extend bundle options

This bundle provide configuration for marking routes

Headers names options

Full config example with default values

config/packages/deprecated-routes.yaml

deprecated-routes:
    isSinceRequired: false
    isDisabled: false

    headers:
      deprecatedMessageName: 'X-DEPRECATED'
      deprecatedFromName: 'X-DEPRECATED-FROM'
      deprecatedSinceName: 'X-DEPRECATED-SINCE'