Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ensure proper resolution of $ref references in path parameters #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

romannekhor
Copy link

Problem Description

The openapi-extract tool does not currently copy the contents of #/components/parameters/<param_name> when a $ref is used at the #/paths/<path>/parameters level.

Steps to Replicate the Problem

Using the following OpenAPI specification: PagerDuty API Schema.

Run the command:

openapi-extract -d -r -x -v openapiv3.json -o getAnalyticsIncidentsById

This results in #/components/parameters/id being referenced but not correctly copied into the final spec's components block.

Solution

This patch adds a deref(...) call after cloning the path parameters block. This ensures that the $ref references are properly resolved, resulting in a valid and complete spec file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant