OpenAPIParser's merge allOf doesn't merge examples
Open
Nobody has claimed this yet.
help wanted
openapi
Type: Enhancement
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
I have the following response:
"200" : {
"description" : "The request has succeeded.",
"content" : {
"application/json" : {
"schema" : {
"type" : "object",
"properties" : {
"statistics" : {
"allOf" : [ {
"$ref" : "#/components/schemas/pageStatistics"
}, {
"example" : {
"currentPage" : 1,
"pageSize" : 1
}
} ]
}
}
}
}
}
}
statistics uses a schema which contains a sample response, but it gets overwritten by example and it shall contain only two properties. It renders correctly in SwaggerUI, but not with Redoc as seen in the attached image.

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
OpenAPIParser's allOf merge path is the named entry point; reproduce the supplied schema and inspect how the referenced example and inline example are combined. Done means Redoc renders statistics with the intended two properties, matching the behavior shown in SwaggerUI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100