valid-resource-type-name
Overview
This rule belongs to the raml-validation
ruleset and states that:
A resource may specify the resource type from which it is derived using the optional type
property. The value must be the name of a resource type defined within the root-level resourceTypes
object or in a library.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Resource type with provided name could not be found. |
Code | RAML_V500 |
Type | Validation |
Rule System | Semantic |
Broad Category | Resource Types and Traits |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | raml semantic validation name resource type resource |
Suggested Fixes
- Ensure that the resource name matches name of the pre-defined resource type exactly and has no typos. Names are compared in a case-sensitive manner.
- Ensure that a resource type with that name is defined in the root object level
resourceTypes
property in the same RAML file or an external library. - If you are trying to reference a library's resource type, ensure that the library is accessible and the library key used in the reference matches with the library declaration. Also ensure that the resource type does indeed exist in the same library.
For More Information
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#applying-resource-types-and-traits
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#resource-types-and-traits
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#resource-property
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#applying-resource-types-and-traits
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#resource-types-and-traits
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#resources-and-nested-resources
- 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/