-
-
Notifications
You must be signed in to change notification settings - Fork 539
Folder as output doesn't work #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think there is a bug here, but I’m having a little trouble understanding how to reproduce it. Could you list out the contents of all your |
Cannot reproduce this issue myself anymore. Don't know what was it. The only inconvenience now that in a folder structure like that
it creates .ts file with full folder path in the name
Which is inconvenience but expected |
Was anyone able to sidestep this issue? Downgrading to 5.x solves the problem, but I'd like to use the native I'm still facing the issue with 6.0.3. It additionally tries to create a ... weird folder structure. Working on Windows but the same happens with WSL2. Command I'm using is:
in (src/contracts):
out (src/generated/api)
|
Uh oh!
There was an error while loading. Please reload this page.
This command
npx openapi-typescript src/api/v1.0/schemas/**/*.json --output src/api/v1.0/types/
throws an error "src/api/v1.0/types/src/api/v1.0/schemas/schema.ts". Because in openapi-typescript/bin/cli.js:120 filename is not actually a filename.Possible fix:
replace:
const filename = pathToSpec.replace(new RegExp(`${path.extname(pathToSpec)}$`), ".ts");
to:
const filename = path.basename(pathToSpec.replace(new RegExp(`${path.extname(pathToSpec)}$`), ".ts"));
The text was updated successfully, but these errors were encountered: