grape
grape copied to clipboard
An opinionated framework for creating REST-like APIs in Ruby.
Sometimes it's necessary to return different entities depending on internal business logic. It would be nice to be able to document all possible success entities. Like with `failure` method but...
I want declared not to allow unvalidated parameters if the given condition is not met # case1 ``` desc 'Create T' params do optional :device_type, type: String, desc: 'device_type', values:...
solve #2168 as active_record_instance#errors metho is not returning a hash object anymore. as a part of rails 6.1 upgrade the JSON error formatter should consider this change and check if...
Mustermann 2.0 was released yesterday (July 18th, 2022). Grape relies on mustermann-grape which relies on mustermann specified as `mustermann (>= 1.0.0)`, hence the jump to 2.0. Getting the warning `lib/ruby/gems/2.7.0/gems/mustermann-2.0.0/lib/mustermann/ast/translator.rb:76:...
I am getting ```Grape::Middleware::Formatter : undefined method `collect' for #``` My code works fine, I have tested each line by my hand but if I run the whole API this...
Many application frameworks provide the ability to remove response headers, how is this done in Grape? I see there is stuff like `version 'v1', using: :header, vendor: 'twitter', cascade: false`...
The error only happens when booting a Rails app in a particular way (sidekiqswarm) when loading a nested class whose parent class inherits from `Grape::API`. For example: ```ruby # app/api/thing.rb...
Hello, I'm notice, that grape File type validation replace all non-English letters with an underscore symbol I send: `------WebKitFormBoundarybo7OclPI12IMowot Content-Disposition: form-data; name="file"; filename="привет-hello.png" Content-Type: image/png` and on endpoint I have...
HTTP/2 defines that HTTP headers be lowercase. Grape consistently normalizes HTTP headers to PascalCase. This is ok since it's consistent. However, there are more and more API clients which normalize...
Prior to Rack v2.1.0, `Rack::Response` would call `to_s` on each of the `body` parts: https://github.com/rack/rack/blob/85684323f8f58409e717af91e446d257d496f8b8/lib/rack/response.rb#L40-L43. That means if Grape returned `[nil]`, Rack would handle this gracefully. This is no longer...