Define & Validate APIsValidation RulesetsAPIMatic Rulesets

APIMatic Post-Processing Validation

APIMatic post-processes a user-provided API specification document and automatically fixes some common issues. This validation mainly informs users about these issues and the fixes performed.

PropertyValue
Ruleset IDapimatic-post-processing-validation
Code prefixAPIMATICPOSTPROCESS_V
TypeValidation
Default severityWarning
Rule systemSemantic
Rules47

Rules marked (disabled) are turned off by default, so they don't report issues.

Server Configuration

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V001server-parameter-cannot-be-arrayWarningServer URL parameters cannot be declared as arrays. Only primitive types like string, number or string/number enumeration types are allowed. Array type server parameters will be automatically converted to non-array entities.
APIMATICPOSTPROCESS_V002server-parameter-cannot-be-map-objectWarningServer URL parameters cannot be declared as maps or objects. Only primitive types like string, number or string/number enumeration types are allowed. Map/object type server parameters will be automatically converted to primitive entities.
APIMATICPOSTPROCESS_V003server-parameter-cannot-be-constantWarningServer URL parameter cannot be declared as read-only or constant. Such parameters will be automatically marked as non-constant entities.

Authentication

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V101valid-oauth-2-parameter-formatWarningThe format specified for an OAuth 2.0 parameter, indicating how the parameter should be sent, must be one of the allowed formats for that authentication parameter e.g. form and query are the only allowed formats for the grant_type parameter.
APIMATICPOSTPROCESS_V102supported-oauth-2-parameter-formatWarningThe format specified for an OAuth 2.0 parameter, indicating how the parameter should be sent, must be one of the allowed formats for that authentication parameter. If, however, we have no parameter entry beforehand indicating its allowed formats, then all formats specified by user for such a parameter will be ignored.
APIMATICPOSTPROCESS_V103non-empty-authentication-scheme-nameWarningAuthentication scheme key name must be non-null and non-empty.
APIMATICPOSTPROCESS_V104non-null-non-empty-applied-authentication-scheme-nameWarningWhen an authentication scheme is applied, the authentication scheme name must be non-null, non-empty and correspond with the name of a predefined authentication scheme. If that is not the case, the authentication will not be considered as an applicable form of an authentication option.
APIMATICPOSTPROCESS_V105unique-authentication-option-nameWarningThe name assigned to an authentication option in a list must be unique. If that is not the case, the authentication option is automatically assigned a unique name.
APIMATICPOSTPROCESS_V106unique-authentication-optionsWarningAn authentication option in a list of options must be unique. If that is not the case, it will be automatically removed. The uniqueness of an authentication option is determined by uniqueness of the authentication schemes that need to be applied as part of this option, required scope values, etc.
APIMATICPOSTPROCESS_V107authentication-scheme-referenced-by-auth-optionWarningA valid authentication option must reference at least one or more predefined authentication schemes depending on the option type. A single authentication option type can only reference one authentication scheme while a group authentication option can consist of two or more authentication schemes. An option that does not reference any authentication scheme will be considered an invalid option and automatically removed from the list of available options.
APIMATICPOSTPROCESS_V108unique-authentication-schemes-in-group-auth-optionWarningA group authentication option is one that makes use of multiple authentication schemes to complete the authentication. It must not consist of duplicate authentication schemes and if any are found they will be automatically removed.
APIMATICPOSTPROCESS_V109two-or-more-authentication-schemes-in-group-auth-optionInformationA group authentication option makes use of multiple authentication schemes to complete the authentication. Therefore, it must consist of at least two or more authentication schemes. If it consists of only a single authentication scheme, its type will be automatically changed from 'Group' to 'Single'.

Endpoints

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V201endpoint-group-globally-definedWarning (disabled)An endpoint can only be placed inside an endpoint group which is pre-defined under the API level endpoint groups definition. If that is not the case, the missing group definition will be automatically generated and added in the global endpoint groups.
APIMATICPOSTPROCESS_V202unique-endpoint-scopesWarningThe required scopes of an endpoint must be unique.

Endpoint Parameters

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V251valid-parameter-primitive-typeWarning (disabled)Some types like "Binary", "Void" and "Dynamic" are not applicable to parameters and, therefore, will be auto-converted to their equivalent valid types.
APIMATICPOSTPROCESS_V252predefined-endpoint-path-template-parameterInformationAll path/template parameters present in the endpoint relative route must have a corresponding definition in the endpoint.
APIMATICPOSTPROCESS_V253valid-template-parameter-formatWarningPath/Template parameter present in the endpoint relative route must have "Template" set as its format in its corresponding endpoint definition.

Endpoint Responses

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V301valid-response-primitive-typeWarning (disabled)Some types like "File" and "Object" are not applicable to responses and, therefore, will be auto-converted to their equivalent valid types.
APIMATICPOSTPROCESS_V302non-empty-response-content-media-typeWarningResponse content media type must be non-null and non-empty.
APIMATICPOSTPROCESS_V303sorted-error-codesWarningError codes must be sorted in an ascending/increasing order. If they are found to be out of order, they will be sorted automatically during the post-processing.

