You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the path level parameters are defined as refs we seem to run into this problem.
In this case the relative file to be loaded is present inside the path_level_params_spec/sub-dir but the parser seems to be looking for it in the base path where the openapi.json file is present.
Triage:
Looks like the ExternalRefProcessor.join(String, String) is not invoked in the flow from PathsProcessor. processPaths:80
So the relative paths of the nested refs are not loaded from the current directory but instead from basePath causing this issue.
Error:
20:42:56.335 [main] WARN i.s.v.p.OpenAPIV3Parser - Exception while resolving:
java.lang.RuntimeException: Unable to load RELATIVE ref: sub-dir2/pagination_params_1.json path: /Users/<my_name>/swagger-parse-test/target/test-classes/path_level_params_spec
at io.swagger.v3.parser.util.RefUtils.readExternalRef(RefUtils.java:220)
at io.swagger.v3.parser.ResolverCache.loadRef(ResolverCache.java:156)
at io.swagger.v3.parser.processors.ExternalRefProcessor.processRefToExternalParameter(ExternalRefProcessor.java:758)
at io.swagger.v3.parser.processors.ParameterProcessor.processParameter(ParameterProcessor.java:46)
at io.swagger.v3.parser.processors.OperationProcessor.processOperation(OperationProcessor.java:43)
at io.swagger.v3.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:88)
at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:72)
at io.swagger.v3.parser.OpenAPIResolver.resolve(OpenAPIResolver.java:59)
at io.swagger.v3.parser.OpenAPIV3Parser.resolve(OpenAPIV3Parser.java:240)
at io.swagger.v3.parser.OpenAPIV3Parser.readContents(OpenAPIV3Parser.java:183)
at io.swagger.v3.parser.OpenAPIV3Parser.readLocation(OpenAPIV3Parser.java:97)
at io.swagger.v3.parser.OpenAPIV3Parser.read(OpenAPIV3Parser.java:124)
at com.paypal.ppaas.swagger.codegen.ParametersTest.main(ParametersTest.java:146)
When the path level parameters are defined as refs we seem to run into this problem.
In this case the relative file to be loaded is present inside the
path_level_params_spec/sub-dir
but the parser seems to be looking for it in the base path where theopenapi.json
file is present.Triage:
Looks like the
ExternalRefProcessor.join(String, String)
is not invoked in the flow fromPathsProcessor. processPaths:80
So the relative paths of the nested refs are not loaded from the current directory but instead from basePath causing this issue.
Error:
openapi.json
params.json
pagination_params_1.json
Main.java:
The text was updated successfully, but these errors were encountered: