grape
grape copied to clipboard
An opinionated framework for creating REST-like APIs in Ruby.
I'm in the process of upgrading to the current version from an ancient one. We previously used `rescue_from Grape::Exceptions::InvalidMessageBody` to catch unknown upload formats and document what the valid upload...
Possible fix is to rescue all errors and re-raise as a `Grape::Exceptions::Validation`. ``` module Grape module Validations class AsValidator < Base def initialize(attrs, options, required, scope, opts = {}) @renamed_options...
This is a first attempt at exposing a regression in Grape 1.3.1 compared with 1.2.4 with respect to specifying subclasses of `Grape::Entity` as parameters. My investigation so far has revealed...
```params do optional :my_field, type: Array ``` When this optional field is set to [] (a valid value), Grape API removes it from the parameters. I cannot find any way...
When I have a Grape::API application and I declare a namespace, if I declare a route before the helpers block, those helpers aren't available to the route. If I declare...
### Goal I want to test params of the endpoint without making additional request because it makes tests quicker and more readable. ### Context It would be nice to be...
``` /.rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:6:in `': uninitialized constant Grape::Middleware::Base::Helpers (NameError) from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:5:in `' from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:4:in `' from .rvm/gems/ruby-2.6.5/gems/grape-1.2.5/lib/grape/middleware/base.rb:3:in `' from .rvm/gems/ruby-2.6.5/gems/grape_logging-1.8.3/lib/grape_logging/middleware/request_logger.rb:1:in `' ```
Fixes #2010 To keep the backward compatibility, I introduced a new event. The integration works fine in my project with this change.
Hello. I'm trying to add the monitoring by subscribing to `'endpoint_run.grape'` via `ActiveSupport::Notifications.subscribe`. It works well until an exception occurs inside API. I have a bunch of `rescue_from` blocks to...
I have the following params definition: ``` module FooParams extend Grape::API::Helpers params :bar_params do requires :a, type: String end params :baz_params do requires :b, type: String end params :foo_params do...