Yii Swagger 2.2
Version 2.2 of Yii Swagger package has been released. Here is the list of changes included in the new version:
- added support
yiisoft/assetsversion of^5.0; - raised the minimum PHP version to 8.1 and minor refactoring.
Version 2.2 of Yii Swagger package has been released. Here is the list of changes included in the new version:
yiisoft/assets version of ^5.0;Version 2.1 of Yii Swagger package has been released. Here is the list of changes included in the new version:
psr/http-message of versions ^2.0.yiisoft/yii-view version to ^7.1.\Yiisoft\Swagger\Action\SwaggerJson and \Yiisoft\Swagger\Action\SwaggerUi actions, mark \Yiisoft\Swagger\Middleware\SwaggerJson and \Yiisoft\Swagger\Middleware\SwaggerUi clases as deprecated (they will be removed in the next major version).swagger-api/swagger-ui of version 5.Major versions of Yii Swagger were tagged.
In this version configuration group names adapted to Yii conventions, explicitly added transitive dependencies, and added support for:
yiisoft/aliases version of ^3.0;yiisoft/assets version of ^3.0|^4.0;yiisoft/cache version of ^3.0;yiisoft/data-response version of ^2.0;Yii Swagger intergration package was updated to version 1.2.0. In this version we have added an ability to configure OpenApi\Annotations\OpenAPI generation via Yiisoft\Swagger\Service\SwaggerService in config/params.php:
'yiisoft/yii-swagger' => [
// Default values are specified.
'open-api-options' => [
'aliases' => OpenApi\Generator::DEFAULT_ALIASES,
'namespaces' => OpenApi\Generator::DEFAULT_NAMESPACES,
'analyser' => null,
'analysis' => null,
'processors' => null,
'logger' => null,
'validate' => true,
'version' => OpenApi\Annotations\OpenApi::DEFAULT_VERSION,
],
],
//...
Yii Swagger intergration package was updated to version 1.1.0. In this version an ability to configure Yii\Swagger\Middleware\SwaggerJson via config/params.php was added:
//...
'yiisoft/yii-swagger' => [
'annotation-paths' => [
'@src/Controller' // Directory where annotations are used
],
'cacheTTL' => 60 // Enables caching and sets TTL, "null" value means infinite cache TTL.
]
//...
First version of Yii Swagger intergration package was released.
It provides an integration of Swagger-PHP with Yii3 allowing to generate API documentation based on annotations such as:
/**
* @OA\Get(
* path="/api/endpoint",
* @OA\Response(response="200", description="Get default action")
* )
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
// ...
}