CN111399825A - API (application programming interface) development management method and system based on API document - Google Patents
API (application programming interface) development management method and system based on API document Download PDFInfo
- Publication number
- CN111399825A CN111399825A CN202010188636.9A CN202010188636A CN111399825A CN 111399825 A CN111399825 A CN 111399825A CN 202010188636 A CN202010188636 A CN 202010188636A CN 111399825 A CN111399825 A CN 111399825A
- Authority
- CN
- China
- Prior art keywords
- api
- document
- interface
- development
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011161 development Methods 0.000 title claims abstract description 102
- 238000007726 management method Methods 0.000 title claims abstract description 14
- 238000004458 analytical method Methods 0.000 claims abstract description 28
- 230000000977 initiatory effect Effects 0.000 claims abstract description 10
- 230000006870 function Effects 0.000 claims description 15
- 238000000034 method Methods 0.000 claims description 12
- 238000012360 testing method Methods 0.000 claims description 10
- 230000000007 visual effect Effects 0.000 claims description 8
- 238000003860 storage Methods 0.000 claims description 6
- 238000012795 verification Methods 0.000 claims description 4
- 238000012800 visualization Methods 0.000 claims description 2
- 238000007689 inspection Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000000926 separation method Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/73—Program documentation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Library & Information Science (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the technical field of computers, and discloses an API (application program interface) development management method and system based on an API document, which comprises the following steps: the gateway system receives an API document compiled by a user and judges whether the API document meets the compiling standard, if so, the gateway system analyzes the API document and stores the analysis result of the API document and issues the API document to the issuing end, and if not, the gateway system marks the API document as an invalid document; after receiving the API interface development result of the development end, the gateway system checks the API interface development result according to the analysis result of the stored API document, and if the API interface development result is qualified, the gateway system issues a corresponding API interface; if not, sending prompt information to the initiating terminal. The invention realizes the automatic deployment of the API interface by the way of managing the API document, checking the API development result and issuing the API development result through the gateway system, and reduces the difficulty of software project development.
Description
Technical Field
The invention relates to the technical field of computers, in particular to an API (application programming interface) interface development management method and system based on an API document.
Background
With the development of web technologies, front-end separation becomes a way for more and more internet companies to build applications. The advantage of front-end and back-end separation is that a set of API can be reused by a plurality of clients, division of labor and cooperation are refined, coding efficiency is greatly improved, but due to the fact that the front end and the back end are separated, the development result of the back end is often unreliable, interface requirements of the front end are easily omitted or some wrong API interfaces are easily given to the front end, the errors can be found only after the front end user uses the development result of the back end, and validity check is lacked. And because the API is some predefined functions, once the requirements of the front-end user change, the back-end user cannot know the updating of the front-end requirements in time, and the back-end user can not continuously modify and rework the back-end development, so that the error rate of the corresponding software interface development process is high and the efficiency is low. Therefore, in order to further improve the efficiency of developing software projects, an effective API interface development management method and system for API documents are urgently needed to solve the problems of unreliable API interface development results and untimely document updating.
Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides an API (application programming interface) interface development management method and system based on an API document.
In order to achieve the purpose, the invention provides the following technical scheme:
an API interface development management method based on API documents comprises the following steps:
the gateway system receives an API document compiled by a user and judges whether the API document meets the compiling standard, if so, the gateway system analyzes the API document and stores the analysis result of the API document and issues the API document to the issuing end, and if not, the gateway system marks the API document as an invalid document;
after receiving the API interface development result of the development end, the gateway system checks the API interface development result according to the analysis result of the stored API document, and if the API interface development result is qualified, the gateway system issues a corresponding API interface; if not, sending prompt information to the initiating terminal.
Preferably, the API document is written in an OpenAPI standard, and each module of the API document is stored in an yml document.
Preferably, the API document is compiled into Swagger Editor-based Web visual content by using a Gitlab Runner and is issued to the initiating terminal.
Preferably, when the user updates the API document written by the user and the API document updated by the user meets the writing standard, the Web visual content is updated in real time.
Preferably, the parsing result of the API document at least includes a plurality of API interface types, interface functions, and interface access rights requested by the user.
Preferably, the verifying the API interface development result according to the parsing result of the API document includes:
601, the gateway system judges whether the API interface development result covers all API interface types requested by the user, if yes, the step 602 is entered; if not, namely the API interface type is missed, sending prompt information of the interface type error to the development end;
step 602, the gateway system judges whether the API interface development result has an API interface type not requested by the user, if yes, the API interface development result is marked as an invalid API interface, and the invalid API interface is deleted; if not, go to step 603;
step 603, performing interface function test on the API interface development result through the Swagger Editor, testing whether the API interface development result can realize the interface function requested by the user, if so, determining that the API interface development result is an effective API interface development result, and the gateway system performing permission setting on the API interface development result according to the interface access permission requested by the user and issuing a corresponding API interface; if not, sending prompt information of interface function error to the development end.
In a further embodiment of the present invention, there is also provided a gateway system, including:
the judging module is used for receiving and judging whether the API document compiled by the user meets the compiling standard or not, and if yes, the API document is sent to the analyzing module and the issuing module; if not, marking as an invalid document;
the publishing module is used for receiving the API document and publishing the API document to the development end;
the analysis module is used for receiving the API document, analyzing the API document and storing an analysis result of the API document;
the verification module is used for receiving the development result of the API interface of the development end and reading the analysis result of the API document stored in the analysis module to check the development result of the API interface; if the test is qualified, issuing a corresponding API interface; if not, sending prompt information to the initiating terminal.
In a further embodiment of the present invention, there is also provided a readable storage medium on which one or more programs are stored, wherein the one or more programs, when executed by one or more processors, implement the API interface development management method based on API documents described above.
In summary, compared with the prior art, the invention has the beneficial effects that:
the invention adopts the gateway system to receive the API document written by the front-end user, store the analysis result of the API document and issue the API document to the back-end development end in real time, so that the back-end development end can develop according to the API document, check the development result of the back-end API interface according to the stored analysis result of the API document, if the development result of the API interface does not meet the request of the front-end user, send the corresponding prompt information to the initiating end, therefore, under the management standard check of the gateway system, the API interface development result can be issued only when the development result of the API interface meets the request of the front end, otherwise, the back end is prompted to make the corresponding revision, so as to reduce the rework, the error work and the error reporting rate. Furthermore, the gateway system of the invention can perform web visualization on the API document written by the user, so that the development end can perform efficient development according to the visualized content, and update the web visualized content in real time when the user updates the API document, so that the back-end development end can know the requirements of the user in real time, and the development efficiency and accuracy are effectively improved. The invention realizes the automatic deployment of the API interface by managing the API documents and the API development results, and reduces the difficulty of software project development.
Description of the drawings:
FIG. 1 is a schematic flow diagram of the process of the present invention;
fig. 2 is a schematic structural diagram of the gateway system of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments. It should be understood that the scope of the above-described subject matter is not limited to the following examples, and any techniques implemented based on the disclosure of the present invention are within the scope of the present invention.
As shown in FIG. 1, the management method based on API document of the present invention includes:
the gateway system receives and analyzes an API document written by a user and stores the analysis result of the API document;
the gateway system issues the API document to the development end, after receiving the development result of the API interface of the development end, the gateway system checks the development result of the API interface according to the analysis result of the stored API document, and if the result is qualified, the gateway system issues the corresponding API interface; if not, sending prompt information to the initiating terminal.
Specifically, when receiving an API document written by a user, the gateway system determines whether the API document written by the user meets a writing standard, where the writing standard of the API document is an OpenAPI standard, and stores each module of the API document in an yml document. If yes, analyzing the API document written by the user and storing the analysis result of the API document, otherwise, the gateway system cannot analyze the document, and marking the document as an invalid document. Therefore, the API document which is not written or updated according to the writing standard can not be identified and analyzed by the gateway system, namely, the invention realizes the automatic filing and storage of the API interface requirement by managing the API document, thereby reducing the difficulty of software project development. In addition, when the method is implemented, no matter any requirement exists in the software project development process, the API interface requirement of the user can be issued only after the API document is edited and is subjected to standard verification, analysis and storage in sequence, and then the API interface requirement becomes effective.
The analysis result of the API document comprises data such as a module name requested by a user, a plurality of API interface names, a UPI, a description type, an interface function, an interface access authority and the like. And the gateway system can adopt the Gitlab Runner to compile the API document into Web visual content based on the Swagger Editor and release the Web visual content to the development end, and the development end can develop according to the visual content in time without searching the document content at any time, thereby greatly improving the development efficiency. In actual operation, the API development requirements of users may change, users can update the API documents compiled by the users, and after the API documents updated by the users are verified through the compiling standards of the gateway system and are analyzed and stored, the gateway system can update the Web visual contents presented to the back end in real time, so that the back end can obtain the updates of the front end requirements in real time, update in time, avoid errors, and effectively improve the development efficiency and accuracy.
Further, the back end sends the development result of the API interface to the gateway system after completing the development result of the API interface according to the web visual content presented by the gateway system, the gateway system checks the development result according to the analysis result of the API document, the development result which is qualified through the gateway system check can be effective, and the corresponding API interface can be issued. The inspection process comprises three steps of inspection, and specifically comprises the following steps:
the gateway system firstly judges whether the API interface development result provided by the back end covers all API interface types requested by the user, if not, the missing API interface types exist; a prompt message of the wrong interface type is sent to the development terminal. If yes, judging whether the API interface development result has an API interface type which is not requested by a user; if so, marking the API interface as an invalid API interface, and deleting the invalid API interface. If not, the type of the API interface is consistent with the front end requirement, and then the function test of the API interface is carried out. The gateway system tests the interface function of the API interface development result through the SwaggerEditor, tests whether the interface function requested by the user can be realized, if so, the result is an effective API interface development result, and the gateway system sets the authority (private, public or authority grouping) for the API interface development result (software programming) according to the interface access authority requested by the user in the analysis result and issues a corresponding API interface; if not, sending prompt information of interface function error to the development end.
For example, in the analysis result stored in the gateway system, the interface types of the front end requirement comprise three types of RPC (remote procedure call), SQ L (standard language query) and information delivery, while the development result given by the back end comprises RPC, SQ L and SQ LDocument Transmission ofIf the gateway system finds that the information delivery is omitted in the development result in the first step of inspection, the gateway system sends prompt information of wrong interface types to the back end, and software programming related to the delivery of the back end supplementary information is carried out, at the moment, RPC, SQ L and the like exist in the result of the back end supplementary software programming,File transferAnd information delivery, there are API interface types not requested by the userDocument Transmission of) If the software operation error is reported, the gateway system sends prompt information of the interface function error to an initiating terminal (which sends a corresponding interface if the error is reported), so under the management specification inspection of the gateway system, the gateway system is endowed with authority setting and issued only when the development result of the API interface meets the front end request, otherwise, the gateway system prompts the rear end to carry out corresponding revision so as to reduce the rework, error work and error reporting rate.
As shown in fig. 2, the gateway system provided in the present invention includes:
the judging module is used for receiving and judging whether the API document compiled by the user meets the compiling standard or not, and if yes, the API document is sent to the analyzing module and the issuing module; if not, marking as an invalid document;
the publishing module is used for receiving the API document and publishing the API document to the development end;
the analysis module is used for receiving the API document, analyzing the API document and storing an analysis result of the API document;
the verification module is used for receiving the development result of the API interface of the development end and reading the analysis result of the API document stored in the analysis module to check the development result of the API interface; if the test is qualified, issuing a corresponding API interface; if not, sending prompt information to the initiating terminal.
In addition, the present invention also provides a readable storage medium, such as a ROM storage device, a removable hard disk, a usb disk, or an optical disk, etc., wherein one or more programs are written into the memory and executed by one or more processors. The program in the memory thus implements the API document-based management method of the present invention when executed by the processor.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
Claims (8)
1. An API interface development management method based on API documents is characterized by comprising the following steps:
the gateway system receives an API document compiled by a user and judges whether the API document meets the compiling standard, if so, the gateway system analyzes the API document and stores the analysis result of the API document and issues the API document to the issuing end, and if not, the gateway system marks the API document as an invalid document;
after receiving the API interface development result of the development end, the gateway system checks the API interface development result according to the analysis result of the stored API document, and if the API interface development result is qualified, the gateway system issues a corresponding API interface; if not, sending prompt information to the initiating terminal.
2. The method of claim 1, wherein the API document is written in a standard of OpenAPI, and the modules of the API document are stored in an yml document.
3. A method according to claim 1, wherein the API document is compiled into swaggerer editor based Web visual content for publishing to an originating terminal using a Gitlab Runner.
4. The method of claim 3, wherein the Web visualization is updated in real-time when a user updates their authored API document and the user-updated API document complies with the authoring criteria.
5. The method of claim 1, wherein the parsing result of the API document includes at least a plurality of API interface types, interface functions, and interface access rights requested by a user.
6. The method of claim 5, wherein verifying the API interface development result based on the parsed result of the API document comprises:
601, the gateway system judges whether the API interface development result covers all API interface types requested by the user, if yes, the step 602 is entered; if not, namely the API interface type is missed, sending prompt information of the interface type error to the development end;
step 602, the gateway system judges whether the API interface development result has an API interface type not requested by the user, if yes, the API interface development result is marked as an invalid API interface, and the invalid API interface is deleted; if not, go to step 603;
step 603, performing interface function test on the API interface development result through the Swagger Editor, testing whether the API interface development result can realize the interface function requested by the user, if so, determining that the API interface development result is an effective API interface development result, and the gateway system performing permission setting on the API interface development result according to the interface access permission requested by the user and issuing a corresponding API interface; if not, sending prompt information of interface function error to the development end.
7. A gateway system, comprising:
the judging module is used for receiving and judging whether the API document compiled by the user meets the compiling standard or not, and if yes, the API document is sent to the analyzing module and the issuing module; if not, marking as an invalid document;
the publishing module is used for receiving the API document and publishing the API document to the development end;
the analysis module is used for receiving the API document, analyzing the API document and storing an analysis result of the API document;
the verification module is used for receiving the development result of the API interface of the development end and reading the analysis result of the API document stored in the analysis module to check the development result of the API interface; if the test is qualified, issuing a corresponding API interface; if not, sending prompt information to the initiating terminal.
8. A readable storage medium on which one or more programs are stored, the one or more programs, when executed by one or more processors, implementing the API document based API interface development management method of any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010188636.9A CN111399825A (en) | 2020-03-17 | 2020-03-17 | API (application programming interface) development management method and system based on API document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010188636.9A CN111399825A (en) | 2020-03-17 | 2020-03-17 | API (application programming interface) development management method and system based on API document |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111399825A true CN111399825A (en) | 2020-07-10 |
Family
ID=71430902
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010188636.9A Pending CN111399825A (en) | 2020-03-17 | 2020-03-17 | API (application programming interface) development management method and system based on API document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111399825A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113515263A (en) * | 2021-04-26 | 2021-10-19 | 中国汽车技术研究中心有限公司 | Industrial APP mechanism model deployment method, device, equipment and readable storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976188A (en) * | 2010-05-26 | 2011-02-16 | 天津大学 | OpenApi data automatic loading system oriented to AJAX protocol |
CN102707958A (en) * | 2012-06-08 | 2012-10-03 | 奇智软件(北京)有限公司 | Open-platform-based interface generation checking method and equipment |
CN107329748A (en) * | 2017-06-23 | 2017-11-07 | 福建中金在线信息科技有限公司 | API development managements method and system and server and computer-readable recording medium |
CN107967143A (en) * | 2017-12-14 | 2018-04-27 | 泰康保险集团股份有限公司 | Obtain the methods, devices and systems of the update instruction information of client application source code |
CN108959076A (en) * | 2018-06-25 | 2018-12-07 | 浙江网新恒天软件有限公司 | A kind of API on-line debugging method |
CN109298861A (en) * | 2018-10-19 | 2019-02-01 | 中国银行股份有限公司 | A kind of method and device automatically generating file according to interface document |
CN110244940A (en) * | 2019-06-12 | 2019-09-17 | 四川长虹电器股份有限公司 | Optimize the method and web front-end project structure of web application system development |
CN110489336A (en) * | 2019-07-26 | 2019-11-22 | 广东睿江云计算股份有限公司 | A kind of software interface Test cases technology and maintaining method and its device |
CN110489326A (en) * | 2019-07-09 | 2019-11-22 | 北京字节跳动网络技术有限公司 | HTTPAPI adjustment method device, medium and equipment based on IDS |
-
2020
- 2020-03-17 CN CN202010188636.9A patent/CN111399825A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101976188A (en) * | 2010-05-26 | 2011-02-16 | 天津大学 | OpenApi data automatic loading system oriented to AJAX protocol |
CN102707958A (en) * | 2012-06-08 | 2012-10-03 | 奇智软件(北京)有限公司 | Open-platform-based interface generation checking method and equipment |
CN107329748A (en) * | 2017-06-23 | 2017-11-07 | 福建中金在线信息科技有限公司 | API development managements method and system and server and computer-readable recording medium |
CN107967143A (en) * | 2017-12-14 | 2018-04-27 | 泰康保险集团股份有限公司 | Obtain the methods, devices and systems of the update instruction information of client application source code |
CN108959076A (en) * | 2018-06-25 | 2018-12-07 | 浙江网新恒天软件有限公司 | A kind of API on-line debugging method |
CN109298861A (en) * | 2018-10-19 | 2019-02-01 | 中国银行股份有限公司 | A kind of method and device automatically generating file according to interface document |
CN110244940A (en) * | 2019-06-12 | 2019-09-17 | 四川长虹电器股份有限公司 | Optimize the method and web front-end project structure of web application system development |
CN110489326A (en) * | 2019-07-09 | 2019-11-22 | 北京字节跳动网络技术有限公司 | HTTPAPI adjustment method device, medium and equipment based on IDS |
CN110489336A (en) * | 2019-07-26 | 2019-11-22 | 广东睿江云计算股份有限公司 | A kind of software interface Test cases technology and maintaining method and its device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113515263A (en) * | 2021-04-26 | 2021-10-19 | 中国汽车技术研究中心有限公司 | Industrial APP mechanism model deployment method, device, equipment and readable storage medium |
CN113515263B (en) * | 2021-04-26 | 2022-06-17 | 中国汽车技术研究中心有限公司 | Industrial APP mechanism model deployment method, device, equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR101755365B1 (en) | Managing record format information | |
US20080148143A1 (en) | System and method for generating electronic patent application files | |
CN108628748B (en) | Automatic test management method and automatic test management system | |
US8713368B2 (en) | Methods for testing OData services | |
CN111813804B (en) | Data query method and device, electronic equipment and storage medium | |
CN112231407B (en) | DDL synchronization method, device, equipment and medium of PostgreSQL database | |
CN112698868B (en) | Unified error code method applied to multiple systems and storage device | |
CN108876283A (en) | A kind of automatic auditing system and method | |
CN103150647A (en) | Report file processing method, server and system | |
CN105138454A (en) | Automated measurement method for security software of B/S framework | |
CN107133079B (en) | Automatic generation method of software semantic abstract based on problem report | |
CN111190807A (en) | Buried point testing method and device | |
CN105871819A (en) | Transmission control method and device | |
CN114185791A (en) | Method, device and equipment for testing data mapping file and storage medium | |
CN111399825A (en) | API (application programming interface) development management method and system based on API document | |
CN114116691A (en) | Data import checking method, system, device and computer readable medium | |
CN110688823A (en) | XML file verification method and device | |
CN107491530B (en) | Social relationship mining analysis method based on file automatic marking information | |
CN107797917B (en) | Performance test script generation method and device | |
CN115543832A (en) | Software code standard detection method, system, equipment and storage medium | |
CN111639478B (en) | Automatic data auditing method and system based on EXCEL document | |
CN111143450B (en) | Method and device for importing data | |
CN114817990A (en) | Sensitive data management method and device, electronic equipment and storage medium | |
CN113672512A (en) | Code inspection rule generating method, code inspection method, device and medium | |
CN108647018A (en) | Can live preview code generating system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200710 |
|
RJ01 | Rejection of invention patent application after publication |