-
Notifications
You must be signed in to change notification settings - Fork 8.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): parameter array missing items fallback (#7376)
* fixes #7375
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 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
24 changes: 24 additions & 0 deletions
24
test/e2e-cypress/static/documents/features/parameter-array-missing-items.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,24 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: test | ||
version: "1.0.0" | ||
paths: | ||
/example1: | ||
get: | ||
description: test fetching | ||
parameters: | ||
- in: query | ||
name: basicName | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
color: | ||
oneOf: | ||
- type: array # invalid definition b/c type: array is missing 'items' | ||
- type: string | ||
- type: integer | ||
responses: | ||
'200': | ||
description: successfull fetch |
10 changes: 10 additions & 0 deletions
10
test/e2e-cypress/tests/features/parameter-array-missing-items.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,10 @@ | ||
describe("Parameter - Invalid definition with missing array 'items' (#7375)", () => { | ||
it("should render gracefully with fallback to default value", () => { | ||
cy.visit("/?url=/documents/features/parameter-array-missing-items.yaml") | ||
.get("#operations-default-get_example1") | ||
.click() | ||
.get("tbody > tr > .parameters-col_description textarea") | ||
.should("exist") | ||
.should("contains.text", "{}") | ||
}) | ||
}) |