shiftdsm / Galavanting-Gnome

0 stars 1 forks source link

Bring this project joi #33

Closed tegandbiscuits closed 5 years ago

tegandbiscuits commented 5 years ago

This adds validation to the endpoints, and also drops in swagger docs because why not?

This would've been relevant with PR #31, but it slipped my mind.

It works pretty much as expected, but I'm a bit dissatisfied that I have to set modify: true in order to use stripUnknown, and (unless I'm missing something), that needs to be set on every route where that might be useful. Also that to add something to the documentation you need to add the api tag.

[A solution could be to wrap the endpoint creation in a function to offer opinions, but that seems against how Hapi was designed].