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

Add getValidatedRouterParams(event, validate) #516

Closed
1 task
atinux opened this issue Aug 22, 2023 · 3 comments · Fixed by #573
Closed
1 task

Add getValidatedRouterParams(event, validate) #516

atinux opened this issue Aug 22, 2023 · 3 comments · Fixed by #573
Labels
enhancement New feature or request

Comments

@atinux
Copy link
Member

atinux commented Aug 22, 2023

Describe the feature

Similar to getValidatedBody(event, validate) but for router params.

Additional information

  • Would you be willing to help implement this feature?
@pi0 pi0 added the enhancement New feature or request label Aug 26, 2023
@Hebilicious
Copy link
Member

Hebilicious commented Sep 5, 2023

We have readValidatedBody and getValidatedQuery and we could add a getValidatedRouterParams to get a typed result.

On a s side note, I feel like we have some naming inconsistencies ;

  • according to express the precise terminology is route parameters. I think both routerParams and routeParams are confusing because of queryParameters (which maps to getQuery)... Maybe we could consider a different name, like getUrlSegment ?
  • we currently use both readX and getX ? Could we use getX for everything for the sake of consistencies?

@Barbapapazes
Copy link
Member

  • we currently use both readX and getX ? Could we use getX for everything for the sake of consistencies?

Isn't a little nuance like explained here, https://stackoverflow.com/questions/23664175/whats-the-difference-between-read-readsome-get-and-getline?

@mynameisjeffe
Copy link

mynameisjeffe commented Oct 12, 2023

This would be a great feature to add.
Right now I'm still using h3-zod primarily because useValidatedParams, which is pretty much the proposed getValidatedRouterParams(event, validate)

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

Successfully merging a pull request may close this issue.

5 participants