Nol*_*fer 5 php symfony api-platform.com
我有这样的事情:
/**
* @ORM/Entity
* @ApiResource(
* itemOperations={
* "put_cancel": {
* "method": "PUT",
* "path": "/task/{id}/cancel",
* "messenger": "input",
* "input": CancelTaskCommand::class,
* "output": false
* },
* }
* )
*/
class Foo {}
Run Code Online (Sandbox Code Playgroud)
取消FooCommand.php
final class CancelFooCommand
{
/**
* @var string
* @ApiProperty(
* identifier=true,
* )
*/
public string $id = '';
/**
* @var string
* @ApiProperty(
* attributes={
* "openapi_context"={
* "type": "string"
* }
* }
* )
*/
public string $note = '';
}
Run Code Online (Sandbox Code Playgroud)
所以我必须在有效负载和路径中输入两次 ID。是否可以跳过添加id到有效负载并从路径获取它?
| 归档时间: |
|
| 查看次数: |
265 次 |
| 最近记录: |