Description
Q&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Version: 124.0.6367.156
- Swagger-UI version: 5.17.9
- Swagger/OpenAPI version: OpenAPI 3.1
Content & configuration
Example Swagger/OpenAPI definition:
openapi: 3.1.0
info:
version: 1.0.0
title: Examples
description: ''
webhooks:
test-webhook:
post:
operationId: test-webhook
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TestSchema'
examples:
TestExample:
$ref: '#/components/examples/TestExample'
responses:
'200':
description: OK
paths:
/test-path:
get:
operationId: 'test-path'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/TestSchema'
examples:
TestExample:
$ref: '#/components/examples/TestExample'
components:
schemas:
TestSchema:
type: object
properties:
userId:
type: string
examples: ['userId example from schema']
orders:
type: array
items:
type: object
properties:
orderId:
type: string
examples: ['orderId example from schema']
examples:
TestExample:
value:
userId: 'userId example from examples'
orders:
- orderId: 'orderId example from examples'
Describe the bug you're encountering
In webhooks the specified examples are being overwritten by the examples from the schema defined in the same content type, despite the example chosen in the dropdown:

This does not happen for paths - the example values are correctly rendered from the chosen example and not from the schema:

Additionally, if I first expand the webhook, I will see the example from the schema. Expanding the path after that will show the correct example there and also overwrite the example in webhook to the correct one:

This will not happen if I first expand the path and then the webhook:

Also, expanding, collapsing and then expanding the webhook again will show the correct example as well.
To reproduce...
Steps to reproduce the behavior:
- Load the attached specification
- Expand the webhook
- See that the example is the one defined in the schema
- Expand the path
- See that the example is the one defined in the example selected in the dropdown
- Scroll down to the webhook and see that the incorrect example was overwritten by the correct example
Expected behavior
The displayed example should be the one defined in examples / selected in the dropdown.