Prevent `redocly bundle` from creating new schema objects in `#/components/schemas` when using `--dereferenced` option
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 228
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 48
Description
Describe the bug
The redocly bundle command is adding schema objects to the #/components/schemas section of the bundled schema, even when using the --dereferenced option is used.
Closed issue #239 seems to be similar and points to using the --dereferenced option to solve this issue.
To Reproduce
Steps to reproduce the behavior:
- Given this
redocly.yamlfile - And these OpenAPI files
- Run
npx redocly bundle schema/openapi.json --dereferenced -o out/openapi.json - See that
PropertyValuePairandErrorschema objects are added to#/components/schemasin the bundled OpenAPI document
Expected behavior
I would expect only (dereferenced versions of) the schema objects present in schemas.json to be in the #/components/schemas section of the bundled and dereference OpenAPI document.
Logs
OpenAPI description
OpenAPI v3.1 - see example repo
Redocly Version(s)
"@redocly/cli": "^1.25.11",
Node.js Version(s)
v18.20.4 and v20.12.2
OS, environment
Kubuntu 22.04
Additional context
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 schema/openapi.json, schema/schemas.json, redocly.yaml, and npx redocly bundle ... --dereferenced. Start at the bundle command's dereferencing and schema-component handling, then verify that only the expected schemas remain in the bundled OpenAPI document.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, openapi, typescript
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100