Link Item to more object types, example using anyOf / oneOf doesn't work as an example in a child element
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
Redoc - possibility to link Item to more object types, example using anyOf / oneOf doesnt work as an example in a child element. Redoc example responses does not show the child as expected.
Example response
For the 200 respones Example, I only get one field in the example response. Does not reflect what is in response schema.

Response Schema
the response schema ( Which is based on the same code). We get the proper output that i wanted:

Expected behavior
Should look like this the example response.

Additional context
PortfolioItemResponseDto:
required:
- bucketId
- description
- itemName
- itemType
type: object
properties:
riskSafety:
type: string
nullable: true
...
...
...
toObjectLink:
type: array
items:
$ref: '#/components/schemas/ObjectLinkBasic'
nullable: true
toDecisionPoint:
type: array
items:
$ref: '#/components/schemas/DecisionPointBasic'
nullable: true
toFinancialPlanning:
type: array
items:
$ref: '#/components/schemas/FinancialPlanningBasic'
nullable: true
additionalProperties: false
ObjectLinkBasic:
required:
- itemGuid
- objectType
type: object
properties:
objectType:
type: string
example: String
nullable: true
itemGuid:
type: string
example: 000d3ac2-4d73-1eeb-b1a5-438f3f492902
nullable: true
oneOf:
- $ref: '#/components/schemas/ThelmaLink'
- $ref: '#/components/schemas/ProjectLink'
- $ref: '#/components/schemas/MaintenanceRecordLink'
additionalProperties: false
ThelmaLink:
properties:
thelmaId:
type: string
nullable: true
ProjectLink:
properties:
projectId:
type: string
nullable: true
MaintenanceRecordLink:
properties:
maintenanceRecordId:
type: string
nullable: true
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies no source files or tests. Reproduce the response example from the supplied PortfolioItemResponseDto and ObjectLinkBasic oneOf schemas, then trace the example-rendering entry point; done means the child fields are represented in the generated example as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100