Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages for structure issues could be improved #79

Open
carnage opened this issue Jan 10, 2023 · 0 comments
Open

Error messages for structure issues could be improved #79

carnage opened this issue Jan 10, 2023 · 0 comments
Labels
external An issue that affects the users

Comments

@carnage
Copy link
Contributor

carnage commented Jan 10, 2023

#[SetFilterOrValidator(new WithNamedParameters(Password::class), Placement::After)]
class Password 
{
    public readonly string $hashedPassword;
    public function __construct(string $password) { /* hash password */ }
}

#[SetFilterOrValidator(new WithNamedParameters(Password::class), Placement::After)]
class User
{
    public function __construct(public readonly Password $password) { }
}

When called with the input: {'password': "some string password"} the error message isn't super helpful in tracking down the missing Nest filter. (correct input should be: {'password': {'password': "some string password"}} which probably isn't what is in the API)

Not sure this is completely fixable as it's a developer error but it'd be good if it was possible to give them a better hint as to how to fix it.

@charjr charjr added the external An issue that affects the users label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external An issue that affects the users
Projects
None yet
Development

No branches or pull requests

2 participants