ruby-grape / ruby-grape/grape

Ability to describe multiple success entities

Open
#2,277 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Ruby
Stars
10k
Forks
1.2k
Avg merge
14h 38m
Merged PRs (30d)
92

Description

Sometimes it's necessary to return different entities depending on internal business logic. It would be nice to be able to document all possible success entities. Like with failure method but without status codes.
Something like this:

desc "List of users" do
  success [Entities::Customer, Entities::Client]
  is_array true
end

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing success and failure methods in the API documentation DSL, using the issue's example as the expected interface. Determine how response entities are currently represented and where their documentation is tested. Done means multiple success entities can be documented without requiring status codes, with coverage for the proposed syntax.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.