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 ].
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Types involved in multiple inheritance have different base types. |
| Code | RAML_V206 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Types |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | raml semantic validation multiple inheritance type |
Suggested Fixes
- Ensure that each type involved in the
typelist 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
typelist that introduce a different set of base types.