grape icon indicating copy to clipboard operation
grape copied to clipboard

An opinionated framework for creating REST-like APIs in Ruby.

Results 157 grape issues
Sort by recently updated
recently updated
newest added

I've noticed that tempfiles created when uploading a file (Rack::Multipart) are not closed and unlink by default. Fortunately, Rack [provides](https://github.com/rack/rack/blob/main/lib/rack/tempfile_reaper.rb) a middleware for it and we just need to add...

feature request
you can help

Am I wrong to say that [Grape::Formatter::JSON](https://github.com/ruby-grape/grape/blob/2b8567a1ca49b3d0236fa82deb2edef34c8839cf/lib/grape/formatter/json.rb#L8) will never call `Grape::Json::Dump` since every object responds to `to_json` ? On the other hand, [Grape::ErrorFormatter::JSON](https://github.com/ruby-grape/grape/blob/2b8567a1ca49b3d0236fa82deb2edef34c8839cf/lib/grape/error_formatter/json.rb#L14) is not using `to_json`. I'm just concerned...

question

The purpose of a `rescue_from` block is of course to handle exceptions in a custom way. However, what should happen if the `rescue_from` block itself raises an exception? Currently, Grape...

question

I've [noticed](https://github.com/ruby-grape/grape/blob/56719693012269b0132d09e5e8fd41a906e38a6d/spec/grape/middleware/formatter_spec.rb#L176) that processing `application/json;q=invalid,application/xml;q=0.5` would set the `Grape::Env::API_FORMAT` to `xml` when it should be `json`. Unfortunately, the [RFC](https://datatracker.ietf.org/doc/html/rfc2616#section-14.1) isn't clear when `q` is not a float. Nonetheless the default...

bug?

Hello, If we define different properties required for array items by given condition then validation fails even if correct request is sent. Please check the example below: ```rb it 'test...

bug?

```ruby params do build_with Grape::Extensions::Hash::ParamBuilder requires :avatar, type: File end post '/' do ... end ``` Returns an error `#` because: - This line calls `deep_dup` of hash values (...

bug?

Is the Grape for Enterprise on the README correct? I was interested in providing financial support, but that link is a redirect now.

chore

There are few places in the code that we `raise` an exception instead of throw `:error` and vice-versa. - [Grape::Middleware::Versioner::AcceptVersionHeader](https://github.com/ruby-grape/grape/blob/master/lib/grape/middleware/versioner/accept_version_header.rb) middleware is throwing but [Grape::Middleware::Versioner::Header](https://github.com/ruby-grape/grape/blob/master/lib/grape/middleware/versioner/header.rb) is raising. - [Running validators](https://github.com/ruby-grape/grape/blob/09e1bf544a86526ac15b3ea425da8a042c7dfc74/lib/grape/endpoint.rb#L307)...