Closed
Description
After updating from 0.25.0 to 0.26.0, a relative path passed to the input parameter is resolved from the "node_modules@apidevtools\json-schema-ref-parser" folder instead of from the project folder where the command is being run.
Example command:
openapi --input ./openapi/swagger-design.json --output ./openapi-gen --name FooBar
It tries to read from
node_modules\@apidevtools\json-schema-ref-parse\openapi\swagger-design.json
and gives an error that it cannot find that file (because the file is actually under my project folder).
{
stack: 'JSONParserError: Error opening file "C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json" \n' +
"ENOENT: no such file or directory, open 'C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json'\n" +
' at Object.read (C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\lib\\resolvers\\file.js:59:19)',
code: 'ERESOLVER',
name: 'ResolverError',
message: 'Error opening file "C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json" \n' +
"ENOENT: no such file or directory, open 'C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json'",
source: 'C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json',
path: null,
toJSON: [Function: toJSON],
ioErrorCode: 'ENOENT',
footprint: 'null+C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json+ERESOLVER+Error opening file "C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json" \n' +
"ENOENT: no such file or directory, open 'C:\\Projects\\Foo\\MyProjectFolder\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\openapi\\swagger-design.json'",
toString: [Function: toString]
}
Metadata
Metadata
Assignees
Labels
No labels