-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #9199
- Loading branch information
Showing
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
describe("OAS 3.1 Empty response", () => { | ||
it("should not render an example for empty reponse", () => { | ||
cy.visit( | ||
"/?configUrl=/configs/default-model-rendering-model.yaml&url=/documents/bugs/oas31-empty-response.yaml" | ||
) | ||
.get("#operations-default-get_") | ||
.click() | ||
.get("#operations-default-get_ [data-code=200] .response-col_description__inner") | ||
.contains("no content") | ||
.get("#operations-default-get_ [data-code=200] .model-example") | ||
.should("not.exist") | ||
.get("#operations-default-get_ [data-code=201] .response-col_description__inner") | ||
.contains("no schema but an example") | ||
.get("#operations-default-get_ [data-code=201] .model-example") | ||
.contains('"foo": "bar"') | ||
.get("#operations-default-get_ [data-code=202] .response-col_description__inner") | ||
.contains("no schema but examples") | ||
.get("#operations-default-get_ [data-code=202] .model-example") | ||
.contains('"foo": "bar"') | ||
.get("#operations-default-get_ [data-code=203] .response-col_description__inner") | ||
.contains("no schema no example") | ||
.get("#operations-default-get_ [data-code=203] .model-example") | ||
.contains('"string"') | ||
}) | ||
}) |
1 change: 1 addition & 0 deletions
1
test/e2e-cypress/static/configs/default-model-rendering-model.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
defaultModelRendering: model |
31 changes: 31 additions & 0 deletions
31
test/e2e-cypress/static/documents/bugs/oas31-empty-response.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: Empty response test case | ||
version: '1' | ||
paths: | ||
'/': | ||
get: | ||
responses: | ||
'200': | ||
description: no content | ||
'201': | ||
description: no schema but an example | ||
content: | ||
application/json: | ||
example: | ||
foo: bar | ||
'202': | ||
description: no schema but examples | ||
content: | ||
application/json: | ||
examples: | ||
first: | ||
value: | ||
foo: bar | ||
second: | ||
value: | ||
baz: foobar | ||
'203': | ||
description: no schema no example | ||
content: | ||
application/json: {} |