Remove unused components in bundle removes array item references
Open
Nobody has claimed this yet.
p2
Type: Bug
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Any scheme used via
type: array
items:
$ref: some-reference
will be removed if --remove-unused-components flag is used in the redocly bundle command.
Same spec with workaround
type: array
items:
allOf:
-$ref: some-reference
will not suffer from this issue.
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
Reproduce the issue with redocly bundle --remove-unused-components using an array whose items contain a direct $ref, then compare it with the allOf workaround shown in the report. Trace the bundle component-removal path; done means direct array item references remain in the bundled output while genuinely unused components are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, typescript
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100