rfrommherz/api
Composer 安装命令:
composer require rfrommherz/api
包简介
Symfony api simplifier
关键字:
README 文档
README
Installation
composer req rfrommherz/api- config/bundles.php: Add new bundle to bundles.php
Rf\ApiBundle\JwtBundle::class => ['dev' => true],
Usage
ApiDto
ApiDto's can be used as parameters in your controllers. To enable the support for this, your class must extend ApiDto. Each ApiDto is passed to the symfony validator, which enables the support for validation annotations.
use Rf\ApiBundle\Dto\ApiDto; use Symfony\Component\Validator\Constraints as Assert; class Fetch extends ApiDto { /** * @Assert\NotBlank * @Assert\Url * @var string */ private string $repositoryUrl;
Arguments will be automatically resolved and can be passed as controller arguments.
public function index(Fetch $fetch): Response { ... }
curl --location --request GET 'http://localhost/fetch' \ --header 'Content-Type: application/json' \ --data-raw '{ "repositoryUrl": "http://...", }'
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-29