Relative reference in external jar is resolved as a URL instead of RELATIVE
See original GitHub issueI have a service project in which OpenAPI schemas are included via a jar file. Inside this jar file, the schema contains a relative reference to another fragment in the same jar.
These are the references:
api.json (service project)
-> Persons.json (jar)
-> Person.json (relative ref in same jar)
The reference is resolvable from the service to Persons.json in the jar. However, the relative reference within the jar from Persons to Person is resolved as URL instead of RELATIVE. This generates this error:
java.net.MalformedURLException: no protocol: /Person.json
Investigation into ExternalRefProcessor
shows that this code strips the leading dot
off the reference from Persons to Person:
Which causes it to be treated as a URL:
Simple project with steps to reproduce: https://github.com/douglasbgray/openapi-service
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to add referenced library JAR files using relative path for ...
Right click the jar and choose copy relative path then add it to settings, click the refresh button then the added jar should...
Read more >Description of workbook link management and storage in Excel
Workbooks links to source workbooks are created in a relative manner whenever possible. This means that the full path to the source workbook...
Read more >RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines...
Read more >The Executable Jar Format - Spring
Used to resolve relative paths in loader.path . For example, given loader.path=lib , then ${loader.home}/lib is a classpath location (along with all jar...
Read more >Use relative path for project local resources
In my use case, reference problems always occur for the following reasons: - the path to the NetBeans project has changed. Yet, the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @gracekarina, I checked it out and the fix in PR https://github.com/swagger-api/swagger-parser/pull/658 has resolved my issue. I have updated
openapi-service
and it builds correctly using the 1.0.35-snapshot version. Thanks for the quick fix!I’ll close it no problem. It was fixed by #658