no-schema-default-for-required-parameter
Overview
This rule belongs to the openapi-v3-apimatic-linting ruleset and states that:
A default value should not be assigned to a required parameter. Required parameters must be provided with a value during the API call, and assigning a default value may lead to unexpected behavior. Please check the parameter definition in the API specification and remove any default values assigned to required parameters. If a default value is needed, consider making the parameter optional by removing the required flag.
| Property | Value |
|---|---|
| Enabled | No |
| Maximum Severity | Warning |
| Message | Default value is not allowed for required parameters. |
| Code | OPENAPI3APIMATIC_L664 |
| Type | Linting |
| Rule System | Semantic |
| Broad Category | OpenAPI Schemas |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi apimatic semantic linting required parameter default |
Suggested Fixes
- Remove any default values assigned to required parameters.
- Consider making the parameter optional by removing the
requiredflag if it makes sense for the API.