ruby-grape / ruby-grape/grape

Should custom formatters have access to headers and status?

Open
#902 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I've been working on some custom formatters and realized that there is no control over the headers and status within the formatter or error formatter. The change is relatively easy to make but it will break backwards compatibility because the custom formatters will need to take new additional parameters. The other option would be to exec custom formatters against the grape formatter middleware and expose functions in a DSL like format.

Thoughts?

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 reviewing how custom formatters and error formatters are invoked, then examine the Grape formatter middleware and the proposed format DSL. The work is complete when the project has a decided approach for exposing headers and status, with its backward-compatibility impact resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.