当我试图在swaggerhub模拟服务器上的示例对象中使用externalValue属性时,我得到了406个不可接受的响应。
我是不是做错了什么,还是这个特性没有在swaggerhub模拟服务器上实现?
API片段
paths:
/test:
get:
responses:
"200":
description: OK!
content:
application/json:
schema:
type: string
format: binary
examples:
example:
externalValue: "https://jsonplaceholder.typicode.com/todos/1"
application/pdf:
schema:
type: string
format: binary
examples:
sampleFile:
externalValue: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"邮递员API调用

API文档
模拟服务器
开放api文档
发布于 2022-09-02 10:45:07
SwaggerHub模拟服务器只支持JSON、XML和YAML响应。如果请求任何其他媒体类型(例如Accept: application/pdf或Accept: image/png),则返回406个响应。
SwaggerHub模拟服务器不支持示例响应的externalValue。模拟忽略了这些示例,并通过其他方法生成示例响应,例如基于响应schema。
来自文档 (重点雷):
enum、default、example和examples (返回的第一个示例),,除了示例。https://stackoverflow.com/questions/73580918
复制相似问题