You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS: [e.g. macOS] Windows 10 Pro
Browser: [e.g. chrome, safari] chrome
Version: [e.g. 22] Version 85.0.4183.102 (Official Build) (64-bit)
Method of installation: [e.g. npm, dist assets] raw code
Swagger-UI version: [e.g. 3.10.0] master
Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] 3.0.1
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.1info:
title: Example Swaggerversion: '1.0'servers:
- url: /api/v1paths:
/xmlTest:
post:
summary: sample issuesoperationId: registerSubscriptionparameters: []requestBody:
description: Simple Testcontent:
application/xml:
schema:
$ref: "#/components/schemas/Test"example:
x: should be xmlresponses:
'200':
description: Simple examplecontent: {}components:
schemas:
Test:
type: objectxml:
name: rootproperties:
x:
type: stringother:
type: stringformat: emailexample:
x: what the f
Describe the bug you're encountering
When providing examples via examples or example keyword for requestBody content it will not be rendered according to content-type.
To reproduce...
Open yaml at editor and try to view xml requestBody sample. You can delete the example part and it will render it in xml.
Expected behavior
Examples provided via examples or example for requestBody definition should be rendered respecting the content-type.
With example requestBody:
Without:
Q&A (please complete the following information)
OS: [e.g. macOS] Windows 10 Pro
Browser: [e.g. chrome, safari] chrome
Version: [e.g. 22] Version 85.0.4183.102 (Official Build) (64-bit)
Method of installation: [e.g. npm, dist assets] raw code
Swagger-UI version: [e.g. 3.10.0] master
Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] 3.0.1
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
When providing examples via
examples
orexample
keyword for requestBody content it will not be rendered according to content-type.To reproduce...
Open yaml at editor and try to view xml requestBody sample. You can delete the
example
part and it will render it in xml.Expected behavior
Examples provided via
examples
orexample
for requestBody definition should be rendered respecting the content-type.With
example
requestBody:Without:
Additional context or thoughts
Same as for Responses #6442
The text was updated successfully, but these errors were encountered: