./README.md in sinatra-param-0.0.1 vs ./README.md in sinatra-param-0.0.2

- old
+ new

@@ -1,7 +1,7 @@ # sinatra-param -_Parameter Validation and Typecasting for Sinatra_ +_Parameter Contracts for Sinatra_ REST conventions takes the guesswork out of designing and consuming web APIs. `GET` / `POST` / `PATCH` / `DELETE` resource endpoints and you get what you'd expect. But figuring out what parameters are expected... well, all bets are off. This Sinatra extension takes a first step to solving this problem on the developer side @@ -34,16 +34,16 @@ ### Parameter Types By declaring parameter types, incoming parameters will automatically be transformed into an object of that type. For instance, if a param is `Boolean`, values of `'1'`, `'true'`, `'t'`, `'yes'`, and `'y'` will be automatically transformed into `true`. -- String -- Integer -- Float -- Boolean _("1/0", "true/false", "t/f", "yes/no", "y/n")_ -- Array _("1,2,3,4,5")_ -- Hash _(key1:value1,key2:value2)_ +- `String` +- `Integer` +- `Float` +- `Boolean` _("1/0", "true/false", "t/f", "yes/no", "y/n")_ +- `Array` _("1,2,3,4,5")_ +- `Hash` _(key1:value1,key2:value2)_ ### Validations Encapsulate business logic in a consistent way with validations. If a parameter does not satisfy a particular condition, a `406` error is returned with a message explaining the failure. @@ -62,9 +62,11 @@ ## Next Steps - [Design by contract](http://en.wikipedia.org/wiki/Design_by_contract) like this is great for developers, and with a little meta-programming, it could probably be exposed to users as well. The self-documenting dream of [Hypermedia folks](http://twitter.com/#!/steveklabnik) could well be within reach. - Another pain point is the awkward way parameters are passed as JSON in HTTP bodies. I'd love to see an elegant, unobtrusive way to do this automatically. + +- Support for Rails-style Arrays (`'key[]=value1&key[]=value2'`) and Hashes (`'key[a]=value1&key[b]=value2`). /via [@manton](https://twitter.com/#!/manton) - Testing. This will happen soon. ## Contact \ No newline at end of file