App Backend Development one: Build API interface documentation tools based on Swagger-ui

Source: Internet
Author: User

Statement

Before written about the app backend development of a series of articles, that is my first time to do the app backend development, there are many shortcomings, this would like to modify, think or re-write it, this can also make Me blog article looks a little more, in case of looking for a job, others a look at my blog so much content, is not very dick?
This article begins with building resetful-style API documentation tools. Without a good documentation tool, the development of the app front-end staff will be very inefficient, and from time to time, they come to you with their breakpoints.

My documentation Experience

This is not to discuss whether my data transmission is reasonable, just as a demonstration of this data. There will be a special chapter on the app data transfer encryption explained.

    1. When I first developed the app backend, I used a Word document that I first defined all the data formats and returned what data to write. The front-end staff took this to develop. Put a picture on it:

      PS: The problem: ① interface changes, it is not easy to be recognized. ② maintenance difficult, not easy to find. ③ front-end development cannot be tested. (If you want to write the shortcomings, there are 5k+ words can be written out, then omitted ha)
    2. When I developed the backend of the second app, I wrote a simple app interface management system for the backend publishing interface, as well as the front-end staff to view. Effect

      PS: Advantages: ① If you have multiple front-end personnel, you can ensure that you see the same document. ② through the interface version identification, convenient for everyone to see whether the modification, advantages and so on omitted. Disadvantage: ① is not able to test online interface, need to use poster plug-in.
    3. Now I'd like to recommend the Chinese version of the swagger-ui that I have used for a day's transformation. Originally English is very good, just in order to understand this stuff, he changed into a Chinese version, also as their first GitHub project it. Let's go first:
      Interface Module Interface:

      Interface List Interface:

      An interface interface:

OK, stickers So far, if you have not seen enough of the classmates, give you a connection, try it yourself:
Swagger-ui Chinese version address: http://helei112g.github.io/swagger-ui/

Believe that after just the experience, do not need me to say it's strong and convenient it? It is not only available for immediate online testing, it can also be automatically built into model based on the JSON returned. Makes it easier for you to make decisions. Benefits I will not say, anyway since the use of it, our front-end waist is not sour, the leg is not painful. It's also spirit to write code.

Oh, the most important:
Https://github.com/helei112g/swagger-ui
If you feel good, trouble give a start, give me encouragement, thank you!

App Backend Development one: Build API interface documentation tools based on Swagger-ui

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.