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

@last_description nil in #149

Closed
nonnenmacher opened this issue Sep 10, 2014 · 4 comments
Closed

@last_description nil in #149

nonnenmacher opened this issue Sep 10, 2014 · 4 comments

Comments

@nonnenmacher
Copy link

recently got error :
in lib/grape-swagger.rb:96:in setup': undefined methodmerge!' for nil:NilClass (NoMethodError)

in create_documentation_class:setup
the culprit is line

        @last_description.merge!(api_doc)

I don't know what changed, but would it be safer to initialise @last_description to an empty hash
before merging, in case this member is not previously set properly / as expected ?

note : after making some safe guard I got other errors, in mounting API.
But after debugging, it seems that there is ongoing PR that aren't completed around removing Endpoint.settings.

      def combine_namespaces(app)
          app.endpoints.each do |endpoint|
               ns = endpoint.settings.stack.last[:namespace]

where settings is no longer a member of an Endpoint.

So I guess, this is not a grape-swagger issue, but a transient problem around this unfinished PR.

see here : ruby-grape/grape#712 and ruby-grape/grape#719

reverting to Grape 0.9.0 work.

Good luck for the upgrade ;-)

@dblock
Copy link
Member

dblock commented Sep 11, 2014

This has probably been introduced in ruby-grape/grape#739 on Grape/HEAD. Grape-swagger "knows" about some Grape internals, we need to refactor our way of that into using a more standard interface.

@alexagranov
Copy link

@last_description does not appear to be read from anywhere in the code. are the two references in grape-swagger.rb just orphans of a refactoring?

@dblock
Copy link
Member

dblock commented Oct 17, 2014

Likely.

@dblock
Copy link
Member

dblock commented Nov 10, 2014

@dblock dblock closed this as completed Nov 10, 2014
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

3 participants