Export Data in OpenAPI/Swagger Format
POST
/v1/projects/{projectId}/export-openapi
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST 'https://api.apidog.com/v1/projects/{{projectId}}/export-openapi?locale=en-US' \
--header 'X-Apidog-Api-Version;' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"scope": {
"type": "ALL",
"excludedByTags": ["pet"]
},
"options": {
"includeApidogExtensionProperties": false,
"addFoldersToTags": false
},
"oasVersion": "3.1",
"exportFormat": "JSON"
}'
Response Response Example
{
"openapi": "3.0.1",
"info": {
"title": "Example",
"description": "",
"version": "1.0.0"
},
"tags": [
{
"name": "Example Project"
},
{
"name": "Pet"
}
],
"paths": {
"/pet/{petId}": {
"get": {
"summary": "Query pet details",
"deprecated": false,
"description": "",
"tags": [
"Example Project",
"Pet"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "Pet ID",
"required": true,
"example": "1",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": 0,
"maximum": 0,
"description": "Status code"
},
"data": {
"$ref": "#/components/schemas/Pet",
"description": "Pet information"
}
},
"required": [
"code",
"data"
]
},
"examples": {
"1": {
"summary": "Success example",
"value": {
"code": 0,
"data": {
"name": "Hello Kity",
"photoUrls": [
"http://dummyimage.com/400x400"
],
"id": 3,
"category": {
"id": 71,
"name": "Cat"
},
"tags": [
{
"id": 22,
"name": "Cat"
}
],
"status": "sold"
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
]
}
}
}
},
"404": {
"description": "Record not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
]
}
}
}
}
},
"security": []
},
"delete": {
"summary": "Delete pet information",
"deprecated": false,
"description": "",
"tags": [
"Example Project",
"Pet"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "Pet id to delete",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "api_key",
"in": "header",
"description": "",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": 0,
"maximum": 0
}
},
"required": [
"code"
]
},
"examples": {
"1": {
"summary": "Success example",
"value": {
"code": 0
}
}
}
}
}
}
},
"security": []
}
},
"/pet": {
"post": {
"summary": "Create pet information",
"deprecated": false,
"description": "",
"tags": [
"Example Project",
"Pet"
],
"parameters": [],
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"name": {
"description": "Pet name",
"example": "Hello Kitty",
"type": "string"
},
"status": {
"description": "Pet sale status",
"example": "sold",
"type": "string"
}
},
"required": [
"name",
"status"
]
}
}
}
},
"responses": {
"201": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"minimum": 0,
"maximum": 0
},
"data": {
"$ref": "#/components/schemas/Pet",
"description": "Pet information"
}
},
"required": [
"code",
"data"
]
},
"examples": {
"1": {
"summary": "Success example",
"value": {
"code": 0,
"data": {
"name": "Hello Kity",
"photoUrls": [
"http://dummyimage.com/400x400"
],
"id": 3,
"category": {
"id": 71,
"name": "Cat"
},
"tags": [
{
"id": 22,
"name": "Cat"
}
],
"status": "sold"
}
}
}
}
}
}
}
},
"security": []
},
"put": {
"summary": "Update pet information",
"deprecated": false,
"description": "",
"tags": [
"Example Project",
"Pet"
],
"parameters": [],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
},
"data": {
"$ref": "#/components/schemas/Pet",
"description": "Pet information"
}
},
"required": [
"code",
"data"
]
},
"examples": {
"1": {
"summary": "Success example",
"value": {
"code": 0,
"data": {
"name": "Hello Kity",
"photoUrls": [
"http://dummyimage.com/400x400"
],
"id": 3,
"category": {
"id": 71,
"name": "Cat"
},
"tags": [
{
"id": 22,
"name": "Cat"
}
],
"status": "sold"
}
}
}
}
}
}
},
"404": {
"description": "Record not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
},
"405": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"security": []
}
},
"/pet/findByStatus": {
"get": {
"summary": "Find pet by status",
"deprecated": false,
"description": "",
"tags": [
"Example Project",
"Pet"
],
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status values that need to be considered for filter",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet",
"description": "Pet information"
}
},
"examples": {
"1": {
"summary": "Success example",
"value": {
"code": 0,
"data": [
{
"name": "Hello Kity",
"photoUrls": [
"http://dummyimage.com/400x400"
],
"id": 3,
"category": {
"id": 71,
"name": "Cat"
},
"tags": [
{
"id": 22,
"name": "Cat"
}
],
"status": "sold"
},
{
"name": "White Dog",
"photoUrls": [
"http://dummyimage.com/400x400"
],
"id": 3,
"category": {
"id": 71,
"name": "Dog"
},
"tags": [
{
"id": 22,
"name": "Dog"
}
],
"status": "sold"
}
]
}
}
}
}
}
},
"400": {
"description": "Invalid status value",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"code": {
"type": "integer"
}
},
"required": [
"code"
]
}
}
}
}
},
"security": []
}
}
},
"components": {
"schemas": {
"Tag": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"minimum": 1,
"description": "Tag ID"
},
"name": {
"type": "string",
"description": "Tag name"
}
},
"xml": {
"name": "Tag"
}
},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"minimum": 1,
"description": "Category ID"
},
"name": {
"type": "string",
"description": "Category name"
}
},
"xml": {
"name": "Category"
}
},
"Pet": {
"required": [
"name",
"photoUrls",
"id",
"category",
"tags",
"status"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"minimum": 1,
"description": "Pet ID"
},
"category": {
"$ref": "#/components/schemas/Category",
"description": "Category"
},
"name": {
"type": "string",
"description": "Name",
"examples": [
"doggie"
]
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
},
"description": "Photo URLs"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Tag"
},
"description": "Tags"
},
"status": {
"type": "string",
"description": "Pet sale status",
"enum": [
"available",
"pending",
"sold"
]
}
}
}
},
"securitySchemes": {}
},
"servers": []
}
Request
Path Params
projectId
stringÂ
required
Example:
{{projectId}}
Query Params
locale
stringÂ
optional
Example:
en-US
Header Params
X-Apidog-Api-Version
enum<string>Â
required
Allowed value:
2024-03-28
Default:
2024-03-28
Authorization
stringÂ
required
Default:
Bearer {{access_token}}
Body Params application/json
Responses
Modified at 2024-12-31 07:29:44