我正在使用L5 Swagger
fromDarkOnLine
使用 OpenApi 原理图生成 Swagger 文档。
要使用架构,我可以做
@OA\Property(property="certification", type="array", @OA\Items(ref="#/components/schemas/Certification"))
它工作得很好,并显示为
"certification": [
{
"certification_id": 0,
"name": "string"
}
],
. 但它会创建一个带有方括号的数组块,其中包含多个对象。
我如何使用相同的工作但丢失数组。就像是
@OA\Property(property="certification", type="object", @OA\Items(ref="#/components/schemas/Certification")),
以便删除方括号并仅显示对象。
"certification": {
"certification_id": 0,
"name": "string"
}