Skip to main content

required-paths-or-components-or-webhooks

Overview

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

The OpenAPI root object in an OpenAPI v3.1.x document must specify at least one of the following: available paths and operations for the API using the paths property OR reusable components using the components property OR information about incoming webhooks using the webhooks property.

PropertyValue
EnabledYes
Maximum SeverityError
MessageNone of the required properties (paths, components or webhooks) were specified in the root OpenAPI Object.
CodeOPENAPI3STANDARDS_V005
TypeValidation
Rule SystemSemantic
Broad CategoryOpenAPI Root Information
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic validation paths components webhooks

Suggested Fixes

  • If you intend to describe your API's endpoints, your OpenAPI document must contain the paths property in the root OpenAPI object i.e. in the top level properties of the document.
  • If you want to declare reusable components in your OpenAPI document, it must contain the components property in the root OpenAPI object i.e. in the top level properties of the document.
  • If you want the OpenAPI document to include data related to incoming webhooks from your API, do specify the webhooks property in your root OpenAPI object i.e. in the top level properties of the document.
  • Make sure that the root object of your OpenAPI document(s) consist of at least one of these top-level properties: paths, components, webhooks.

For More Information