Add swagger-restify-mw #13672

merged 3 commits into from Jan 2, 2017


None yet

3 participants

micmro commented Jan 2, 2017

Please fill in this template.

  • Make your PR against the master branch.
  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run tsc without errors.
  • Run npm run lint package-name if a tslint.json is present.

Select one of these and delete the others:

If adding a new definition:

  • The package does not provide its own types, and you can not add them.
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with npm run new-package package-name, not by basing it on an existing project.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: add explicit typings for restify (see source) and tests to swagger-node-runner.
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "../tslint.json" }.

If removing a declaration:

  • If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.
dt-bot commented Jan 2, 2017


to author (@micmro). Could you review this PR?
👍 or 👎?


  • pass the Travis CI test?



micmro commented Jan 2, 2017


+let app = restify.createServer();
+SwaggerNodeRunner.create(config, function(err, runner) {
+// SwaggerRestify.create(config, function(err, swaggerRestify) {
DanielRosenwasser Jan 2, 2017 Collaborator

Can you remove this line?

micmro Jan 2, 2017 Contributor

Oups - removed now.


Is there any specific reason that the middleware needs to be exposed from swagger-node-runner rather than swagger-node-mw itself? Is it simply a convenience thing?

micmro commented Jan 2, 2017 edited

Yes swagger-restify-mw is just a light convenience wrapper around swagger-node-runner.
You can check the (very small) source here:
Sorry read the question wrong - you mean the re-export? Yes, I thought it's more convenient. Is this an anti-pattern? I have used the same api-interface for swagger-hapi and swagger-express-mw - can change it though.

+ // if (swaggerRestify.runner.swagger.paths['/hello']) {
+ // console.log('try this:\ncurl' + port + '/hello?name=Scott');
+ // }
DanielRosenwasser Jan 2, 2017 Collaborator

Can we also just get rid of this line as well since it's not being used?

@DanielRosenwasser DanielRosenwasser merged commit 7a1a842 into DefinitelyTyped:master Jan 2, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed


@micmro micmro deleted the micmro:swagger-restify-mw branch Jan 2, 2017
DanielRosenwasser commented Jan 2, 2017 edited

To answer your question - no I don't think re-exporting is a problem. Don't sweat it. Thanks for the PR!

micmro commented Jan 2, 2017

Great, thanks! And happy new year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment