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

Possible Enhancement #30

Closed
naveedn opened this issue Jul 17, 2017 · 5 comments
Closed

Possible Enhancement #30

naveedn opened this issue Jul 17, 2017 · 5 comments

Comments

@naveedn
Copy link

naveedn commented Jul 17, 2017

Hey guys,

First of all, thank you very much for the repo you created. I have used Celebrate at the company I work at with great success, and it is used in production.

I recently built a library that exposes a fluent interface for Celebrate. You can find it here: https://github.com/naveedn/vayder

I built the library because the Express middleware pipeline lends itself to declaratively chaining validations, and the facade pattern makes it easy to understand what Celebrate is doing.

I was wondering if you guys were interested in having this interface directly incorporated in your repo?

Thanks again!

@cjihrig
Copy link
Contributor

cjihrig commented Jul 17, 2017

I'm not entirely sure what you're proposing here. I think we're unlikely to add or remove anything from the interface. We want to keep this as a very thin layer on top of joi. Perhaps you could post some code showing the proposed APIs you'd be adding?

@naveedn
Copy link
Author

naveedn commented Jul 17, 2017

Sorry if that wasn't clear.

The library I created is a very thin layer on top of your library. All it does is provide a couple facade methods to make things easier to read.

It allows you to do stuff like:

app.get('/',
  vayder.validateHeaders(AuthenticationSchema),
  vayder.validateQuery(paginationSchema),
  vayder.validateParams(userIdSchema),
  someController.doStuff);

I was wondering if you guys wanted that functionality directly inside celebrate. Otherwise I will keep it in my repo.

Cheers

@cjihrig
Copy link
Contributor

cjihrig commented Jul 18, 2017

I'm not sure what @arb thinks, but I think leaving the two modules/APIs separate makes sense.

@arb
Copy link
Owner

arb commented Jul 18, 2017

I agree with @cjihrig on this one. If you want to expose a wrapper like that, that's fine. That approach actually goes against one of the project goals of the project; being as close to hapi as reasonably possible.

@naveedn
Copy link
Author

naveedn commented Jul 18, 2017

Understood, thanks for considering! Thanks again for your work.

@naveedn naveedn closed this as completed Jul 18, 2017
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

3 participants