Default value for the parameter is not consistent with the parameter’s type

Description

The default value you have defined for a parameter is not consistent with the type of the parameter.

This applies only to OpenAPI Specification (OAS) v2. For more details, see the OAS.

Example

The following is how this issue could look in your API definition. The parameter type is set to integer, but the default value is a string:

{
  parameters {    
        "type": "integer",
        "format": "int32",
        "default": "none",
        "description": "The total number of results.",
          ...
      }
   }
}

Remediation

Make sure that all default values for parameters match the parameter type.

{ 
  parameters {    
        "type": "integer",
        "format": "int32",
        "default": 0,
        "description": "The total number of results.",
          ...
      }
   }
}

Get API Security news directly in your Inbox.

By clicking Subscribe you agree to our Data Policy