Skip to main content

no-library-cyclic-dependency

Overview

This rule belongs to the raml-validation ruleset and states that:

A library fragment document can use uses property to reference external libraries if the assets defined in the current library require external assets as well. However, the uses property in a library fragment document must not be used to reference the library itself (whether directly or indirectly).

PropertyValue
EnabledYes
Maximum SeverityError
MessageCyclic dependency found in the library.
CodeRAML_V803
TypeValidation
Rule SystemSemantic
Broad CategoryLibraries
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsraml semantic validation cyclic library

Suggested Fixes

  • Ensure that the library does not eventually depend on itself when referencing external libraries using the uses property.
  • Identify the cyclic chain and break the loop e.g. if your library is A it may be possible that the dependency chain looks something like A -> B -> C -> A. In such cases the C -> A creates a cycle and needs to be modified so that the chain does not involve A itself again.

For More Information