#[OA\Schema]
class BaseResponse {
#[OA\Property]
public ?string $message = null;
#[OA\Property(type: 'object')]
public mixed $result = null;
}
#[OA\Schema]
class ChildResponse {
#[OA\Property]
public int $id;
#[OA\Property]
public string $name;
}
use OpenApi\Attributes as OA;
#[OA\Get(
path: '/v1/some-path',
description: "Generics",
)]
#[OA\Response(
response: 200,
description: "Success",
content: new OA\JsonContent(
allOf: [
new OA\Schema(ref: '#/components/schemas/BaseResponse'),
new OA\Schema(
properties: [
new OA\Property(
property: 'result',
type: 'array',
items: new OA\Items(
allOf: [
new OA\Schema(ref: "#/components/schemas/ChildResponse"),
]
),
)
]
),
]
)
)]
class GetReferencesAction {}