swagger-api / swagger-api/swagger-ui

Could not resolve reference: JSON Pointer evaluation failed while evaluating token "components" against an unexpected Element

Open
#10,191 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

swagger-js type: bug
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

General:

  • MacOs
  • Browser: Chrome, Safari, Firefox
  • Method of installation: pnpm
  • Swagger-UI version: 5.17.14 (swagger-ui-react)
  • Swagger/OpenAPI version: 3.1.0
Content & configuration

Whenever I try to resolve a component schema:

Screenshot 2024-11-05 at 00 26 48

Describe the bug you're encountering

In my current app, swagger-ui it not able to resolve references whenever an escape sequence is present in my apps query parameters (not in the spec).

This is a dublicate of #9304 . The fix in the issue does not seem to work. Api-dom is locked on version 1.0.0-alpha.10 (after the supposed fix)

To reproduce...
  • Install react (with vite or similar)
  • Render swagger-ui-react with any valid spec
  • Add query params to your url e.g. ?activeElement=%7B"type"%3A"create_client"%7D
  • Refresh browser
  • You now see the errors
What I have tried
  • Swagger-ui instead of swagger-ui-react

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 reproducing the failure in swagger-ui-react with a valid OpenAPI 3.1 spec and an escaped query parameter such as activeElement. Check how the api-dom dependency is resolved, including the reported 1.0.0-alpha.10 lock, and compare the behavior with duplicate issue #9304. Done means references resolve without errors after refreshing with the escaped query parameter.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.