Skip to content

Regression where operation returns resource class different from input resource class #2855

Description

@bendavies

Introduced here:
#2822

Example operation:

/**
 * @ApiResource(
 *     itemOperations={
 *         "get": {
 *             "method": "GET",
 *             "path": "/payments/{id}",
 *         },
 *         "void": {
 *             "method": "POST",
 *             "path": "/payments/{id}/void",
 *             "controller": PaymentVoid::class,
 *             "deserialize": false
 *         }
 *     }
 * )
 */
class Payment { ... 

PaymentVoid controller returns a Void, which is also a resource.
This worked on 2.4.3.

Now errors:

{"type":"https:\/\/tools.ietf.org\/html\/rfc2616#section-10","title":"An error occurred","detail":"Object of type \u0022Void\u0022 does not match \u0022Payment\u0022 resource class."}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions