3. Run this command `redocly bundle`
**Expected behavior**
The schema `iwontbedrop` being recursive is not drop even if not used outside of it's scope. So the expectation would be to have both `iwontbedrop` and `iwillbedrop` to be dropped
**Logs**
I confirm this is a bug. Thanks for reporting it!
Interesting enough, if you replace the current ref pointer with "#/components/schemas/iwillbedrop", both components will be removed.
Describe the bug
Using remove-unused-components decorator leave some schemas unused by operations but that are recursive.
To Reproduce Steps to reproduce the behavior:
redocly.yaml
fileapis: test: root: test.json
{ "openapi": "3.1.0", "components": { "schemas": { "iwontbedrop": { "properties": { "Myprop": { "items": { "anyOf": [ { "$ref": "#/components/schemas/iwontbedrop" } ] }, "type": "array" } }, "type": "object" }, "iwillbedrop": { "properties": { "name": { "title": "Name", "type": "string" } }, "type": "object" } } } }
bundling .../test.json... openapi: 3.1.0 components: schemas: iwontbedrop: properties: Myprop: items: anyOf:
OpenAPI description
Using version 3.1
Redocly Version(s)
1.25.8
Node.js
Version(s)22.4.0
OS, environment
MacOS Sonoma + Ubuntu