Apifox Swagger 扩展

一、指定某个接口所属目录:x-apifox-folder

  1. 多级目录使用斜杠/分隔。其中\/为特殊字符,需要转义,\/表示字符/\\表示字符\
  1. "paths": {
  2. "/pets": {
  3. "post": {
  4. ...
  5. "operationId": "addPet",
  6. "x-apifox-folder": "宠物店/宠物信息"
  7. }
  8. }
  9. }

Swagger 注解示例:

  1. @Operation(extensions = {
  2. @Extension(properties = {
  3. @ExtensionProperty(name = "x-apifox-folder", value = "宠物店/宠物信息")})
  4. })
  5. public Response createPet() {...}

二、接口状态:x-apifox-status

状态英文
设计中designing
待确定pending
开发中developing
联调中integrating
测试中testing
已测完tested
已发布released
已废弃deprecated
有异常exception
已废弃obsolete
将废弃deprecated
  1. "paths": {
  2. "/pets": {
  3. "post": {
  4. ...
  5. "operationId": "addPet",
  6. "x-apifox-status": "released"
  7. }
  8. }
  9. }

Swagger 注解示例:

  1. @Operation(extensions = {
  2. @Extension(properties = {
  3. @ExtensionProperty(name = "x-apifox-status", value = "released")})
  4. })
  5. public Response createPet() {...}