Skip to content

Reject non-declared params #1609

Closed
Closed
@dhulihan

Description

@dhulihan

It would be nice if grape could reject a non-declared param. Something along the lines of:

params do
  requires :first_name, type: String

  reject_non_declared
end

If we specify age, it is rejected since because it has not been declared.

curl -d '{"first_name": "dave", "age": 32}' \
       'http://localhost:9292/statuses' \
       -H Content-Type:application/json \
       -v 
# => HTTP 400 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions