Skip to main content

parameter-space-delimited-style-only-for-array-or-object-types

Overview

This rule belongs to the openapi-v3-standards-validation ruleset and states that:

In an OpenAPI v3.1.x document, the spaceDelimited style can only be used when the type of the parameter is set as array or object i.e. it cannot be used for primitive types.

PropertyValue
EnabledYes
SeverityError
MessageSpace delimited style cannot be used with the current parameter type.
CodeOPENAPI3STANDARDS_V103
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation space delimited style array object serialization parameter

Suggested Fixes

  • Ensure that the type of the parameter set in either the parameter's schema or content definition is equal to array or object.
  • If the parameter type is not expected to be an array/object, change the value of the style property to one that supports primitive types e.g. matrix, label, form.
  • If the parameter type is not expected to be an array/object and you are unsure about which style to use, simply remove the style property definition.

For More Information