Types

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V351native-primitive-typeWarningA component in SDL (an internal format to which the user API specification docuemnt is converted) can only use primitive types which are supported by APIMatic. A non-native primitive type will be converted to APIMatic's supported primitive types.
APIMATICPOSTPROCESS_V352dynamic-entities-cannot-be-arraysWarningIf an entity has the type "Dynamic", it cannot be declared as an array. If it is marked as an array, it will be automatically converted to a non-array entity.
APIMATICPOSTPROCESS_V353pre-defined-modelWarningA model referenced by any component must be pre-defined in the global custom types. If that is not the case, then for components that support "Object" or "Dynamic" primitive types, the component referencing the undefined model will fall back to one of these types.
APIMATICPOSTPROCESS_V354type-combinator-cases-meta-count-must-matchWarningThe metadata provided for the various cases of the type combinators (anyOf, oneOf or not) must match the total number of cases present. If that is not the case, the invalid metadata information will be automatically removed.
APIMATICPOSTPROCESS_V355non-empty-global-type-combinators-reference-nameWarningIf a global type combinators reference name is specified, the name must be non-null and non-empty.

Global Types/Models

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V401valid-numeric-enum-default-valueWarningDefault values of all enumeration model fields must be set. In case they are missing or invalid and the enumeration model is of numeric type, we may infer the default values ourselves.
APIMATICPOSTPROCESS_V402required-enum-field-default-valueWarningAll enumeration model fields must have a default value set, that represents one of the allowed values for the enumeration entity. If the default value is missing, the enumeration field name will be assigned as the default value of that field.
APIMATICPOSTPROCESS_V403required-discriminator-fieldWarningIf a discriminator is specified for a model, the model must have a corresponding discriminator field/property defined in its fields. If it is found to be missing, a default discriminator field definition will be automatically added.
APIMATICPOSTPROCESS_V404valid-custom-type-field-primitive-typeWarning (disabled)Some types like "File", "Void" and "Dynamic" are not applicable to model fields and, therefore, will be auto-converted to their equivalent valid types.
APIMATICPOSTPROCESS_V491non-empty-global-type-combinators-keyWarningThe unique key/name specified for the global type combinators entry must be non-null and non-empty. If that is not the case, the invalid entry will be automatically removed from the global type combinators definitions.
APIMATICPOSTPROCESS_V492global-type-combinators-id-existsInformation (disabled)The id of a global type combinators entry uniquely identifies this entry from others in the same list as well as from the names of the global models in the Custom Types list. If the id is not specified, it will automatically be generated.
APIMATICPOSTPROCESS_V493unique-global-type-combinators-idWarning (disabled)The id of a global type combinators entry must uniquely identify this entry from others in the same list as well as from the names of the global models in the Custom Types list. If that is not the case, the id will automatically be assigned a unique value.
APIMATICPOSTPROCESS_V494non-empty-discriminator-mapping-keyWarningPossible discriminator values provided as keys of the discriminator mapping information must be non-null and non-empty. If that is not the case, this entry will be treated as invalid and removed from the discriminator mapping definition.
APIMATICPOSTPROCESS_V495non-null-non-empty-discriminator-mapping-valueWarningDiscriminator mapping value represents the concrete type to which the discriminator value needs to be mapped to. This information is useful for deserialization purposes. If this mapping value is null or empty, the mapping information is considered incomplete and the entry for it will automatically be removed from the discriminator mapping definition.

Examples

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V501valid-example-valueWarningThe sample value provided must be valid according to the type definition of the component to which it belongs.
APIMATICPOSTPROCESS_V502example-value-restrictionsWarningThe sample value provided must obey all restrictions placed in the corresponding type definition.
APIMATICPOSTPROCESS_V503no-example-for-error-with-no-modelWarningAn example must not be set for a error response that has no error model linked to it.
APIMATICPOSTPROCESS_V504unique-example-idsWarningThe ids assigned to examples provided for a component must be unique. Duplicate ids will be renamed.
APIMATICPOSTPROCESS_V505non-empty-non-null-example-idWarningAll examples provided for a component must be assigned unique, non-empty and non-null ids.
APIMATICPOSTPROCESS_V506valid-example-external-valueWarningThe external URL provided for example, from which the example value is retrieved, must be a valid publicly-accessible URL. Otherwise, the URL will be ignored.
APIMATICPOSTPROCESS_V507required-example-value-or-external-urlWarningAn example entry from the multiple examples list must have either an example value set or an alternate external URL from which the example value can be fetched. Otherwise, the example entry will be ignored.
APIMATICPOSTPROCESS_V508supported-default-valueWarningFor some types, default values are currently not supported and will be ignored.
APIMATICPOSTPROCESS_V509sample-value-no-white-spacesWarningA sample value must not contain any leading or trailing white-space characters.
APIMATICPOSTPROCESS_V510valid-boolean-valueWarningA boolean entity can only have one of the two possible values: 'true' or 'false'. Any other variants e.g. 0, 1, y, etc. are not allowed and will either be ignored or converted to a valid variant.

Miscellaneous

CodeRuleSeverityWhat it checks
APIMATICPOSTPROCESS_V601name-no-white-spacesWarningName of an entity must not contain any leading or trailing white-space characters.
APIMATICPOSTPROCESS_V602description-no-white-spacesWarningDescription of an entity must not contain any leading or trailing white-space characters.
APIMATICPOSTPROCESS_V603required-api-versionWarningThe API version is a required property, which cannot be null or empty. If it is not provided, it is set as 1.0.

On this page