Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

简化注解的方式(Attributes下) #4

Open
krissss opened this issue Apr 25, 2024 · 1 comment
Open

简化注解的方式(Attributes下) #4

krissss opened this issue Apr 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@krissss
Copy link
Member

krissss commented Apr 25, 2024

parameters: [
    ...[
        new OA\Parameter(name: 'page', description: '页数', in: 'query', schema: new OA\Schema(type: 'integer')),
        new OA\Parameter(name: 'page_size', description: '每页数量', in: 'query', schema: new OA\Schema(type: 'integer')),
    ],
    new OA\Parameter(name: 'username', description: '用户名', in: 'query', schema: new OA\Schema(type: 'string')),
    new OA\Parameter(name: 'status', description: '状态', in: 'query', schema: new OA\Schema(type: 'integer')),
],

这个例子中分页是可以复用的

@krissss krissss added the enhancement New feature or request label Apr 25, 2024
@krissss
Copy link
Member Author

krissss commented May 8, 2024

官方提供 JsonContent 来简化 media-type 是 json 形式的书写方式
类似的还有 XmlContent、PathParameter、QueryParameter 等

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant