ruby-grape / ruby-grape/grape-entity
Ability to set description to whole entity
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 729
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
It seems there is no way to set global description for the whole Entity. If use grape-swagger-entity, it takes entity definition outside from resource, which I think is incorrect.
{
"definitions":{
"User":{
"type":"object",
"properties":{
"username":{
"type":"string"
}
},
"required":[
"username"
],
"description":"Create a token from email/password pair"
}
}
}
This description seems being used nowhere, but it can be used as description on resource response section, when you set desc "Retrieve information about the signed user", entity: Entities::User
"responses":{"200":{"description":"User entity","schema":{"$ref":"#/definitions/User"}}
instead of
"responses":{"200":{"description":"Retrieve information about the signed user","schema":{"$ref":"#/definitions/User"}}
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 tracing how grape-swagger-entity handles entity definitions and how the desc entry point builds resource response descriptions. Confirm whether the entity-level description should populate the response description instead of the resource description, then add coverage for the shown User response shape.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100