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:
- 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
- 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, ...