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

Deprecated route_xxx methods for route_params and route_? declared. #1344

Closed
dblock opened this issue Apr 4, 2016 · 6 comments
Closed

Deprecated route_xxx methods for route_params and route_? declared. #1344

dblock opened this issue Apr 4, 2016 · 6 comments
Assignees

Comments

@dblock
Copy link
Member

dblock commented Apr 4, 2016

I've PRed ruby-grape/grape-swagger#368, but it has two problems, access to route_params and route_hidden in a dummy API declared as GET '/foobar', hidden: true.

The route_xxx deprecated code reaches into @options, which isn't @settings, and that is no longer exposed. So .params is not the same thing as the old route_params. What should we do about this one?

@dblock
Copy link
Member Author

dblock commented Apr 4, 2016

cc: @namusyaka, maybe you have a suggestion?

@namusyaka
Copy link
Contributor

@dblock Hmm, I think the route_xxx can explore the @options and @settings in a cascading style.
I'm going to investigate the problem in a few days.

@dblock
Copy link
Member Author

dblock commented Apr 5, 2016

If you have time @namusyaka, the simplest thing to look at is https://github.com/dblock/grape-swagger/tree/fix-deprecations, try to fix the remaining deprecations. I think the simplest would be to just expose options, but maybe the specs are wrong and it's not the right thing to do.

@dblock
Copy link
Member Author

dblock commented Apr 5, 2016

For now I am monkey-patching the deprecation to avoid too many warnings being spewed.

module Grape
  class Router
    class Route
      private

      # TODO: remove when https://github.com/ruby-grape/grape-swagger/pull/368 and https://github.com/newrelic/rpm/pull/235 are finished
      def warn_route_methods(name, location, expected = nil)
      end
    end
  end
end

@dblock
Copy link
Member Author

dblock commented Apr 24, 2016

Closing via #1357.

@dblock dblock closed this as completed Apr 24, 2016
@dblock
Copy link
Member Author

dblock commented Apr 2, 2018

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

No branches or pull requests

2 participants