如何在Api平台上的Messanger输入中使用{id}?

问题描述

我有这样的东西:

/**
 * @ORM/Entity
 * @ApiResource(
 *     itemOperations={
 *         "put_cancel": {
 *             "method": "PUT",*             "path": "/task/{id}/cancel",*             "messenger": "input",*             "input": CancelTaskCommand::class,*             "output": false
 *         },*     }
 * )
 */
class Foo {}

CancelFooCommand.PHP

final class CancelFooCommand
{
    /**
     * @var string
     * @ApiProperty(
     *     identifier=true,* )
     */
    public string $id = '';

    /**
     * @var string
     * @ApiProperty(
     *     attributes={
     *         "openapi_context"={
     *           "type": "string"
     *         }
     *     }
     * )
     */
    public string $note = '';
}

因此,我必须在有效负载和路径中输入两次ID。是否可以跳过将id添加到有效负载并从路径中获取它?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)