An open API service indexing awesome lists of open source software.

https://github.com/ceedubs/scrutinator

Using Shapeless to get type-safe binding of request parameters in Scalatra
https://github.com/ceedubs/scrutinator

Last synced: about 1 year ago
JSON representation

Using Shapeless to get type-safe binding of request parameters in Scalatra

Awesome Lists containing this project

README

          

# Scrutinator #

Scrutinator is a request binding/validation library with an emphasis on type safety.

## Principles ##

1. As type-safe as possible
* Optional values without a provided default are Options, other values are not
* Shouldn't be allowed to request something that hasn't been bound from the request yet
* Shouldn't be allowed to ask for a type to be bound from the request if there isn't evidence that we can perform that binding
* When I ask for params("age"), since I have specified the "age" field, the result should be typed to an int
* When I ask for params("name"), since I have specified the "name" field, the result should be typed to a string
* When I ask for params("oops"), since I have not specified an "oops" param, I should get a compile error
2. Convenient - should be able to bind multiple values at once and get a Validation of the sequenced individual validations
3. Swagger integration - bindings can be used to generate Swagger specs

## Contact ##

- Cody Allen
- ceedubs@gmail.com