diff --git a/src/core/plugins/oas3/components/request-body.jsx b/src/core/plugins/oas3/components/request-body.jsx index b85f597d1ef..6490a3c1dc8 100644 --- a/src/core/plugins/oas3/components/request-body.jsx +++ b/src/core/plugins/oas3/components/request-body.jsx @@ -262,6 +262,15 @@ const RequestBody = ({ if (testValueForJson) { language = "json" } + const example = isExecute ? : + {stringify(requestBodyValue) || sampleRequestBody} + return
{ requestBodyDescription && @@ -282,35 +291,17 @@ const RequestBody = ({ /> ) : null } - { - isExecute ? ( -
- -
- ) : ( - - {stringify(requestBodyValue) || sampleRequestBody} - - } - includeWriteOnly={true} - /> - ) - } + { sampleForMediaType ? ( { + it("should render the Schema tab in Try it out mode for request body", () => { + cy + .visit("?url=/documents/features/oas3-xml.json") + .get("#operations-default-post_foo") + .click() + .get(".btn.try-out__btn") + .click() + .get(".opblock-section-request-body") + .within(() => { + cy.contains("button", "Schema") + .should("exist") + .and("be.visible") + .click() + + cy + .get('[data-name="modelPanel"]') + .should("be.visible") + + cy + .get('[data-name="examplePanel"]') + .should("not.exist") + }) + }) +})