emsifa / evo

Evolve your Laravel code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nullable string in DTO still asks for a string

emsifa opened this issue · comments

When we have DTO:

class SomethingDto extends Dto
{
    public ?string $message;
}

And we try to fill with request data:

{
    "message": null
}

It results an error "The message must be a string.".

When I dump $rules in Emsifa\Evo\Http\Body::validateRequest method, it doesn't have nullable rule.