Unable to load RELATIVE ref: ./parameters.yaml
See original GitHub issueI’m starting with gradle plugin swagger2markup version 13.1.
I have this directory structure:
- models
|_ main.yaml
|_ components
|_ parameters.yaml
|_ paths.yaml
- build.gradle
The main.yml references paths.yaml and paths.yaml references parameters.yaml.
When I launch the task convertSwagger2markup --stacktrace, I have this error:
Caused by: java.lang.RuntimeException: Unable to load RELATIVE ref: ./parameters.yaml
at io.swagger.parser.util.RefUtils.readExternalRef(RefUtils.java:140)
at io.swagger.parser.ResolverCache.loadRef(ResolverCache.java:94)
at io.swagger.parser.processors.ParameterProcessor.processParameters(ParameterProcessor.java:37)
at io.swagger.parser.processors.OperationProcessor.processOperation(OperationProcessor.java:26)
at io.swagger.parser.processors.PathsProcessor.processPaths(PathsProcessor.java:93)
at io.swagger.parser.SwaggerResolver.resolve(SwaggerResolver.java:40)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:66)
at io.swagger.parser.SwaggerParser.read(SwaggerParser.java:52)
at io.github.swagger2markup.Swagger2MarkupConverter$Builder.readSwagger(Swagger2MarkupConverter.java:321)
at io.github.swagger2markup.Swagger2MarkupConverter$Builder.<init>(Swagger2MarkupConverter.java:301)
at io.github.swagger2markup.Swagger2MarkupConverter.from(Swagger2MarkupConverter.java:116)
at io.github.swagger2markup.Swagger2MarkupConverter.from(Swagger2MarkupConverter.java:81)
at io.github.swagger2markup.Swagger2MarkupConverter$from.call(Unknown Source)
at io.github.swagger2markup.tasks.Swagger2MarkupTask.convertSwagger2markup(Swagger2MarkupTask.groovy:62)
... 114 more
Caused by: java.lang.RuntimeException: Could not find ./parameters.yaml on the classpath
at io.swagger.parser.util.ClasspathHelper.loadFileFromClasspath(ClasspathHelper.java:31)
at io.swagger.parser.util.RefUtils.readExternalRef(RefUtils.java:135)
... 127 more
I originally post a issue on Swagger2Markup/swagger2markup (256), they said me to post a issue here.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
"Unable to load RELATIVE ref" for openapi-run.yaml in GCP ...
You are using an absolute filename, not a relative one. Try dropping the leading /workspace/ from the path in $ref .
Read more >[BUG][JAVA] Regression "-Unable to load RELATIVE ref ...
[main] WARN o.o.codegen.utils.ModelUtils - Failed to get the schema name: ./openapi/model.yaml#/components/responses/FooResponse Exception ...
Read more >The correct way to pull stuff from classpath in $ref
The Swagger YAML file in service attempts to pull a parameter which is defined in common but with ... failed: Unable to load...
Read more >Relative $refs not being loaded when running as a jar?
yaml and has a $ref: getCustomer-schema.json in it. However, when this runs, it seems to be able to load the main spec file...
Read more >swagger-api - Bountysource
Unable to load RELATIVE ref : ./parameters.yaml ... I'm starting with gradle plugin swagger2markup version 13.1. I have this directory structure: - ...
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

Same issue. As a work around, I’m consolidating all referenced files to a single directory.
Hi @gracekarina
I use openapi-generator:4.3.0 maven plugin and forced swagger-parser:2.0.19.
I have checked that the relative paths in responses and responseBody work correctly #1343
Relative paths in parameters are not working (I don’t check if relative paths in examples, links or headers are working)
spec
I have this directory structure:
.openapi-rest.yml
.paths.yml
.parameters.yml
Openapi-generator fails to generate and output the following.
Expected output:
Related issues/PRs #1292 #1343