resolvable-library-reference
Overview
This rule belongs to the raml-validation
ruleset and states that:
A RAML document can reference assets from within a library using dot notation as follows: concatenate the library name followed by a period (.), followed by the name of the data type, resource type, trait, security scheme, or annotation type. For this reference to be resolvable following conditions must be satisfied: the library name must match exactly with the name of a library declared in the uses
root level property, the library referenced must be accessible i.e. the path provided for the library in the uses
property must be valid, and the name of the referenced asset must match exactly with the asset defined in the library.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Provided library reference could not be resolved. |
Code | RAML_V802 |
Type | Validation |
Rule System | Semantic |
Broad Category | Libraries |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | raml semantic validation path asset reference library |
Suggested Fixes
- Ensure that the library name referenced is defined in the root level
uses
property and has no typos. Names are compared in a case-sensitive manner. - Look for any errors related to issues in accessing the library path provided in the
uses
key-value pairs and resolve them first. - Ensure that the asset name provided matches exactly with the name of an asset in the library and that there are no typos. Names are compared in a case-sensitive manner.
- Ensure that the asset type matches with expected asset type i.e. if you are trying to reference a library type, the name of the asset does indeed match with an asset defined in the library
types
list and not a resource type, trait, etc.
For More Information
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#applying-libraries
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#libraries
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md
- https://docs.apimatic.io/rulesets/overview/