Documentation

ApiResponse
in package
implements OpenApiAttributeInterface

The attribute may be used at method level or as field of {@see \OpenApi\Attributes\Operation} to define one or more responses of the Operation.

Interfaces, Classes, Traits and Enums

OpenApiAttributeInterface

Table of Contents

$content  : array<string|int, mixed>
$description  : string
$extensions  : array<string|int, mixed>
$headers  : array<string|int, mixed>
$links  : array<string|int, mixed>
$ref  : string
$responseCode  : string
__construct()  : mixed

Properties

$content

public array<string|int, mixed> $content = []

$extensions

public array<string|int, mixed> $extensions = []

$headers

public array<string|int, mixed> $headers = []

$responseCode

public string $responseCode = "default"

Methods

__construct()

public __construct([string $description = "" ][, string $responseCode = "default" ][, array<string|int, Header$headers = [] ][, array<string|int, Link$links = [] ][, array<string|int, Content$content = [] ][, array<string|int, Extension$extensions = [] ][, string $ref = "" ]) : mixed
Parameters
$description : string = ""

A short description of the response.

$responseCode : string = "default"

The HTTP response code, or 'default', for the supplied response. May only have 1 default entry.

$headers : array<string|int, Header> = []

An array of response headers. Allows additional information to be included with response.

$links : array<string|int, Link> = []

An array of operation links that can be followed from the response.

$content : array<string|int, Content> = []

An array containing descriptions of potential response payloads, for different media types.

$extensions : array<string|int, Extension> = []

The list of optional extensions.

$ref : string = ""

A reference to a response defined in components responses.

Return values
mixed

Search results