biocad / servant-openapi3

OpenAPI 3.0 for Servant
BSD 3-Clause "New" or "Revised" License
38 stars 25 forks source link

Add gen adapter parameter to validateEveryToJSON #39

Open avandecreme opened 1 year ago

avandecreme commented 1 year ago

I am currently working with an API which can have very nested types with arrays. So using the default Arbitrary instance make the tests very slow. The solution is to call QuickCheck's resize function with a low number. After all we are only checking the shape of the data, its size shouldn't matter.

So in this PR I add validateEveryToJSON' and validateEveryToJSONWithPatternChecker' which allow to pass a function to adapt the generator.