grape
grape copied to clipboard
An opinionated framework for creating REST-like APIs in Ruby.
We're trying to replace our custom json-parser middleware in our project with grape formatter middleware recently, and found that if we send a GET request with parameters in body and...
Let we are not support `application/json` content-type. When user send a request with wrong content-type, the response message is clear: ``` { "error" => "The provided content-type 'application/json' is not...
Those two tests endpoint_spec are in the end testing internal details of rack-test. Change them so that they still test what was intended, but in a more robust way that...
How can I use a proc to validate and use a custom message? This way is deprecated: ```ruby params do requires :e, values: { proc: -> (v) { v.even? },...
If I make this change to `Gemfile` ```diff diff --git a/Gemfile b/Gemfile index acc721aa..f0cff687 100644 --- a/Gemfile +++ b/Gemfile @@ -31,7 +31,7 @@ group :test do gem 'maruku' gem 'mime-types'...
Hey 👋 Sometimes, we can have a huge amount of params to be received in an endpoint. To define all those parameters in the params section can make the received...
grape 2.0.0 Having an issue when using nested params with exactly_one_of, here is my current setup ``` params :required_date do optional :date use :date_range exactly_one_of :date, :date_range end params :date_range...
tl;dr: it's too easy to write Grape endpoints that are not protected against [Mass Assignment abuse](https://en.wikipedia.org/wiki/Mass_assignment_vulnerability). I've created [an example Rails application called `PretendGravity`](https://github.com/jonallured/pretend_gravity), an homage to the main API...
`rack-accept` hasn't been updated for many years and since most of Grape's needs are already in `rack`, I think we can remove the dependency.
In a RESTful API, you'll use the same path multiple times, but with a different REST verb. These will return the same endpoint: - `GET /orders` - `POST /orders` So...