Skip to content

chunhei2008/swagger-php-annotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

Swagger-PHP Annotation

Install

安装插件: phpstrom: PHP Annotation

具体templates路径参考文档

git clone https://github.com/chunhei2008/swagger-php-annotation.git

cd swagger-php-annotation

# 将`swagger-php-annotation.xml`复制到`templates`目录
cp swagger-php-annotation.xml [phpstrom/templates/path]

# restart your phpstrom

Usage

上下文说明

swagger-php-annotationphpstrom中分为两种上下文

  1. 注释上下文:注释块中
  2. 非注释上下文:注释块之外的空白处

同一个注解分两种上下文使用场景,不同场景使用不同的标识符

如:

@Get@Get_ 都是HTTP GET 请求

@Get_ 为注释上下文使用 @Get 为非注释上下文使用

支持的注解列表

  • @Get @Get_
  • @Post @Post_
  • @Put @Put_
  • @Delete @Delete_
  • @Info @Info_
  • @Tag @Tag_
  • @Items_
  • @JsonContent_
  • @MediaType_
  • @Parameter_
  • @Property @Property_
  • @RequestBody @RequestBody_
  • @Response200_ @Response_
  • @Schema @Schema_
  • @SecurityScheme @SecurityScheme_

参考文档