运维页面
您可以将 GitBook 页面与 OpenAPI 或 Swagger 文件或 URL 同步,以在文档中包含自动生成的 API 方法。
OpenAPI 模块
GitBook 的 OpenAPI 模块由以下组件提供支持 Scalar,因此您可以直接在文档中测试您的 API。
Add a new pet to the store.
必需范围
此端点需要以下范围:
- : modify pets in your account
- : read your pets
授权
OAuth2implicit必填
Authorization URL:
请求体
idinteger · int64可选Example:
10namestring必填Example:
doggiephotoUrlsstring[]必填
statusstring · enum可选可能的值:
pet status in the store
响应
200
Successful operation
idinteger · int64可选Example:
10namestring必填Example:
doggiephotoUrlsstring[]必填
statusstring · enum可选可能的值:
pet status in the store
400
Invalid input
422
Validation exception
default
Unexpected error
post/pet
POST /api/v3/pet HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 133
{
"id": 10,
"name": "doggie",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"text"
],
"tags": [
{
"id": 1,
"name": "text"
}
],
"status": "available"
}{
"id": 10,
"name": "doggie",
"category": {
"id": 1,
"name": "Dogs"
},
"photoUrls": [
"text"
],
"tags": [
{
"id": 1,
"name": "text"
}
],
"status": "available"
}