Redocly / redocly-cli

⚒️ Redocly CLI makes OpenAPI easy. Lint/validate to any standard, generate beautiful docs, and more.
https://redocly.com/docs/cli/
MIT License
909 stars 139 forks source link

false warning about unused decorator #1391

Open jazanne opened 8 months ago

jazanne commented 8 months ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

npx @redocly/cli bundle apidocs/openapi.json -o apidocs/openapi.json

Expected behavior

Should not log warning about unused decorator since unused components were removed

Logs

bundling apidocs/ld-openapi.json...
📦 Created a bundle for apidocs/ld-openapi.json at apidocs/ld-openapi.json 128ms.
🧹 Removed 4 unused components.
[WARNING] Unused decorators found in .redocly.yaml: remove-unused-components.`

OpenAPI description

.redocly.yaml

extends:
  - recommended
rules:
  operation-operationId: error
  operation-operationId-unique: error
  no-unused-components: error
decorators:
  remove-unused-components: true

Redocly Version(s)

1.6.0

Node.js Version(s)

v21.3.0

tatomyr commented 8 months ago

Thanks for bringing this up! I believe it is related to the way Redocly CLI handles this specific decorator.

lornajane commented 7 months ago

I'm also running into this issue where the unused components are removed, everything works perfectly, but I get the message that the decorator was unused.