Skip to main content

Swagger Extension

In this section, you will learn how to use the Swagger extension to specify the API directory and the details of the API status.

  1. Specify the API directory: x-apidog-folder
  • Use/to separate directories.\and/are special characters that need to be escaped. Use\/for character /, and use\\for character \.
"paths": {
"/pets": {
"post": {
...
"operationId": "addPet",
"x-apidog-folder": "pet_store/pet_info"
}
}
}
  • Swagger Example:
@Operation(extensions = {
@Extension(properties = {
@ExtensionProperty(name = "apidog-folder", value = "pet_store/pet_info")})
})
public Response createPet() {...}
  1. API status:x-apidog-status
Status
designing
pending
developing
integrating
testing
tested
released
deprecated
exception
"paths": {
"/pets": {
"post": {
...
"operationId": "addPet",
"x-apidog-status": "released"
}
}
}

Swagger Exmple:

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