Symfony Deprecated Routes Bundle offers to mark some api routes as deprecated.
Use Composer to install the bundle:
composer require macpaw/symfony-messenger-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],
// ...
];
This bundle provide configuration for marking routes
Option | Type | Description | Default value |
---|---|---|---|
headers | array | Deprecation headers names | |
isDisabled | bool | Disable add marks for routes | false |
headers | array | Deprecation headers names | |
isSinceRequired | bool | If true enable validation for set route attribute | false |
Name | Description |
---|---|
deprecatedMessageName | Deprecated message info header name |
deprecatedFromName | Start deprecation date |
deprecatedSinceName | The date of the removal route |
config/packages/deprecated-routes.yaml
deprecated-routes:
isSinceRequired: false
isDisabled: false
headers:
deprecatedMessageName: 'X-DEPRECATED'
deprecatedFromName: 'X-DEPRECATED-FROM'
deprecatedSinceName: 'X-DEPRECATED-SINCE'