mac- / ratify

A Hapi plugin for validating the schema of path, query, request body, and response body params using JSON-schema
MIT License
71 stars 27 forks source link

Global sample rate for response validation #49

Open no-more opened 8 years ago

no-more commented 8 years ago

Hi,

First of all thanks for this great plugin. I'm just starting to use it and it seems very great. I have a simple question please, is it possible to set the sample rate for response validation globaly ?

The main reason is that in 90% case I want a 100% validation in test/dev but lower in production. This setting is usally global so it would be great to set it in one single place. This would reduce the code as I won't have to set it on every path but only when I want a specific sample rate (for some critics route maybe). The same option would be great for failAction.

Thanks a lot.