Skip to main content

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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageProvided type for type declaration is invalid.
CodeRAML_V202
TypeValidation
Rule SystemSemantic
Broad CategoryTypes
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsraml 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