mibexx/phpopenapi
最新稳定版本:1.0.0
Composer 安装命令:
composer require mibexx/phpopenapi
包简介
PHP project for OpenAPI processing
README 文档
README
PHPOpenApi is a PHP library that allows you to process and work with OpenAPI specifications.
Installation
You can install PHPOpenApi via Composer. Run the following command in your terminal:
composer require mibexx/phpopenapi
Usage
Processing an OpenAPI Specification
To process an OpenAPI specification and retrieve the corresponding DTO, you can use the OpenAPIFacade provided by PHPOpenApi. Here's an example of how to use it:
use Mibexx\PHPOpenApi\Application\OpenAPIFacade; // Create the facade instance $openAPIFacade = new OpenAPIFacade(); // Define the configuration object $source = 'example/openapi.yaml'; // Process the OpenAPI specification $openapiDto = $openAPIFacade->processOpenAPI($source); // Access the properties of the OpenAPIDto echo $openapiDto->openapi; echo $openapiDto->info->title; echo $openapiDto->servers[0]['url']; // Access other properties as needed
In the above example, we first create an instance of the OpenAPIFacade. Then, we define the source path of the OpenAPI specification. Finally, we call the processOpenAPI method on the facade, passing the source, which returns the OpenAPIDto object. We can then access the properties of the OpenAPIDto as needed.
License
PHPOpenApi is open-source software licensed under the MIT license.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-06-13