redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

false warning about unused decorator

Open jazanne opened this issue 2 years ago • 4 comments

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

jazanne avatar Jan 11 '24 21:01 jazanne

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

tatomyr avatar Jan 12 '24 09:01 tatomyr

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.

lornajane avatar Feb 13 '24 13:02 lornajane