loopbackio / loopbackio/loopback-next
lb4 openapi generator returns ResolverError when main spec contains schemas in subfolders
Open
@dhmlau is already working on this.
Since Jan 7, 2021.
bug
CLI
developer-experience
OpenAPI
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
Steps to reproduce
Created a default template OpenAPI spec using subfolders via Stoplight Studio
Current Behavior
command in models folder:
lb4 openapi --path ./models/openapi-spec.v1.json
Returns error:
Generation is aborted: ResolverError: Error opening file "c:\path\to\spec\models\subfolder-model.schema.v1.json"
ENOENT: no such file or directory, open 'c:\path\to\spec\models\subfolder-model.schema.v1.json'
Expected Behavior
I expect it to properly resolve relative links to the spec (not the src/root folder)
Link to reproduction sandbox
https://github.com/manchuwook/loopback-bug-subfolder for OpenAPI spec
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.