ruby-grape / ruby-grape/grape-swagger
Regression w/ Model parser for Grape::Roar::Representer
Open
Nobody has claimed this yet.
bug?
- Dominant language
- Ruby
- Stars
- 1.1k
- Forks
- 479
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 6
Description
In a much older version of grape-swagger this used to work:
models: [
Presenters::ApplicationPresenter
]
where
module Presenters
module ApplicationPresenter
include Roar::JSON::HAL
include Roar::Hypermedia
include Grape::Roar::Representer
property :id, type: String, desc: 'Application id.', writeable: false
...
end
end
end
end
Even with grape-swagger-representable I am getting:
type: "other_error",
message: "No parser registered for ApplicationPresenter.",
backtrace: [
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/endpoint.rb:329:in `expose_params_from_model'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/endpoint.rb:93:in `block in add_definitions_from'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/endpoint.rb:93:in `each'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/endpoint.rb:93:in `add_definitions_from'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/endpoint.rb:86:in `path_and_definition_objects'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/doc_methods.rb:57:in `block in setup'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/bundler/gems/grape-swagger-34c969d71899/lib/grape-swagger/doc_methods.rb:71:in `block in setup'",
"/Users/dblock/.rvm/gems/ruby-2.3.7/gems/grape-0.17.0/lib/grape/endpoint.rb:59:in `call'",
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/grape-swagger/endpoint.rb:329, where the reported No parser registered error occurs, and trace how models are passed to the parser registry. Review the grape-swagger-representable integration and compare it with the older working model declaration; done means the ApplicationPresenter model is accepted without this parser error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100