我已经创建了一个名为auth / google的自定义API,用于验证Google tokenId并为前端反应生成JWT令牌。
现在,我希望在swagger API中具有自定义属性。当前,它在请求正文和所有响应中包含{foo:“ string”}
要更改此设置,请按照以下步骤操作:
,然后在内容下方添加
{
"paths": {
"/auth/google": {
"post": {
"deprecated": false,
"description": "Login a user using the identifiers email and password",
"responses": {
"200": {
"description": "response",
"content": {
"application/json": {
"schema": {
"properties": {
"tokenId": {
"type": "string"
}
}
}
}
}
},
"403": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"description": "unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"summary": "",
"tags": [
"Users-Permissions - User"
],
"requestBody": {
"description": "",
"required": true,
"content": {
"application/json": {
"schema": {
"properties": {
"tokenId": {
"type": "string"
}
}
}
}
}
}
}
},
"tags": [
{
"name": "Users-Permissions - User"
}
]
}
}
文档中没有任何更改。任何人都可以帮助我做到这一点