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.
|Message||No models defined.|
|Products Impacted||Code Generation, Developer Experience Portal, API Transformer|
- 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.