-
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.
fix: provide JSON editor for x-www-form-urlencoded bodies lacking pro…
…perties
- Loading branch information
Showing
5 changed files
with
102 additions
and
9 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
35 changes: 35 additions & 0 deletions
35
test/e2e-cypress/static/documents/bugs/5072/additional.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,35 @@ | ||
openapi: "3.0.0" | ||
info: | ||
description: "A sample API for " | ||
version: "1.0.0" | ||
title: "Sample" | ||
contact: | ||
name: "" | ||
url: "http://website.com" | ||
email: "admin@mail.com" | ||
paths: | ||
/: | ||
post: | ||
summary: Create/modify object | ||
operationId: postObject | ||
parameters: | ||
- name: filterParams | ||
in: query | ||
description: Additional filter fields | ||
required: false | ||
schema: | ||
type: object | ||
requestBody: | ||
content: | ||
application/x-www-form-urlencoded: | ||
schema: | ||
type: object | ||
additionalProperties: | ||
type: string | ||
responses: | ||
'200': | ||
description: Status message | ||
content: | ||
application/json: | ||
schema: | ||
type: object |
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,33 @@ | ||
openapi: "3.0.0" | ||
info: | ||
description: "A sample API for " | ||
version: "1.0.0" | ||
title: "Sample" | ||
contact: | ||
name: "" | ||
url: "http://website.com" | ||
email: "admin@mail.com" | ||
paths: | ||
/: | ||
post: | ||
summary: Create/modify object | ||
operationId: postObject | ||
parameters: | ||
- name: filterParams | ||
in: query | ||
description: Additional filter fields | ||
required: false | ||
schema: | ||
type: object | ||
requestBody: | ||
content: | ||
application/x-www-form-urlencoded: | ||
schema: | ||
type: object | ||
responses: | ||
'200': | ||
description: Status message | ||
content: | ||
application/json: | ||
schema: | ||
type: object |
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,22 @@ | ||
describe("#5072: x-www-form-urlencoded request body input when `properties` is missing", () => { | ||
it("should provide a JSON input for an empty object schema", () => { | ||
cy | ||
.visit("?url=/documents/bugs/5072/empty.yaml") | ||
.get("#operations-default-postObject") | ||
.click() | ||
.get(".try-out__btn") | ||
.click() | ||
.get(`.opblock-section-request-body textarea`) | ||
.should("have.value", "{}") | ||
}) | ||
it("should provide a JSON input for an additionalProperties object schema", () => { | ||
cy | ||
.visit("?url=/documents/bugs/5072/additional.yaml") | ||
.get("#operations-default-postObject") | ||
.click() | ||
.get(".try-out__btn") | ||
.click() | ||
.get(`.opblock-section-request-body textarea`) | ||
.contains(`"additionalProp1": "string"`) | ||
}) | ||
}) |