gulp-loopback-swagger-validator
Gulp plugin that parses Swagger specifications in YAML format, validates against the official [Swagger 2.0 schema][swagger2spec], and compares against loopback application
Usage
Pre-requisite changes in Loopback configuration:
- Create a folder called 'spec' and store your YAML specification file
- Make changes to component-config.json Modify the configuration of the loopback-explorer component as:
"loopback-component-explorer": "mountPath": "/explorer" "consumes": "${consumes}" "produces" : "${produces}" "apiInfo": "${apiInfo}"
- Make changes to config.json At the end of config.json file add the follow configuration:
"apiInfo": "title": Title of the your API application as written in YAML "consumes":Array of mime types that your application "produces":Array of mime types that your application
- Add gulpfile task
var gulp = ;var lbValidator = ;var swagger = ;var path = ; gulp; gulp;
- Preview in the console