Skip to content

Grape::Extensions::Hashie::Mash::ParamBuilder can't be set as a default globally in 1 place #1775

Description

@myxoh

Context: I'm upgrading a massive rails 3.2 API to rails 4. I'm late to the party to realise that Grape changed the default param builder.

Problem: The proposed solution for backwards compatibility:
include Grape::Extensions::Hashie::Mash::ParamBuilder can't be applied globally as far as I could investigate.
The reason for concern is that we have over 200+ API endpoints, and I'd rather not have to modify the 200 files just for the sake of maintaining backwards compatibility.

Is there anyway of setting this builder as the default builder for Grape? Just re-opening Grape::API or building a custom parent class that included Grape::Extensions::Hashie::Mash::ParamBuilder didn't cut it for me.
Using the
def self.inherited(base)
base.include Grape::Extensions::Hashie::Mash::ParamBuilder
end
didn't help either, as in some of our API's the routes hadn't been loaded by then causing some trouble.

Perhaps you've though of an approach, or a new approach must be made?

Thanks in advance for the help

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions