openapi-merge icon indicating copy to clipboard operation
openapi-merge copied to clipboard

Leading '/' is stripped from output path

Open dasKeks28 opened this issue 2 years ago • 0 comments

It seems like leading a / is stripped from the input and output files. I like to write my output to /tmp/ to do some additional processing outside of my repository, however openapi-merge-cli wants to write the file to a relative path.

The stripping also applies to ./ according to the logs, which however is not a problem, since it's already a relative path, but in my eyes the specified file paths shouldn't be modified in any way to allow both relative and absolute paths.

openapi-merge.json:

{
  "inputs": [
    {
      "inputFile": "./my-api/src/main/resources/api.yaml"
    }
  ],
  "output": "/tmp/merged-api-output.yaml"
}

Error:

## /usr/local/Cellar/node/19.4.0_1/bin/node: Running v1.3.1 (+1ms)
## Loaded the configuration: 1 inputs (+69ms)
## Loading input 0: my-api/src/main/resources/api.yaml (+1ms)
## Loaded the inputs into memory, merging the results. (+7ms)
## Inputs merged, writing the results out to 'tmp/merged-api-output.yaml' (+4ms)
An uncaught exception was thrown Error: ENOENT: no such file or directory, open 'tmp/merged-api-output.yaml'

(on a side note: Thx for the great tool :heart:)

dasKeks28 avatar Jan 31 '23 20:01 dasKeks28