Skip to main content

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.

PropertyValue
EnabledNo
Maximum SeverityWarning
MessageDefault value is not allowed for required parameters.
CodeOPENAPI3APIMATIC_L664
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 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 required flag if it makes sense for the API.

For More Information