Swagger 2.0 with official tooling

Using official tooling and version 2.0, you can automate API creation and response generation. Once official tooling fully supports them, OpenAPI 3.0, the same instructions should apply:

  1. Publish your YAML file on a URI that will be accessible by your machine:
https://raw.githubusercontent.com/duluca/lemon-mart-swagger-server/master/swagger.2.yaml
  1. In your project folder, execute the following command, replacing <uri> with the one pointing at your YAML file:
$ docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli $ generate -i <uri> -l nodejs-server -o /local/server

Similar to the preceding section, this will create a Node Express server under the server directory. In order to execute this server, ...

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.