spectral icon indicating copy to clipboard operation
spectral copied to clipboard

[AsyncAPI] Identify more orphaned components besides schemas

Open nulltoken opened this issue 5 years ago • 5 comments

In #974, the asyncapi ruleset has been initiated with a rule which will identify unused/orphaned schemas, under components.

As identified in #1073 this rule could really benefit from being extended to be able to detect other kinds of orphan objects (messageTraits, ...).

/cc @derberg

nulltoken avatar Apr 18 '20 15:04 nulltoken

I have/plan to create sub-issues for solving this issue, it is based on the available components in https://www.asyncapi.com/docs/specifications/v2.3.0#componentsObject.

List of sub-issues:

  • servers - https://github.com/stoplightio/spectral/pull/2097
  • channels - https://github.com/stoplightio/spectral/issues/2098
  • messages - TODO
  • securitySchemes - TODO
  • parameters - TODO
  • correlationIds - TODO
  • operationTraits - TODO
  • messageTraits - TODO
  • serverBindings - TODO
  • channelBindings - TODO
  • operationBindings - TODO
  • messageBindings - TODO

jonaslagoni avatar Mar 17 '22 23:03 jonaslagoni

Before adding the rest of the issues, a thought came to mind. Do we want all of these checks as part of one rule or split into multiple, as it seems https://github.com/stoplightio/spectral/pull/1440/files introduced 🤔

Or asked another way, have you folks seen a reason why someone might want to only check some of the components instead of all?

cc @P0lip

jonaslagoni avatar Mar 17 '22 23:03 jonaslagoni

cc @magicmatatjahu @smoya

jonaslagoni avatar Mar 21 '22 13:03 jonaslagoni

I wa surprised that a rule was made that only checks for one type of component (I have in mind that PR with servers). I would prefer to go the way it is done in OpenAPI (as you mentioned) - one rule for all types of components.

magicmatatjahu avatar Mar 21 '22 19:03 magicmatatjahu

Alright, let's keep it consistent then.

jonaslagoni avatar Mar 24 '22 19:03 jonaslagoni