atleast-one-type-combinator-set-in-global-type-combinators
Overview
This rule belongs to the apimatic-preliminary-linting ruleset and states that:
A global type combinators definition expects at least one type combinator definition e.g. anyOf, oneOf, not. This means that the type cases in a type combinator must contain at least one type case.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | No type combinator found in the global type combinators definition. |
| Code | APIMATICPRE_L196 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | Types/Models |
| Products Impacted | Code Generation, Developer Experience Portal, API Transformer |
| Tags | preliminary checks linting apimatic global type combinators type combinator type cases anyOf oneOf not |
Suggested Fixes
- If the type combinators entry is not expected to contain any type combinator (anyOf, oneOf, not), it is recommended to remove this entry and update references accordingly.
- Add at least one type combinator (anyOf, oneOf, not) in the global type combinators entry.
- A type combinator (anyOf, oneOf, not), when specified, must contain at least one type definition/case.