1

我正在使用Swagger 3.0swagger-php获得

请求正文标记的奇怪行为

.

在图像中,“示例:”下拉菜单出现,“示例值 | 架构”显示在该下拉列表下方,而不是“示例值 | 模型”。

我的问题是:

  1. 如何删除示例下拉列表?

  2. 如何为下拉列表添加多个示例?

  3. 为什么我的sagger-ui show“示例值 | 架构”而不是“示例值 | 模型”?

  4. 是否有未列出的有关请求正文示例的更新文档?

我正在关注第 40 行的帖子示例

https://github.com/zircote/swagger-php/blob/master/Examples/petstore-3.0/controllers/User.php

https://github.com/zircote/swagger-php/blob/master/Examples/petstore-3.0/models/RequestBody.php

https://github.com/zircote/swagger-php/blob/master/Examples/petstore-3.0/models/User.php

这是我的标记:

/**
* @OA\Post(
*     path="/exampleUrl/{y2k}",
*     description="Description",
*     summary="Summary",
*     @OA\Parameter(
*         name="y2k",
*         in="path",
*         description="Parameter Description",
*         required=true,
*         example="bbop",
*         @OA\Schema(
*           type="string",
*         )
*     ),
*     @OA\RequestBody(ref="#/components/requestBodies/RequestBodyExample"),
*     @OA\Response(
*         response="200",
*         description="Response Description",
*     ),
* )
*/

/**
* @OA\RequestBody(
*     request="RequestBodyExample",
*     description="Request Body Description",
*     required=true,
*     @OA\JsonContent(ref="#/components/schemas/SchemaExample"),
* )
*/

/**
* @OA\Schema()
*/
class SchemaExample
{
    /**
     * @var string
     * @OA\Property()
     */
    public $exampleString;

}

示例下拉图片

4

0 回答 0