Skip to content

reusable params with shared helper - Boolean type problem #1115

Closed
@chrisyoumans

Description

@chrisyoumans

When defining a reusable parameter using a shared helper, if my parameter is of type Boolean, I receive a NameError. (block in module:ParamsHelper': uninitialized constant ParamsHelper::Boolean (NameError))

module ParamsHelper
  extend Grape::API::Helpers

  params :forensics do
    optional :forensics, type: Boolean, default: false, desc: "Turn forensics node on or off."
  end
end

All other types seem to work fine. It's as if it doesn't know where to look for the Boolean type. I even tried type: Grape::Validations::ParamsScope::Boolean and received: "block in module:ParamsHelper': uninitialized constant Grape::Validations::ParamsScope::Boolean (NameError)." I did the equivalent with String and while it threw a warning, it worked.

It's very possible I'm missing something, but considering the other types seem to work fine, I'm not sure what it could be.

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