gpt4 book ai didi

php - Laravel Swagger 得到 [语法错误] 预期值,得到 '@'

转载 作者:行者123 更新时间:2023-12-04 08:33:35 26 4
gpt4 key购买 nike

我已经为 Controller 中的函数编写了 Swagger 注释,但在生成 swagger-ui 代码时出现错误。以下是我的注释代码

/*** End of Annotation For deleteNote ***/
/**
* @OA\Delete(
* path="/api/delete-user-note/{note_id}",
* operationId="/api/delete-user-note/{note_id}",
* tags={"Patient Routes"},
* summary= "Delete Note",
* description = "Delete Note",
* @OA\Parameters(
* description="ID note to delete",
* in="path",
* name="note_id",
* required=true,
* @OA\Schema(
* type="integer",
* format="int64"
* )
* ),
当我跑 php artisan l5-swagger:generate我收到错误 [Syntax Error] Expected Value, got '@'

最佳答案

您的注释中有错误。请使用以下内容更改您的代码。
您需要更换 ParametersParameter .

/*** End of Annotation For deleteNote ***/
/**
* @OA\Delete(
* path="/api/delete-user-note/{note_id}",
* operationId="/api/delete-user-note/{note_id}",
* tags={"Patient Routes"},
* summary= "Delete Note",
* description = "Delete Note",
* @OA\Parameter( //You need to replace Parameters with Parameter
* description="ID note to delete",
* in="path",
* name="note_id",
* required=true,
* @OA\Schema(
* type="integer",
* format="int64"
* )
* ),

关于php - Laravel Swagger 得到 [语法错误] 预期值,得到 '@',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64910288/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com