Skip to main content

common-base-type-of-multiple-inheritance-types

Overview

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

When multiple inheritance is used i.e. a sequence of types are passed to the type property, all types involved must have a common base/primitive type. This means that it is not allowed to inherit from different kind of primitive types, for example [ number, string ].

PropertyValue
EnabledYes
Maximum SeverityError
MessageTypes involved in multiple inheritance have different base types.
CodeRAML_V206
TypeValidation
Rule SystemSemantic
Broad CategoryTypes
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsraml semantic validation multiple inheritance type

Suggested Fixes

  • Ensure that each type involved in the type list has the same base primitive type e.g. number, string, object, array, boolean etc.
  • If a type is a number and another is object or string, they cannot be used together for the purpose of multiple inheritance.
  • Decide one base type that you want to inherit from then remove all types from the type list that introduce a different set of base types.

For More Information