-
Notifications
You must be signed in to change notification settings - Fork 15
Description
The openapi-typescript-validator works very well for single-file openapi-specs. Thanks for the cool tool! 👍
But: When I split the openapi-spec into multiple files as described in the openapi 3.0 spec with "$ref: my2ndFile.yaml" I receive an ENOENT error. This is becasue the generator is searching in the cwd of the node-process, which is "project_root/validator" and not relatively to the interface-file, that I hand over to generate-function of the openapi-typescript-validator.
As far as I understood the code, the root cause is, "DEFAULT_OPTIONS.cwd" of json-schema-to-typescript package is pointing to process.cwd(). It could have been overwritten when calling compile, but options are not set.
| const compiledTypescriptModels = await compile( |
The file structure in my project is as follows:
├── project_root
│ ├── validator
│ │ ├── generator.js
│ ├── openApiSpec
│ │ ├── interface.yaml
│ │ ├── my2ndFile.yaml