Skip to content
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

Types are not sent to stdout if -o is omitted #279

Closed
jfsiii opened this issue Jun 30, 2020 · 3 comments · Fixed by #387
Closed

Types are not sent to stdout if -o is omitted #279

jfsiii opened this issue Jun 30, 2020 · 3 comments · Fixed by #387
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jfsiii
Copy link

jfsiii commented Jun 30, 2020

Steps to reproduce

npx @manifoldco/swagger-to-ts https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json

What I expect to happen

See TS types printed to the screen as documented

What I observe

No TS types are shown

npx @manifoldco/swagger-to-ts https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json
This library has been updated to 2.0 with improved generation. If you experience issues you can use the deprecated v1 with `npx @manifoldco/swagger-to-ts@1 …`
🤞 Loading spec from https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json…
@drwpow drwpow added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed and removed enhancement New feature or request labels Aug 8, 2020
@drwpow
Copy link
Owner

drwpow commented Aug 8, 2020

This would be a good feature! Would love a PR from anyone able to provide it.

@jfsiii
Copy link
Author

jfsiii commented Aug 8, 2020

@drwpow Are the docs wrong or do I misunderstand them?

One issue with printing to stdout is the This library has been ... & 🤞 Loading spec ... lines currently go to stdout, which puts them in the output file, e.g.

> swagger-to-ts https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json > types.ts
> cat types.ts
✨ swagger-to-ts 2.0
This library has been updated to 2.0 with improved generation. If you experience issues you can use the deprecated v1 with `npx @manifoldco/swagger-to-ts@1 …`
🤞 Loading spec from https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json…

Should those lines only be printed to stdout if the output flag/alias is given? I can't immediately think of a way to display to the screen and still support pipes. LMK if you have any ideas/suggestions.

@drwpow
Copy link
Owner

drwpow commented Aug 8, 2020

@drwpow Are the docs wrong or do I misunderstand them?

Sorry; I was unclear. Yes, the docs are wrong—it doesn’t write to stdout, and I don’t think it ever has.

This isn’t by design, just oversight. I think it may have been a behavior I had planned on implementing but never did. I’m in solid agreement that stdout should be supported, and it should be the default behavior without the -o flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants