fix(components): fix rendering for empty examples in responses (#9926)
Refs #9499
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @prettier
|
||||
*/
|
||||
|
||||
describe("Response examples", () => {
|
||||
it("should render a generated example when an empty examples object is provided", () => {
|
||||
cy.visit("/?url=/documents/features/response-empty-examples-object.yaml")
|
||||
.get("#operations-TEST-test")
|
||||
.click()
|
||||
.get(".example.microlight")
|
||||
.should("exist")
|
||||
.contains("{}")
|
||||
.get(".examples-select-element")
|
||||
.should("not.exist")
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,25 @@
|
||||
openapi: 3.1.0
|
||||
info:
|
||||
title: TEST
|
||||
description: TEST
|
||||
version: '1.0'
|
||||
servers:
|
||||
- url: localhost:8080
|
||||
tags:
|
||||
- name: TEST
|
||||
paths:
|
||||
/test-endpoint:
|
||||
get:
|
||||
summary: Test
|
||||
operationId: test
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
examples: {}
|
||||
description: Test
|
||||
tags:
|
||||
- TEST
|
||||
Reference in New Issue
Block a user