Skip to main content

atleast-one-or-more-model

Overview

This rule belongs to the apimatic-preliminary-linting ruleset and states that:

Complex data like JSON objects, arrays or enumerations must be defined using the global models/custom types in the API description file and then referenced in the request parameters or responses as required. This gives you better control over your API data as you can then easily serialize and deserialize the data when making API calls via our products like SDKs, etc.

PropertyValue
EnabledYes
Maximum SeverityInformation
MessageNo models defined.
CodeAPIMATICPRE_L107
TypeLinting
Rule SystemSemantic
Broad CategoryTypes/Models
Products ImpactedCode Generation, Developer Experience Portal, API Transformer
Tagspreliminary checks linting apimatic models types custom types complex models global models json data enumeration

Suggested Fixes

  • If your API calls involve exchanging data in the form of JSON objects or arrays, you should define global models/custom types in your API description to represent them and then reference these models in your request parameters or responses as required.
  • If your API calls involve exchanging data containing fixed values, you can benefit from defining global enumeration model/custom types to represent them and then referencing these models in request parameters/responses as required.

For More Information