valid-type-declaration-type
Overview
This rule belongs to the raml-validation
ruleset and states that:
The value of a type node must either be the name of a user-defined type, the name of a built-in RAML data type (object, array, or one of the scalar types) or an inline type declaration.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Provided type for type declaration is invalid. |
Code | RAML_V202 |
Type | Validation |
Rule System | Semantic |
Broad Category | Types |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | raml semantic validation type type declaration |
Suggested Fixes
- Ensure that the type name does not have any typos. Names are compared in a case-sensitive manner.
- Supported scalar types: number, boolean, string, date-only, time-only, datetime-only, datetime, file, integer, nil.
- Supported complex types: any, object, array.
- Union types use a pipe '|' character. Ensure that the pipe character is separated from the text with one space on both ends.
- If the type exists in a library, ensure that the type name is preceded by the library name and followed by a dot i.e.
[libary name].[type name]
. Also ensure that the library is indeed accessible. - If you are defining the type inline, ensure the inline declaration is a valid type declaration.
For More Information
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#type-declarations
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#built-in-types
- 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/