Fix URISyntaxException for $ref to path with param #1523
Merged
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.
In case $ref refers to path with parameter, using whole $ref in processRefSchema as externalFile argument results in URISyntaxException
java.net.URISyntaxException: Illegal character in fragment at index 49: ../v1/checkout.yml#/paths/
1checkout1orderItem~1{orderItemId}at java.base/java.net.URI$Parser.fail(URI.java:2915)
at java.base/java.net.URI$Parser.checkChars(URI.java:3086)
at java.base/java.net.URI$Parser.parse(URI.java:3130)
at java.base/java.net.URI.(URI.java:600)
at io.swagger.v3.parser.processors.ExternalRefProcessor.join(ExternalRefProcessor.java:977)
at io.swagger.v3.parser.processors.ExternalRefProcessor.constructRef(ExternalRefProcessor.java:928)
at io.swagger.v3.parser.processors.ExternalRefProcessor.processRefSchema(ExternalRefProcessor.java:918)
at io.swagger.v3.parser.processors.ExternalRefProcessor.processRefSchemaObject(ExternalRefProcessor.java:867)
at io.swagger.v3.parser.processors.ExternalRefProcessor.processRefToExternalPathItem(ExternalRefProcessor.java:280)
at io.swagger.v3.parser.processors.PathsProcessor.processReferencePath(PathsProcessor.java:299)
at io.swagger.v3.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:63)
at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:49)
Using only file part (without fragment) produces expected result.