loopbackio / loopbackio/loopback-next

lb4 openapi generator returns ResolverError when main spec contains schemas in subfolders

Open
#6,963 7 comments 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.