Redocly / Redocly/redoc

Unable to render a path item extracted into components section

Open
#2,457 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi! We've discovered a problem with rendering a local reference. If an entire path item is extracted (please, see attached file) into components and referenced like $ref: components/schemas/extracted and user clicks on the "Try It!" button, Redoc gives up and displays error with text Error: Invalid reference token: get. However, the OpenAPI specification docs say that it is ok to have such file layout (https://swagger.io/docs/specification/using-ref/). In other cases where $ref is used, everything is fine.

Minimal reproducible example:
openapi: "3.0.3" paths: /test: $ref: "#/components/schemas/test" info: components: schemas: test: get: operationId: test summary: Test responses: "200": description: "ok"

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 loading the minimal OpenAPI 3.0.3 example and tracing the rendering and “Try It!” flow for the path-level $ref to components/schemas/test. Confirm the fix by ensuring the extracted path item renders and the request no longer fails with “Invalid reference token: get”.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, 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.