Skip to content

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

Merged
merged 1 commit into from
May 3, 2017

Conversation

JesseObrien
Copy link
Contributor

This should add the ability to use the api key definition in the definitions file to read file sources for APIs.

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';
Copy link
Contributor

@kalinchernev kalinchernev May 2, 2017

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!

Copy link
Contributor

@kalinchernev kalinchernev left a 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!

@JesseObrien
Copy link
Contributor Author

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
Copy link
Contributor

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!

@kalinchernev
Copy link
Contributor

@drGrove @chdanielmueller if you have some additional ideas, please share.

@drGrove
Copy link
Contributor

drGrove commented May 2, 2017

LGTM after @kalinchernev changes

@JesseObrien
Copy link
Contributor Author

Alright, should be good now 💃

Copy link
Contributor

@kalinchernev kalinchernev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JesseObrien thanks!

@kalinchernev kalinchernev merged commit 6011557 into Surnet:master May 3, 2017
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 this pull request may close these issues.

3 participants