Normalize relative ref paths to avoid duplicating schemas#2105
Open
ctreatma wants to merge 4 commits intoswagger-api:masterfrom
Open
Normalize relative ref paths to avoid duplicating schemas#2105ctreatma wants to merge 4 commits intoswagger-api:masterfrom
ctreatma wants to merge 4 commits intoswagger-api:masterfrom
Conversation
6f1d634 to
18d5450
Compare
ctreatma
commented
Jun 17, 2024
modules/swagger-parser-v3/src/test/resources/oas3.fetched/components/parameters/Exclude.yaml
Outdated
Show resolved
Hide resolved
6 tasks
|
Just ran into this issue today. Glad to see a fix is on the way (hopefully soon). Thanks! |
d25dc19 to
e2fd955
Compare
e2fd955 to
8174b8f
Compare
Author
|
I rebased on the latest from |
47a4931 to
26e34ae
Compare
ctreatma
commented
Jan 8, 2025
...es/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/ExternalRefProcessor.java
Outdated
Show resolved
Hide resolved
929aacc to
74720bc
Compare
ctreatma
added a commit
to equinix/equinix-sdk-go
that referenced
this pull request
Feb 24, 2025
The semantic-release tool explicitly ignores the `.gitignore` file, which means that the automated release process will commit all files that are present in the local repo even if they are in the `.gitignore`. This updates the Metal codegen task to explicitly clean up the temporary merged spec. If swagger-api/swagger-parser#2105 gets merged and is included in an openapi-generator release before this SDK loses support for Metal, we can remove the temporary merged Metal spec.
74720bc to
adcfebb
Compare
adcfebb to
1cd8e74
Compare
1cd8e74 to
ddc074b
Compare
Author
|
@MichakrawSB I see that this PR has been assigned to me but I'm not clear what needs to be done to move it forward. Is there something I need to address before the GitHub Actions workflows can be approved to run on this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, if an OpenAPI spec contains multiple relative refs to the same file, but those refs are located in different files and use different relative paths to reach the one file, swagger-parser will create a separate, duplicate schema for each relative path rather than reusing the same schema across all equivalent paths.
For example, given a spec with the following refs:
$ref: ./components/schemas/Thing.yaml$ref: ../../components/schemas/Thing.yamlThe parser will produce a
Thingand aThing_1schema object instead of reusingThingfor the second, equivalent reference.This updates the ref processor to resolve relative paths before processing relative refs in order to produce a single
Thingschema that is reused for all equivalent references.Fixes #2016, fixes #1518, and maybe others.