ruby-grape / ruby-grape/grape-swagger

Wrong route ordering

Open
#921 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
1.1k
Forks
479
Avg merge
2d 14h
Merged PRs (30d)
6

Description

There is wrong ordering of routes.

For example - there is ordering in the resource I've set:

  1. GET users/
  2. GET users/:id
  3. POST users/
  4. POST users/:id/restore
  5. PUT users/:id
  6. DELETE users/:id

But grape-swagger is generating it like this:

  1. GET users/
  2. POST users/
  3. DELETE users/:id
  4. GET users/:id
  5. PUT users/:id
  6. POST users/:id/restore

The fix from https://github.com/ruby-grape/grape-swagger/pull/859 doesn't fix it completely. The order is still not the same as it was "declared"

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 the route-ordering behavior and the incomplete fix in pull request #859. Reproduce the issue with the route sequence in this report, then trace how grape-swagger collects and emits routes; done means the generated order matches the declaration order, including parameterized and restore routes.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, ruby
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.