-
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(callbacks): display all defined callbacks (#9223)
Refs #9222
- Loading branch information
Showing
3 changed files
with
79 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Related to // https://github.com/swagger-api/swagger-ui/issues/9222. | ||
*/ | ||
|
||
describe("OpenAPI 3.0 Callbacks", () => { | ||
it("should render all defined callbacks", () => { | ||
cy.visit( | ||
"/?url=/documents/features/oas3-callbacks.yaml" | ||
) | ||
.get("#operations-Device-register") | ||
.click() | ||
.get(".opblock-section-header .tab-item.false") | ||
.click() | ||
.get("#operations-callbacks-callbackOne") | ||
.should("be.visible") | ||
.get("#operations-callbacks-callbackTwo") | ||
.should("be.visible") | ||
}) | ||
}) |
41 changes: 41 additions & 0 deletions
41
test/e2e-cypress/static/documents/features/oas3-callbacks.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,41 @@ | ||
openapi: 3.0.0 | ||
servers: [] | ||
info: | ||
version: "1.0.0" | ||
title: home-iot-api | ||
description: The API | ||
paths: | ||
/devices: | ||
get: | ||
callbacks: | ||
callbackOne: | ||
'callbackOne': | ||
get: | ||
operationId: callbackOne | ||
responses: | ||
'200': | ||
$ref: '#/components/schemas/ApiResponse' | ||
callbackTwo: | ||
'callbackTwo': | ||
get: | ||
operationId: callbackTwo | ||
responses: | ||
'200': | ||
$ref: '#/components/schemas/ApiResponse' | ||
tags: | ||
- Device | ||
operationId: register | ||
responses: | ||
'200': | ||
description: successfully registered device | ||
components: | ||
schemas: | ||
ApiResponse: | ||
type: object | ||
properties: | ||
code: | ||
type: integer | ||
format: int32 | ||
message: | ||
type: string | ||
example: everything is ok |