如何在 NelmioApiDoc Bundle 中添加 RequestBody 示例?
How to add RequestBody example in NelmioApiDoc Bundle?
我的注释是:
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* @OA\Schema (
* type="object",
* @OA\Property(property="status", required=true, description="EventStatus", type="string"),
* @OA\Property(property="comment", required=false, description="Change Status Comment", type="string"),
* example={
* "status": "test status",
* "comment": "test comment"
* }
* )
* )
* )
我尝试添加“示例”密钥,但没有成功。
example
密钥必须是 @OA\JsonContent
的一部分,如下所示。
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* example={
* "status": "status",
* "comment": "comment"
* },
* @OA\Schema (
* type="object",
* @OA\Property(property="status", required=true, description="Event Status", type="string"),
* @OA\Property(property="comment", required=false, description="Change Status Comment", type="string"),
* )
* )
* )
我的注释是:
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* @OA\Schema (
* type="object",
* @OA\Property(property="status", required=true, description="EventStatus", type="string"),
* @OA\Property(property="comment", required=false, description="Change Status Comment", type="string"),
* example={
* "status": "test status",
* "comment": "test comment"
* }
* )
* )
* )
我尝试添加“示例”密钥,但没有成功。
example
密钥必须是 @OA\JsonContent
的一部分,如下所示。
* @OA\RequestBody(
* required=true,
* @OA\JsonContent(
* example={
* "status": "status",
* "comment": "comment"
* },
* @OA\Schema (
* type="object",
* @OA\Property(property="status", required=true, description="Event Status", type="string"),
* @OA\Property(property="comment", required=false, description="Change Status Comment", type="string"),
* )
* )
* )