This issue is related to OAS3 examples support.
Q&A (please complete the following information)
- OS: Windows 10
- Browser: any
- Method of installation: https://editor.swagger.io
- Swagger-UI version: 3.23.0
- Swagger/OpenAPI version: OpenAPI 3.0
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.0.2
info:
title: test
version: 0.0.0
paths:
/foo:
post:
requestBody:
description: A JSON object, XML object, or text string containing foo data
required: true
content:
application/json:
schema:
type: object
examples:
foo_json:
value:
foo: bar
bar_json:
value:
bar: foo
text/plain:
schema:
type: string
example: Hello, world!
application/xml:
schema:
type: object
examples:
foo_xml:
value: <foo>bar</foo>
bar_xml:
value: <bar>foo</bar>
responses:
201:
description: Created
Describe the bug you're encountering
In certain cases, switching between media types does not update the displayed "Example Value".
Steps to reproduce
- Go to https://editor.swagger.io and paste the spec above.
- Expand the operation.
- From the "Examples" list, select "bar_json".
- From the media types list, select "application/xml".
=> The "Examples" list is updated to contain "foo_xml" and "bar_xml" but the displayed "Example Value" is not updated.
- From the media types list, select "text/plain".
=> "Example Value" still contains the JSON example. Should display "Hello, world!".
Screenshots
Screenshot for step 4:

This issue is related to OAS3
examplessupport.Q&A (please complete the following information)
Content & configuration
Example Swagger/OpenAPI definition:
Describe the bug you're encountering
In certain cases, switching between media types does not update the displayed "Example Value".
Steps to reproduce
=> The "Examples" list is updated to contain "foo_xml" and "bar_xml" but the displayed "Example Value" is not updated.
=> "Example Value" still contains the JSON example. Should display "Hello, world!".
Screenshots
Screenshot for step 4:
