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
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.
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.
openapi-typescript-validator/src/generate/generate-models.ts
Line 14 in 571cd8c
The file structure in my project is as follows:
├── project_root
│ ├── validator
│ │ ├── generator.js
│ ├── openApiSpec
│ │ ├── interface.yaml
│ │ ├── my2ndFile.yaml
The text was updated successfully, but these errors were encountered: