我通过 SwaggerHub 进行了新的 OpenAPI 设置。是否可以选择Accept全局强制某个标头?
我已经设置了Content-Type响应:
openapi: 3.0.0
paths:
/test-path:
get:
responses:
'200':
description: OK
content:
application/vnd.company.v1.0.0+json:
Run Code Online (Sandbox Code Playgroud)
Accept通过 cURL 请求插入不同的标头时,会执行以下操作:
{"message":"Missing matching response for specified Accept header"}
Run Code Online (Sandbox Code Playgroud)
这是有道理的,因为我们没有为此提供任何回应。