-
Notifications
You must be signed in to change notification settings - Fork 230
Adding support for APIs in definition file. #72
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
Conversation
test/cli-test.js
Outdated
@@ -100,6 +100,21 @@ describe('command line interface', function () { | |||
}); | |||
}); | |||
|
|||
it('should create swagger.json by default when the API input is from definition file', function (done) { | |||
var goodInput = process.env.PWD + '/bin/swagger-jsdoc.js -d test/fixtures/api_definition.js example/routes.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean "/bin/swagger-jsdoc.js -d test/fixtures/api_definition.js"
:)
As far as I understand, the pull is to remove the required flag of this input. I tested locally and it's ok!
Could you please also update the docs adding an (optional) and making a short note on the flexibility you introduced?
Really thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All is good! Only please update the test command to fetch only the definition file as the scenario covers :)
Thanks!
Fixed! |
README.md
Outdated
@@ -65,3 +65,13 @@ The swagger spec will be served at http://localhost:3000/api-docs.json | |||
### CLI | |||
|
|||
You can also use the tool via [command line interface](./docs/CLI.md). It supports selecting multiple files, recursive subdirectories and watch task for continuous listening of changes in your code. | |||
|
|||
#### CLI Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better! Only last request from me, please move it to the https://github.com/JesseObrien/swagger-jsdoc/blob/master/docs/CLI.md file which is more specifically for the CLI and just add (optional) to https://github.com/JesseObrien/swagger-jsdoc/blob/master/docs/CLI.md#specify-input-files
Otherwise good work!
@drGrove @chdanielmueller if you have some additional ideas, please share. |
LGTM after @kalinchernev changes |
Alright, should be good now 💃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JesseObrien thanks!
This should add the ability to use the
api
key definition in the definitions file to read file sources for APIs.