OpenAPITools / OpenAPITools/openapi-generator

[BUG] Update swagger-parser dependency to fix relative reference resolution in parameter examples

Open
#21,922 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

We have identified an issue with resolving relative references in parameter examples within OpenAPI specifications. This problem affects the proper parsing and resolution of $ref references in parameter examples when they point to relative paths.

Root Cause

The issue stems from the underlying swagger-parser library's handling of relative references. We have reported this upstream issue to the swagger-parser project:

Related Issue: https://github.com/swagger-api/swagger-parser/issues/2229

Proposed Solution

Once the swagger-parser team resolves and releases a fix for the relative reference resolution issue, we need to:

  1. Update the swagger-parser dependency in openapi-generator to the latest version containing the fix
  2. Test the resolution of relative references in parameter examples
  3. Ensure backward compatibility is maintained

Impact

This fix will improve:

  • Proper resolution of relative $ref references in parameter examples
  • Better compliance with OpenAPI specification standards
  • Enhanced reliability when processing complex OpenAPI documents with relative references

Steps to Reproduce (if applicable)

  1. Create an OpenAPI specification with parameter examples using relative $ref references
  2. Process the specification with openapi-generator
  3. Observe that relative references in parameter examples are not resolved correctly

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 checking the openapi-generator dependency configuration for swagger-parser and the upstream swagger-parser issue 2229. Wait for the upstream fix and released version, then update the dependency, add coverage for relative references in parameter examples, and verify backward compatibility; no specific file or test is named in the issue.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.