Open
Description
Q&A (please complete the following information)
- OS: Debian 12
- Browser: Chrome
- Version: 133
- Method of installation: dist folder
- Swagger-UI version: 5.20.8
- Swagger/OpenAPI version: OpenAPI 3.1.0
Content & configuration
index.yaml
openapi: 3.1.0
info:
title: 'Bug test'
version: 1.0.0
servers:
- url: /bug
paths:
/test:
$ref: test.yaml
test.yaml:
post:
responses:
'200':
content:
application/json:
examples:
testExample:
summary: Test example
externalValue: test.json
test.json:
{}
Describe the bug you're encountering
This configuration with $ref used in path is throwing Error:
Resolver error at post.responses.200.content.application/json.examples.testExample.externalValue
Could not resolve reference: ExampleElement value and externalValue fields are mutually exclusive.
When there is no $ref used and the content of test.yaml is directly included in the main index.yaml, no error occurs.
To reproduce...
Just open this definition in UI.
Expected behavior
This error should not occur as the definition is exactly the same. The difference is just the $ref. The $ref is supported under particular paths in OpenAPI 3.