Decorator or feature flag to bundle merge "allOf" schemas
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Is your feature request related to a problem? Please describe.
Let's say I have these schemas:
schemas:
Car:
allOf:
- $ref: #/components/schemas/Make
- $ref: #/components/schemas/Model
- type: object
properties:
manufacturedAt:
type: string
format: date
color:
type: string
Make:
type: object
properties:
make:
type: string
enum:
- Batmobile
- DeLorean
Model:
type: object
properties:
model:
type: string
And now, I have an application (not Redocly), that needs to consume this schema and operate on it. The application struggles with the allOf. I wish to have a resulting merged schema like the following to make it easier for third party programs to use:
Car:
type: object
properties:
make: ...
model: ...
manufacturedAt: ...
color: ...
Describe the solution you'd like
- A flag on the bundle command like
--merge-all-of. - A decorator that can be included in a
redocly.yamlfile likemerge-all-of.
Describe alternatives you've considered
Requesting third party libs have better allOf support. 🤣
Additional context
None
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
Start by examining the bundle command and the redocly.yaml decorator configuration mentioned in the issue. Determine how merging referenced allOf schemas should handle the shown properties and references, then verify that both the --merge-all-of flag and merge-all-of decorator produce the requested flattened schema.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100