swagger-api/swagger-ui

Response Body not shown when Content-Type in the response header is not set

Open

#6,149 opened on 2020年6月16日

GitHub で見る
 (6 comments) (0 reactions) (0 assignees)JavaScript (8,801 forks)batch import
Hacktoberfestspecification: 3.xtype: bug

Repository metrics

Stars
 (25,447 stars)
PR merge metrics
 (平均マージ 20h 34m) (30d で 14 merged PRs)

説明

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Method of installation: dist
  • Swagger-UI version: 3.26.2
  • Swagger/OpenAPI version: OpenAPI 3.0

Describe the bug you're encountering

When the Content-Type response header is not set, swagger-ui does not show the Response Body. I am seeing this issue when using OpenAPI 3.0 with swagger-ui 3.26.2 Screen Shot 2020-06-15 at 5 41 59 PM

When using Swagger 2.0 with swagger-ui 2.2.10, we do see Response Body even when the Content-Type response header is not set. Screen Shot 2020-06-15 at 5 44 32 PM

As you can see in the above picture, the Content-Type is set to null

So I am wondering if there is any way for swagger-ui(3.26.2) to show the Response Body even when the Content-Type response header is not set

Additional context or thoughts

I can confirm that if I pass in the Content-Type response header, the Response Body is seen like below

Screen Shot 2020-06-15 at 5 53 08 PM

コントリビューターガイド