Installation of Swagger-editor
The YAML syntax applied by the
- swagger-editor, with defined variables and data structures, does not understand that it is possible to refer to its example
- installation steps:
- download swagger-editor git address
- shipping Line NPM Run build generates a running package
-
Window considerations:
-
Remove the Prebuild function from the Scripts node in the Package.json file, or you will be prompted RM-RF dist/** is not valid, it is clear that this is the file to delete the generated package, you can delete it manually or change the command yourself.
-
Changes the. eslintrc.js file, primarily to fix the authentication method for Linebreak-style
module.exports = {extends: ' google ' ", Globals: {swaggereditor: false true }, rules:{"
/span> "Linebreak-style": ["Error", "Windows"
Installation of Swagger-ui
- Displays the API documentation generated by the Swagger-editor, which can be in YAML or JSON format.
- Installation steps:
- Download Swagger-ui git address
- Two methods of deployment:
- The first type: You can directly copy the contents of the Dist folder to a site directory or create a new site, there is a default swagger-ui default skin.
- The second type:
- Run CNPM install all dependent packages
- Run Gulp serve
- Access native port 8080, if there are multiple http-server, need to customize Http-server port, implement in Gulpfile.js file
function () { connect.server ({ ' dist ', true, port:8888 });});
- You can add print functionality for exporting API documents in PDF format. Easy circulation.
RESTful API Style contract designer: Applications for Swagger-editor and Swagger-ui