Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix declared_params regression with multiple allowed types #2116

Commits on Oct 9, 2020

  1. Fix declared_params regression with multiple allowed types

    Prior to Grape v1.5.0 and ruby-grape#2103, the following
    would return `nil`:
    
    ```
    params do
      optional :status_code, types: [Integer, String]
    end
    get '/' do
      declared_params
    end
    ```
    
    However, now it turns an empty `Array`.
    
    We restore the previous behavior by not returning an empty `Array` if multiple
    types are used.
    
    Closes ruby-grape#2115
    stanhu committed Oct 9, 2020
    Configuration menu
    Copy the full SHA
    44217dd View commit details
    Browse the repository at this point in the history