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

Wrong output file format #244

Closed
Iamhashim92 opened this issue Feb 10, 2021 · 5 comments · Fixed by #245
Closed

Wrong output file format #244

Iamhashim92 opened this issue Feb 10, 2021 · 5 comments · Fixed by #245

Comments

@Iamhashim92
Copy link

Iamhashim92 commented Feb 10, 2021

I am trying to generate output file in yaml format by using this command
swagger-jsdoc -- -d definition.yaml ./src/create.js -o swagger.yml &>/dev/null

but it is outputting a wrong file format like this
"openapi: 3.0.3\ninfo:\n title: My API\n version: 1.0.0\n description: The Project internal API documentation\nservers:\n - url: http://localhost:3000\n "

version- 6.0.2

@kalinchernev
Copy link
Contributor

Hi @Iamhashim92, a few questions:

  1. why adding two dashes before definition? i.e. -- + - d
  2. why &>/dev/null?

@Iamhashim92
Copy link
Author

Iamhashim92 commented Feb 11, 2021

Hi @kalinchernev ,
1- Because i have a script in package.json like this "swagger": "swagger-jsdoc".
2- And about &>/dev/null to not receive any outputs.
on the end the &>/dev/null does not matter.
so basically i am running this command
npm run swagger -- -d defination.yaml ./src/create.js -o swagger.yml &>/dev/null

@kalinchernev
Copy link
Contributor

Hi @Iamhashim92 you were right, the issue is not on your part, it's the lib.
I made a few changes #245
Do you mind making a review?

@Iamhashim92
Copy link
Author

Iamhashim92 commented Feb 12, 2021

Hi @kalinchernev,
Changes looks good to me 🎉.
Let me know when the new version is available I will test and will let you know.

@kalinchernev
Copy link
Contributor

@Iamhashim92 the reason i asked for your review is making sure it's ok before publishing it.
You can use test it by changing swagger-jsdoc item in package.json from a specific version to this

"swagger-jsdoc": "Surnet/swagger-jsdoc#fix/yaml-formatting"

It's the name of the repo + the branch. Remove previous node_modules forlder, reinstall and test please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants