Skip to content

Globbing - path of output files is always the same #1337

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

Closed
2 tasks done
SchabaJo opened this issue Sep 12, 2023 · 0 comments · Fixed by #1345
Closed
2 tasks done

Globbing - path of output files is always the same #1337

SchabaJo opened this issue Sep 12, 2023 · 0 comments · Fixed by #1345
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library

Comments

@SchabaJo
Copy link
Contributor

SchabaJo commented Sep 12, 2023

Description

The documentation states, that the directory structure from input files is carried over to output files, eg

npx openapi-typescript "specs/**/*.yaml" --output schemas/

# 🚀 specs/one.yaml -> schemas/specs/one.ts [7ms]
# 🚀 specs/two.yaml -> schemas/specs/two.ts [7ms]
# 🚀 specs/three.yaml -> schemas/specs/three.ts [7ms]

However, the path to the output files is always the same and it's overwritten every time. Therefore, only one ts file remains:

npx openapi-typescript 'specs/**/openapi.yaml' -o 'types/'
✨ openapi-typescript 6.5.5
🚀 specs/example1/openapi.yaml → file:///C:/Users/schabajo/Code/MyRepo/types/openapi.ts [74ms]
🚀 specs/esample2/openapi.yaml → file:///C:/Users/schabajo/Code/MyRepo/types/openapi.ts [90ms]
Name Version
openapi-typescript 6.5.5
Node.js 18.17.1
OS + version Windows 10 22H2 (Build 19045.3324)

Reproduction

  1. setup multiple yaml files: specs/example1/openapi.yaml, specs/esample2/openapi.yaml
  2. run openapi-typscript: npx openapi-typescript 'specs/**/*.yaml' -o types/
  3. all ts files are written to ./types

Expected result

Directory sturcture of input files should be preserved and carried over to output files.

Checklist

UPDATE
Maybe I interpreted the readme wrong, but at least the output path is wrong. As seen in the example, it should be ./schemas/specs, so in my case it should be ./types/specs but it is ./types.

@SchabaJo SchabaJo added bug Something isn't working openapi-ts Relevant to the openapi-typescript library labels Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-ts Relevant to the openapi-typescript library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant