swagger-api / swagger-api/swagger-client

Why does $ref automatically resolve on extensions?

Open
#1,387 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: resolver type: bug
Dominant language
JavaScript
Stars
2.7k
Forks
765
Avg merge
1d 1h
Merged PRs (30d)
6

Description

From @rwrife on September 14, 2018 18:2

I've noticed that the Swagger UI is trying to resolve $refs on extensions, and in my case failing, even though it can't use the data in the extension, thus resulting in a meaningless error to the end-user. Ideally I think it would, more or less, ignore anything defined in the extensions. For example on an operation I have:

"x-ms-examples": { "Test Examples": { "$ref": "./examples/myExamples.json" } }

The UI can't do anything with x-ms-examples, so why attempt to resolve the ref (which it can't resolve in my specific case)?

Copied from original issue: swagger-api/swagger-ui#4880

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

No files or tests are named. Start by reproducing the Swagger UI behavior with the shown x-ms-examples object and trace how $ref values inside extensions are handled; done means extension data no longer produces a meaningless resolution error.

Written by the indexing model from the issue text.

Assessment

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