ruby-grape / ruby-grape/grape

Header validation DSL

Open
#1,371 12 comments 3 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

Currently there is no way to validate headers with Grape using the DSL.
It'd be useful to be able to specify that a header must be present or must be equal to something without coding it manually.
Providing a header validation DSL can help you say things like:

  • The client should never ask to cache the request using Cache-Control
  • The server only responds in UTF-8 charset.
  • A custom header must be present and equal to "Yes"

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

No file, test, or entry point is named. Start by locating Grape's existing validation DSL and request-header handling, then determine how the examples should be expressed. Done means documented DSL behavior with coverage for header presence, exact equality, and the Cache-Control and charset cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.