Skip to main content

at-least-one-success-response-exists

Overview

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

The Responses Object must contain at least one response code which should be the response for a successful operation call e.g. 200.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageNo success response definition found in the responses list.
CodeOPENAPI3STANDARDS_L101
TypeLinting
Rule SystemSemantic
Broad CategoryResponses
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsopenapi3 openapi standards semantic linting success status code response

Suggested Fixes

  • Add an entry in the responses list for the default success response code of your operation/endpoint e.g. 200. If other success status codes and their definitions are well-known, add their entries too.
  • The successful response codes belong to the HTTP status code range of 2XX e.g. 200, 201, etc.
  • If all success responses possible for your operation share the same structure, you can define them once using the status code range 2XX instead of defining with an explicit code.

For More Information