Download the PHP package check24/apitk-deprecation-bundle without Composer
On this page you can find all versions of the php package check24/apitk-deprecation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download check24/apitk-deprecation-bundle
More information about check24/apitk-deprecation-bundle
Files in check24/apitk-deprecation-bundle
Package apitk-deprecation-bundle
Short Description This bundle provides deprecation functionality for RESTful APIs.
License MIT
Informations about the package apitk-deprecation-bundle
apitk-deprecation-bundle
Overview
This bundle enables you to mark API endpoints as deprecated and inform the client about that.
Installation
Install the package via composer:
Usage
Deprecations
You can mark actions as deprecated so developers can notice that they have to update their API call to a newer version or to use a whole other endpoint.
A notice is displayed inside the swagger documentation and a new response header
x-apitk-deprecated: use /v3/users instead
,
x-apitk-deprecated-removed-at: 2018-10-09
(if a date was set),
x-apitk-deprecated-since: 2018-07-01
(if a date was set)
will be sent to the client.
All annotation arguments are optional, so feel free to use @Deprecated
only. In this case
all clients will receive a x-apitk-deprecated: deprecated
response header. The header's
value may be overridden by providing the description
argument as shown above.
If you want to hide a certain endpoint from the docs, use the hideFromDocs=true
parameter in
the Deprecated
annotation. The corresponding action then will not be shown.
Class annotations
Since Version 1.0.6, it's possible to put @Deprecated
annotations on a Controller's class to mark all containing endpoints as deprecated.
Please keep in mind that method annotations always override class annotations completely. No merging or whatsoever will be performed.
When a controller class has a @Deprecated
annotation, it's impossible to mark one or more methods of the controller as non-deprecated.
Deprecation Logging
Since version 2.0.0, the apitk-deprecation-bundle will throw E_USER_DEPRECATED
errors when a deprecated endpoint is called.
This is useful when you're using APM tools like NewRelic and would like to be notified when deprecated endpoints are called.
Deprecation logging is active by default. You may deactivate it globally by creating
a config/packages/apitk_deprecation.yaml
containing:
You can also activate/deactivate deprecation logging for specific endpoints only:
All versions of apitk-deprecation-bundle with dependencies
symfony/config Version >= 5.3 <6.0
symfony/dependency-injection Version >= 5.3 <6.0
symfony/http-kernel Version >= 5.3 <6.0
symfony/framework-bundle Version >= 5.3 <6.0
doctrine/annotations Version ^1.6
nelmio/api-doc-bundle Version ^3.2
sensio/framework-extra-bundle Version ^5.1 || ^6.0
check24/apitk-common-bundle Version ^2.2 || ^3.0
check24/apitk-header-bundle Version ^2.2 || ^3.0