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
- Host: GitHub
- URL: https://github.com/ceedubs/scrutinator
- Owner: ceedubs
- License: mit
- Created: 2013-10-07T12:54:18.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-05T20:59:22.000Z (almost 12 years ago)
- Last Synced: 2025-04-09T17:14:53.387Z (about 1 year ago)
- Language: Scala
- Size: 597 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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