-
Notifications
You must be signed in to change notification settings - Fork 194
Open
Labels
Type: BugSomething isn't workingSomething isn't working
Description
Describe the bug
I'm trying to define and reuse some "example" defined in yaml files for multiple models, but redocly doesn't seems to resolve them correctly.
To Reproduce
Consider this openapi.yaml file:
openapi: 3.0.0
info:
title: Test device API
version: "0.0.1"
description: |
This is a test description.
servers:
- url: /
description: Server
paths:
/test:
get:
tags:
- Test
summary: Test endpoint
operationId: getTest
responses:
"200":
description: The test response
content:
application/json:
schema:
$ref: ./TestSchema.yaml
example:
$ref: ./TestSchemaExample.yaml
components:
schemas:
TestSchema:
$ref: ./TestSchema.yamlTestSchema.yaml
type: object
properties:
testField:
$ref: ./TestField.yaml
anotherField:
$ref: ./AnotherField.yamlTestField.yaml
type: string
description: Test String
example: "Test"AnotherField.yaml
type: string
description: Test String
example: "Another"I'd like to define
TestSchemaExample.yaml
testField:
$ref: ./TestFieldExample.yaml
anotherField: "AnotherExample"TestFieldExample.yaml
"Test"Running
$ redocly bundle openapi.yaml --output dist/openapi.yaml --ext yamlResults in
openapi: 3.0.0
info:
title: Test device API
version: 0.0.1
description: |
This is a test description.
servers:
- url: /
description: Server
paths:
/test:
get:
tags:
- Test
summary: Test endpoint
operationId: getTest
responses:
'200':
description: The speaker preset
content:
application/json:
schema:
$ref: '#/components/schemas/TestSchema'
example:
testField:
$ref: ./TestFieldExample.yaml
anotherField: AnotherExample
components:
schemas:
TestSchema:
type: object
properties:
testField:
$ref: '#/components/schemas/TestField'
anotherField:
$ref: '#/components/schemas/AnotherField'
TestField:
type: string
description: Test String
example: Test
AnotherField:
type: string
description: Test String
example: AnotherAnd the file $ref is kept for the testField example.
Expected behavior
I'd like testField in the example to resolve the assigned ref.
Redocly version(s)
2.12.5
Node.js version(s)
v22.15.0
OS, environment
Ubuntu 24.04
Metadata
Metadata
Assignees
Labels
Type: BugSomething isn't workingSomething isn't working