get:
tags:
- foo
summary: Get a list of foo
description: |
Get a list of Foo
operationId: account
parameters:
- $ref: ../../components/headers/key.yaml
- $ref: ../../components/headers/channel.yaml
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "../../components/schemas/foo/get-foo-response-schema.json"
examples:
response:
value:
$ref: "../../components/examples/foo/getFooResponse.json"
"404":
description: Not found
"410":
description: error
Describe the bug you're encountering
The $ref described in the example: does not render. Instead, it displays the $ref string.
Q&A (please complete the following information)
Content & configuration
The swagger content and configuration is split among multiple files, see repository github.com/ygurin/swagger-bug-demo.
The structure of the project looks like so:
This is the main openapi.yaml file:
points to paths/foo/foo.yaml
Describe the bug you're encountering
The $ref described in the example: does not render. Instead, it displays the $ref string.
To reproduce...
Steps to reproduce the behaviour:
docker build -t foo:v1 .
docker run --rm -p 80:8080 -e API_URL="openapi/openapi.yaml" foo:v1
Expected behavior
Swagger UI renders the referenced example in the response.
Screenshots
Additional context or thoughts
I'm currently using an extension in VScode called OpenAPI (Swagger) Editor. This uses a version of Swagger-UI.
It seems to render the example with no issues, see the screenshot below: