fix(oas31): render responses with empty content field (#9664)

Refs #9199
This commit is contained in:
Vladimír Gorej
2024-03-06 14:20:45 +01:00
committed by GitHub
parent 4b4760d7fd
commit e2be707d7c
10 changed files with 356 additions and 13 deletions

View File

@@ -0,0 +1,21 @@
/**
* @prettier
*/
describe("OpenAPI 3.1.0 response with empty content", () => {
it("should render a response", () => {
cy.visit(
"/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-empty-content.yaml"
)
.get("#operations-Enterprise-get_enterprise_detail")
.click()
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner"
)
.contains("No enterprise matching the requested ID could be found.")
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example"
)
.should("not.exist")
})
})

View File

@@ -0,0 +1,21 @@
/**
* @prettier
*/
describe("OpenAPI 3.1.0 response with empty Media Type Object", () => {
it("should render a response", () => {
cy.visit(
"/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-empty-media-type.yaml"
)
.get("#operations-Enterprise-get_enterprise_detail")
.click()
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner"
)
.contains("No enterprise matching the requested ID could be found.")
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example"
)
.should("not.exist")
})
})

View File

@@ -0,0 +1,21 @@
/**
* @prettier
*/
describe("OpenAPI 3.1.0 response without content", () => {
it("should render a response", () => {
cy.visit(
"/?configUrl=/configs/oas31-response-no-content.yaml&url=/documents/features/oas31-response-no-content.yaml"
)
.get("#operations-Enterprise-get_enterprise_detail")
.click()
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .response-col_description__inner"
)
.contains("No enterprise matching the requested ID could be found.")
.get(
"#operations-Enterprise-get_enterprise_detail [data-code=404] .model-example"
)
.should("not.exist")
})
})