Skip to main content

required-parameter-schema-or-content

Overview

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

The Parameter Object must define the type schema for the parameter using either the schema or content property. The former is used more commonly while the latter is recommended for more complex scenarios involving media types. However, at one time, only one of these properties must be present and not both.

PropertyValue
EnabledYes
Maximum SeverityError
MessageParameter Object has neither defined property schema nor content.
CodeOPENAPI3STANDARDS_V077
TypeValidation
Rule SystemSemantic
Broad CategoryParameters
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation schema content type parameter

Suggested Fixes

  • Add missing schema or content property in the Parameter Object.
  • Make sure that whatever property you specify (schema or content) is a valid object and is not set to null.

For More Information