-
1. The era of API explosion -
1. Background introduction -
2. Problem elicited -
3. Solutions -
2. Core functions -
1. API Documentation -
2. API debugging -
3. Mock data -
4. Automated testing -
5. Online debugging -
3. Other functions -
1. Code generation -
2. Data import/export -
4. Surprise function -
V. Summary
1. The era of API explosion
With the recent introduction of various concepts such as mobilization, Internet of Things, digital transformation, and microservices in the industry, the number of corresponding APIs has shown an explosive growth. To highlight, we can hardly find a suitable technical tool to improve our efficiency. The resulting problem is the cumbersome interface docking, and the daily quarrel between the front-end and the back-end.
1. Background introduction
Now we actually have a lot of API tools, which are famous in API document design. Swagger
We have API development and debugging, and we have many methods for Postman
front-end development Mock.js
and automated testing JMeter
. However, because it is multiple software, we need to input multiple times. The same overlapping data can only be implemented in different systems to achieve the functions we need, and when the project changes, we have to make changes in multiple places. If we forget to modify it, it is boom.
2. Problem elicited
So in order to meet the above requirements, what we need is to integrate these commonly used software. If we can achieve complete data interoperability, when we modify one place, it will be perfect for all places to be modified.
3. Solutions
Today, I discovered the artifact Apifox when I was surfing the Internet. The official propaganda is to integrate the giant software of various industries into a unified program, and solve the data synchronization between multiple systems through a set of systems and a set of data. question. As long as the interface document is defined, the interface debugging, data mocking, and interface testing can be used directly without redefining; the same tool is used for the interface document and the interface development and debugging. After the interface debugging is completed, the definition of the interface document can be guaranteed to be exactly the same. Efficient, timely and accurate!
Official website address:
https://apifox.cn/a1weixiao1
The software now supports the web version, so the overall experience is carried out on the web.
2. Core functions
1. API Documentation
In the API documentation part, it is not the cold documentation of the past, but fully visualized, which undoubtedly reduces our learning cost, and the documentation follows the OpenAPI specification, which can also improve the standardization of our documentation.
2. API debugging
In the interface debugging part, we can create multiple forces for one interface and automatically follow the interface to make changes, and Apifox has all the functions used by Postman, which can perform functions such as environment variables, global variables, pre- and post-scripts, global sharing and so on. comprehensive. And supports running any language code: js, java, py, php, etc.
3. Mock data
Apifox fully supports Mock.js syntax, and extends common rules such as ID card and domestic mobile phone number, and can automatically generate mock rules according to the data structure and data type in the interface definition. And built-in intelligent mock rule base, according to the field name, field data type, intelligently optimize the automatically generated mock rules. It can automatically identify fields such as pictures, avatars, user names, mobile phone numbers, website addresses, dates, time, timestamps, emails, provinces, cities, addresses, IPs, etc., so that Mock can generate very user-friendly data. Support custom rule base to meet various personalized needs. Supports custom mock rules using regular expressions and wildcards to match field names.
4. Automated testing
Supports automated testing after the relevant test case steps and corresponding data configuration are completed, and we can easily automate the testing of the code.
5. Online debugging
This document is made with Apifox. I have tried this tool before, but I didn't expect so many powerful new functions to come out recently. Click the Run button in the upper right corner of the document, and the "Online Run" module will appear
This interface can directly debug the interface! Directly 1. Fill in the parameters, 2. Select the environment, 3. Click Send, and the interface request is sent! The following is the return result! No need for Postman at all! Not to mention copying the API!
I thought to myself, if I had used Apifox before it went live, there would have been no accidents:
1. The parameter does not exist? I got the data after online debugging, and I know which parameter does not exist through the comparison;
2. The parameter type is wrong? Similarly, after online debugging, through comparison, I know which parameter type is wrong;
3. The interface does not exist (because the interface is written incorrectly)? When debugging, it is reported that the interface does not exist, and the backend is found for the first time~;
3. Other functions
1. Code generation
This is very outrageous, you can directly generate the corresponding business code, free your hands and become a ctrl + cctrl + v programmer. You can automatically generate business and model codes in various languages/frameworks according to the interface/model definition. And supports TypeScript, Java, Go, Swift, ObjectiveC, Kotlin, Dart, C++, C#, Rust and other 130 languages and frameworks. Kind of sci-fi.
2. Data import/export
Supports exporting data formats such as OpenAPI (Swagger), Markdown, and Html.
Supports importing data formats such as OpenAPI (Swagger), Postman, HAR, RAP2, JMeter, YApi, Eolinker, RAML, DOClever, Apizza, DOCWAY, ShowDoc, I/O Docs, WADL, Google Discovery, etc.
This will facilitate our data migration. And we can also back up archives on the fly, so we never get bald for writing documentation.
4. Surprise function
As a coder, the ultimate goal is to share. The API Hub on Apifox's official website allows us to easily view other people's projects for learning. At the same time, if we make a document that we think is perfect, we can also share it. Sharing can make us more powerful. can enhance our output capabilities.
V. Summary
After the overall experience, I can only say that Apifox thinks very comprehensively, which can free us from the work of document writing and interface docking, and focus more on code writing and business logic sorting. If you are tired of interface docking, you might as well try it. , you'll find that it does everything for you like a nanny.
Official website address:
https://apifox.cn/a1weixiao1
If you have problems during use, you can also join the Apifox user group to ask questions and learn.