ruby-grape / ruby-grape/grape-entity
Empty entity is exposing a field
Open
Nobody has claimed this yet.
bug?
- Dominant language
- Ruby
- Stars
- 729
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
I have the following empty entity:
class Project < Grape::Entity
end
Although the entity is empty the JSON response contains a field permission:
{
"permissions": {
"project_access": null,
"group_access": {
"access_level": 50,
"notification_level": 3
}
}
}
This seems very strange to me and I think that is a bug. I am using 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
Start by reproducing the empty Project < Grape::Entity case on grape-entity 0.5.1 and trace how the JSON response exposes the permissions field. Done means an entity with no declared fields emits no unexpected permissions data, with a regression test covering the reported response.
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