fix(spec): render response body for non-200 responses (#9555)
Refs #9556
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
describe("#9556: SwaggerUI doesn't render response bodies for non-200 responses", () => {
|
||||
beforeEach(() => {
|
||||
const staticResponse = {
|
||||
statusCode: 400,
|
||||
headers: { "content-type": "plain/text" },
|
||||
body: "This should render",
|
||||
}
|
||||
cy.intercept("GET", "/400-any", staticResponse).as("request")
|
||||
})
|
||||
|
||||
it("should render response body for a response with 400 status code", () => {
|
||||
cy.visit("?url=/documents/features/try-it-out-non-200-response-body.yaml")
|
||||
.get("#operations-default-get_400_any")
|
||||
.click()
|
||||
.get(".try-out__btn")
|
||||
.click()
|
||||
.get(".execute")
|
||||
.click()
|
||||
.wait("@request")
|
||||
.get(".response-col_description .highlight-code .microlight")
|
||||
.should("have.text", "This should render")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
openapi: 3.0.0
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test API
|
||||
description: Test API
|
||||
paths:
|
||||
/400-any:
|
||||
get:
|
||||
description: returns 400
|
||||
responses:
|
||||
default:
|
||||
description: ok
|
||||
Reference in New Issue
Block a user