-
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(sample-gen): oas3 form-data object should generate example (#7355)
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 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
28 changes: 28 additions & 0 deletions
28
test/e2e-cypress/static/documents/features/request-body/multipart/default-views.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,28 @@ | ||
openapi: 3.0.3 | ||
info: | ||
title: multipart/form-data schema object | ||
version: 0.0.1 | ||
paths: | ||
/test: | ||
post: | ||
requestBody: | ||
content: | ||
multipart/form-data: | ||
schema: | ||
type: object | ||
properties: | ||
file: | ||
type: string | ||
format: binary | ||
parameters: | ||
"$ref": "#/components/schemas/TestBody" | ||
responses: | ||
200: | ||
description: ok | ||
components: | ||
schemas: | ||
TestBody: | ||
type: object | ||
properties: | ||
stuff: | ||
type: string |
16 changes: 16 additions & 0 deletions
16
test/e2e-cypress/tests/features/oas3-request-body-default-views.js
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,16 @@ | ||
describe("OAS3 default views", () => { | ||
describe("multipart/form-data", () => { | ||
it("should display calculated object string, when no examples provided (#7268)", () => { | ||
cy.visit( | ||
"/?url=/documents/features/request-body/multipart/default-views.yaml", | ||
) | ||
.get("#operations-default-post_test") | ||
.click() | ||
// Expand Try It Out | ||
.get(".try-out__btn") | ||
.click() | ||
.get(".parameters-col_description textarea") | ||
.should("contains.text", "\"stuff\": \"string\"") | ||
}) | ||
}) | ||
}) |