Redocly / Redocly/redoc

Place general "2XX" above specific "400"

Open
#687 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

I have an endpoint that can respond with "2XX" or "400". ReDoc lists 400 above 2XX, which seems a bit weird since in all other cases, success responses are listed first. I get that specific responses should be listed before general ones, but I propose that this sorting is done per response type (200-299, 400-499, etc) and not globally across all response types.

For example: I would expect 200, 201, 2XX, 403, 4XX to be sorted in that order, not as 200, 201, 403, 2XX, 4XX.

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 locating the response-ordering logic in ReDoc's OpenAPI documentation renderer and reproduce the issue with the 200, 201, 2XX, 403, 4XX example. Done means responses are grouped by status-code class while retaining specific-before-general order within each class, with coverage for the displayed ordering.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Bug
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.