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

Typebox validator hook not calling #727

Open
Micnubinub opened this issue Sep 5, 2024 · 2 comments
Open

Typebox validator hook not calling #727

Micnubinub opened this issue Sep 5, 2024 · 2 comments

Comments

@Micnubinub
Copy link
Contributor

Micnubinub commented Sep 5, 2024

My hook isn't calling for some reason:

function parseValidationError(result, context) {
console.log({ result, context });
}

app.post('/endpoint',tbValidator(
  'json',
  t.Object({
    user: tNewUser,
    role: tCompanyRole,
    company: t.String()
  }), parseValidationError), async (c) => {
  ...
  return c.json({
    ...
  });
}

When I send invalid data to /endpoint I'm expecting it to log, am I doing something wrong? It's responding to the client with the ValueError[]

"@hono/typebox-validator": "0.2.4",
"hono": "4.5.11",
@yusukebe
Copy link
Member

yusukebe commented Sep 6, 2024

HI @Micnubinub

@curtislarson Can you take a look at this?

@Micnubinub
Copy link
Contributor Author

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants