ruby-grape / ruby-grape/grape

Recognize_path should account for HTTP method

Open
#2,415 4 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

In a RESTful API, you'll use the same path multiple times, but with a different REST verb.

These will return the same endpoint:

  • GET /orders
  • POST /orders

So will these:

  • GET /orders/123
  • PUT /orders/123
  • DELETE /orders/123

Ideally, we'd be able to pass that in as an option:

API.recognize_path('/orders/123', method: 'PUT')

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 at the API.recognize_path entry point and inspect how path recognition currently handles the supplied options. Confirm the expected behavior for GET, POST, PUT, and DELETE requests on the example paths; done means passing a method option distinguishes routes that share a path.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.