swagger-api / swagger-api/swagger-parser

x tag schema reference is not parsed to the right path

Open
#1,558 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

I'm seeing a problem trying to converting swagger 2.0 when it has a reference of the schema from an x-tag.
I'm using

io.swagger.parser.v3
swagger-parser
2.0.25

io.swagger
swagger-parser
1.0.54

io.swagger
swagger-models
1.6.2

The issue is the $ref for ConflictErrorResponse is still pointing to #/definitions
This issue is also reproducible by going to https://editor.swagger.io/ and click on Edit -> "Convert to OpenAPI 3"
When trying it from the UI, i got this error in the validation
Semantic error at x-tag-test.responses.ConflictError.content.application/json.schema.$ref $refs must reference a valid location in the document Jump to line 49

Attached ver2 and ver3 yaml along with some screenshots
yamlAndScreenshots.zip

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 ver2 and ver3 YAML files in yamlAndScreenshots.zip and reproducing the conversion in https://editor.swagger.io/ using Edit → "Convert to OpenAPI 3". Trace the conversion entry point that handles the x-tag schema reference and verify that ConflictErrorResponse uses a valid OpenAPI 3 path without the reported validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
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.