coze-dev / coze-dev/coze-studio
编辑工具中导入openapi3.1.0数据时报错
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
**To Reproduce**
1.新建插件
2.导入工具->选择原始数据导入
3.粘贴以下内容
```
{
"openapi": "3.1.0",
"info": {
"title": "gfMcp",
"description": "gfMcp MCP Server",
"version": "1.10.1"
},
"servers": [
{
"url": "http://192.168.163.101:8000/gfMcp"
}
],
"paths": {
"/get_weekday": {
"post": {
"summary": "Get Weekday",
"description": "根据日期查询该日期是周几",
"operationId": "tool_get_weekday_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/get_weekday_form_model"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"get_weekday_form_model": {
"properties": {
"date": {
"type": "string",
"title": "Date",
"description": "日期,格式为YYYYMMDD"
}
},
"type": "object",
"required": [
"date"
],
"title": "get_weekday_form_model"
}
}
}
}
```
4.报错:invalid plugin openapi3 document : response body only supports 'object' type
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Version:**
Please provide the version of {0.5.0} you are using.
**Environment:**
The output of `go env`.
**Additional context**
Add any other context about the problem here.
Contributor guide
Research direction
Reproduce the failure through the editor's raw-data import using the OpenAPI 3.1.0 document in the issue. Trace the validation that reports “response body only supports 'object' type” and compare it with the empty response schema shown in the sample. Done means this document imports successfully without weakening validation for invalid response bodies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100