You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to magically deserialize the above with a controller request method.
class myController extends Controller {
public function bulkUpdate(BulkUpdateRequest $request, Project $project)
{
//
}
}
Then in my request data class
class BulkUpdateRequest {
public function __construct(
/** Collection<int, BulkUpdateProjectCandidateOperation> $operations */
public array $operations // <! -- cannot seem to get this to hydrate from the root of the json body
)
{}
}
It seems the only way I can make this work is by placing the commands into a wrapper field:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello! Thanks for this very useful package!
I seem to be having trouble figuring out how to properly deserialize into my data classes an array that is at the root level of the POST request.
For example:
I'm trying to magically deserialize the above with a controller request method.
Then in my request data class
It seems the only way I can make this work is by placing the commands into a wrapper field:
And then updating the DTOs accordingly. But, I think I really shouldn't have todo that. Any ideas on how to accomplish this?
I did try using
#[MapInputName('')]
but that just failed to validate.Beta Was this translation helpful? Give feedback.
All reactions