Skip to main content

required-schema-properties-with-object-type

Overview

This rule belongs to the openapi-v3-codegen-linting ruleset and states that:

In an OpenAPI document, if a schema object has the type 'object', it must also contain a 'properties' property that defines the object's properties. This is required to accurately describe the structure of the object and enable proper validation.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageObject schema must define properties.
CodeOPENAPI3CODEGEN_L618
TypeLinting
Rule SystemSemantic
Broad CategoryOpenAPI Schemas
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagscode generation sdks openapi3 openapi semantic linting apimatic properties schema

Suggested Fixes

  • Add a 'properties' property to the schema object with type 'object'.
  • Ensure that schema 'properties' property is not empty.
  • Ensure that schema 'properties' property is not null.

For More Information