type-declaration-type-and-schema-are-mutually-exclusive
Overview
This rule belongs to the raml-validation ruleset and states that:
The properties schema and type in a type declaration are mutually exclusive. This means that in a type declaration, only one of these properties must be present at a time but not both. It is recommended to use the type property because a future RAML version might remove the schema alias with that property.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Type declaration contains both schema and type properties. |
| Code | RAML_V203 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Types |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | raml semantic validation schema type declaration type |
Suggested Fixes
- Remove the
schemaproperty from the type declaration.
For More Information
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#type-declarations:~:text=API%20definitions%20SHOULD%20use%20the%20%22type%22%20facet%20because%20the%20%22schema%22%20alias%20for%20that%20facet%20name%20might%20be%20removed%20in%20a%20future%20RAML%20version
- 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/