ruby-grape / ruby-grape/grape-entity
Format is "reserved"
Open
Nobody has claimed this yet.
bug?
- Dominant language
- Ruby
- Stars
- 729
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
I am using grape, grape entity, and rails together for an api. I have a rails model that has a column, format. When I try to expose this column, I get an error that looks something like -
too few arguments
... /gems/grape-entity-0.5.1/lib/grape_entity/entity.rb:482:in `format'
... /gems/grape-entity-0.5.1/lib/grape_entity/entity.rb:482:in `delegate_attribute'
The entity in question
class Content < Grape::Entity
expose :id, :guid, :slug, :metadata, :url, :format
end
I am using grape@0.16.2 and grape-entity@0.5.1
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
Reproduce the failure with the Content entity and its exposed format column using grape 0.16.2 and grape-entity 0.5.1. Start at grape_entity/entity.rb:482, where format is reported in delegate_attribute; done means exposing format no longer raises the argument error and the column is returned correctly.
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