跳到主要内容

Apifox Swagger 扩展

指定接口目录

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

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

Swagger 注解示例:

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

接口状态

查看接口状态:x-apifox-status

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

Swagger 注解示例:

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