CN113741893A - JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system - Google Patents
JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system Download PDFInfo
- Publication number
- CN113741893A CN113741893A CN202110883145.0A CN202110883145A CN113741893A CN 113741893 A CN113741893 A CN 113741893A CN 202110883145 A CN202110883145 A CN 202110883145A CN 113741893 A CN113741893 A CN 113741893A
- Authority
- CN
- China
- Prior art keywords
- json
- interface document
- interface
- data
- document
- 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.)
- Withdrawn
Links
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/38—Creation or generation of source code for implementing user interfaces
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to a JSON analysis-based open platform interface document automatic generation method and a system, wherein the method comprises the following steps: step A: the JSON source data system generates JSON data of an interface document; and B: the JSON analysis engine analyzes JSON data of the interface document and generates final data of the interface document; and C: the interface document management system checks the integrity and the legality of the final data of the interface document, and if the check is passed, the step D is executed; step D: the interface document management system stores the interface document final data that passes the verification. The invention has the advantages that: the invention realizes the automatic generation of the interface document based on the JSON analysis mode, so that the automatic generation technology of the interface document is more universal. The method and the device have the advantages that the generated final data of the interface document is stored persistently, the document is ensured not to be lost easily, and the guarantee is provided for software development. The automatic generation technology of the interface document provided by the invention reduces manual intervention, improves the accuracy of the interface document and improves the efficiency of software development.
Description
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a JSON (Java Server pages open platform) analysis-based open platform interface document automatic generation technology.
Background
With the continuous development of the internet, in the current internet era, the technical openness of packaging a series of services as data interfaces is opened and becomes a future strategy of each large internet company, internet factories open their own technologies for third-party developers to use, the third-party developers develop various rich and colorful applications based on the open interface capabilities, the third-party developers need to provide corresponding interface documents to know the developers to call when calling the interfaces, and then, a large amount of human resources are consumed for writing and maintaining the interface documents.
Chinese patent publication No. CN110244945A discloses a technique entitled "interface document generation method and terminal device", which does not involve parsing an interface document and generating interface document final data.
Chinese patent publication No. CN110806863A discloses a technique entitled "an interface document generation method and apparatus, electronic device, and storage medium", which generates an interface document based on Swagger and program code techniques, and which depends on program codes and is poor in versatility.
Disclosure of Invention
The invention aims to provide a JSON (Java Server pages open platform) analysis-based method and a JSON analysis-based system for automatically generating an open platform interface document, which solve the technical problems that: there is no general automatic generation technology of interface documents.
In order to solve the technical problems, the invention adopts the following technical scheme: a JSON analysis-based open platform interface document automatic generation method comprises the following steps:
step A: the JSON source data system generates JSON data of an interface document;
and B: the JSON analysis engine analyzes the JSON data of the interface document and generates final data of the interface document;
and C: the interface document management system checks the integrity and the legality of the final data of the interface document, and if the check is passed, the step D is executed;
step D: the interface document management system stores the verified interface document final data.
Preferably, in the step a, the interface document JSON data includes an interface name, an interface classification, an interface basic path, an interface request method, an interface request parameter, return data, a tag, and a state; the interface request method comprises GET and POST; the status includes completed and not completed.
Preferably, when the interface request method is GET, the interface request parameter is Query parameter; and when the interface request method is POST, the interface request parameter is Body parameter.
Preferably, the JSON source data system transmits the JSON data of the interface document to the JSON parsing engine in an API manner.
Preferably, in the step B, the JSON parsing engine checks whether the JSON data of the interface document is normal and complete, and when the JSON data of the interface document passes the check, the JSON parsing engine parses each field of the JSON data of the interface document according to the request header parameter, the request parameter, and the response parameter.
Preferably, the parameter attributes obtained after the JSON data of the interface document is parsed by the JSON parsing engine include type, whether to fill, description, and example values.
Preferably, in the step D, the interface document management system presents the interface document final data in the form of a front end H5 page.
The invention also provides a JSON analysis-based open platform interface document automatic generation system, which comprises:
the JSON source data system is used for providing interface document JSON data which conforms to the specification;
the JSON analysis engine is used for analyzing the JSON data of the interface document and generating final data of the interface document;
and the interface document management system is used for storing the final data of the interface document.
By adopting the technical scheme, the beneficial technical effects of the invention are as follows: JSON is a light-weight data exchange format, easy to read and write by people, and easy to analyze and generate by a machine, JSON adopts a text format completely independent of languages, also uses habits similar to a C language family, supports multiple languages, including ActionScript, C #, ColdFusion, Java, JavaScript, Perl, PHP, Python, Ruby and other language server-side languages, and is convenient for analyzing the server side. The method and the device have the advantages that the generated final data of the interface document is stored persistently, the document is ensured not to be lost easily, and the guarantee is provided for software development. The automatic generation technology of the interface document provided by the invention reduces manual intervention, improves the accuracy of the interface document and improves the efficiency of software development.
Drawings
FIG. 1 is an overall architecture diagram of the present invention;
FIG. 2 is an overall flow chart of the present invention;
FIG. 3 is a management interface for a zone and a fence;
FIG. 4 is a new add/edit zone interface;
FIG. 5 is a new fence interface;
FIG. 6 is a diagram illustrating a request header parameter, a request parameter and a response parameter according to the present invention.
Detailed Description
The invention will be further explained with reference to the drawings.
As shown in FIG. 1 and FIG. 2, the present invention provides a JSON parsing-based open platform interface document automatic generation method, firstly, JSON source data system must be used to generate interface document JSON data, the interface document JSON data includes interface name, interface classification, interface basic path, interface request method, interface request parameter, return data, tag and state, the interface request method includes GET and POST, and the state includes completed and incomplete. When the request method is GET, the interface request parameter is Query parameter, and when the interface request method is POST, the interface request parameter is Body parameter. As shown in fig. 3, 4 and 5, the generation of the JSON data in the interface document is that a developer can generate JSON data in the interface document by option operation at the front end of the JSON source data system, basic information such as an interface name, an interface classification, an interface basic path and the like is written in the front end interface of the JSON source data system, and an interface request method such as GET, POST and the like is further edited at the interface basic path. Other details of the interface may be edited under a particular page.
The written content can still be edited again under a specific page, and the 'tag' and the 'state' can be edited, the 'tag' can be set as the 'tag', and the 'state' can be selected as 'completed' or 'not completed', so that whether the interface is developed or not is indicated. After the content is edited again, the interface request parameters and the return data can be edited on the page, wherein the editing interface of the request parameters can be changed according to different interface request methods, and parameters in Query can be edited if the request mode is GET; when the request mode is POST, the parameters in Body can be edited, after the editing of the request parameters is completed, the returned data is edited, and the editing is performed according to the concrete actual correspondence of the interface.
The method comprises the steps that after a developer completes writing of the contents of an interface document in a JSON source data system, interface document JSON data are generated, the JSON source data system converts the interface document JSON data into the interface document JSON data, the JSON source data system sends the interface document JSON data to a JSON analysis engine in an API mode, the JSON analysis engine analyzes the interface document JSON data, whether the interface document JSON data meet JSON specifications or not is firstly checked, each field in the interface document JSON data is verified, and whether the interface document JSON data are completed or not is checked. After the JSON data of the interface document passes the verification, the JSON analysis engine respectively analyzes each field in the JSON data of the interface document according to three plates of a request header parameter, a request parameter and a corresponding parameter, and analyzes the type, the filling, the description, the example value and other attributes of each parameter in a JSON analysis mode to finally generate the final data of the interface document.
The interface document management system checks the integrity and the legality of the final data of the interface document, and if the check is passed, the interface document management system stores the final data of the interface document passing the check and displays the final data of the interface document in a front-end H5 page form.
Claims (8)
1. A JSON analysis-based open platform interface document automatic generation method is characterized by comprising the following steps:
step A: the JSON source data system generates JSON data of an interface document;
and B: the JSON analysis engine analyzes the JSON data of the interface document and generates final data of the interface document;
and C: the interface document management system checks the integrity and the legality of the final data of the interface document, and if the check is passed, the step D is executed;
step D: the interface document management system stores the verified interface document final data.
2. The method for automatically generating an open platform interface document based on JSON (java server object notation) parsing of claim 1, wherein in the step A, JSON data of the interface document comprises an interface name, an interface classification, an interface basic path, an interface request method, an interface request parameter, return data, tag and a state; the interface request method comprises GET and POST; the status includes completed and not completed.
3. The JSON-parsing-based open platform interface document automatic generation method according to claim 2, wherein when the interface request method is GET, the interface request parameter is Query parameter; and when the interface request method is POST, the interface request parameter is Body parameter.
4. The method for automatically generating an open platform interface document based on JSON parsing of claim 1, wherein the JSON source data system transmits JSON data of the interface document to the JSON parsing engine in an API manner.
5. The method for automatically generating an open platform interface document based on JSON parsing of claim 1, wherein in the step B, the JSON parsing engine checks whether the JSON data of the interface document is normal and complete, and when the JSON data of the interface document passes the check, the JSON parsing engine parses each field of the JSON data of the interface document according to a request header parameter, a request parameter and a response parameter.
6. The method for automatically generating the open platform interface document based on the JSON parsing of claim 5, wherein the parameter attributes obtained after the JSON data of the interface document is parsed by the JSON parsing engine include type, whether to fill in, description and example values.
7. The method for automatically generating an open platform interface document based on JSON parsing as claimed in claim 1, wherein in the step D, the interface document management system exposes the final data of the interface document in a front end H5 page form.
8. A JSON analysis-based open platform interface document automatic generation system is characterized by comprising:
the JSON source data system is used for providing interface document JSON data which conforms to the specification;
the JSON analysis engine is used for analyzing the JSON data of the interface document and generating final data of the interface document;
and the interface document management system is used for storing the final data of the interface document.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110883145.0A CN113741893A (en) | 2021-08-02 | 2021-08-02 | JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110883145.0A CN113741893A (en) | 2021-08-02 | 2021-08-02 | JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113741893A true CN113741893A (en) | 2021-12-03 |
Family
ID=78729783
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110883145.0A Withdrawn CN113741893A (en) | 2021-08-02 | 2021-08-02 | JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113741893A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473045A (en) * | 2013-08-27 | 2013-12-25 | 广州华多网络科技有限公司 | Method and device for generating interface documents |
CN107766040A (en) * | 2017-09-19 | 2018-03-06 | 深圳市买买提乐购金融服务有限公司 | A kind of method, apparatus and computer-readable recording medium for generating interface document |
CN110738036A (en) * | 2019-10-15 | 2020-01-31 | 北京百度网讯科技有限公司 | Method and apparatus for generating information |
CN111694561A (en) * | 2020-06-10 | 2020-09-22 | 中国建设银行股份有限公司 | Interface management method, device, equipment and storage medium |
-
2021
- 2021-08-02 CN CN202110883145.0A patent/CN113741893A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103473045A (en) * | 2013-08-27 | 2013-12-25 | 广州华多网络科技有限公司 | Method and device for generating interface documents |
CN107766040A (en) * | 2017-09-19 | 2018-03-06 | 深圳市买买提乐购金融服务有限公司 | A kind of method, apparatus and computer-readable recording medium for generating interface document |
CN110738036A (en) * | 2019-10-15 | 2020-01-31 | 北京百度网讯科技有限公司 | Method and apparatus for generating information |
CN111694561A (en) * | 2020-06-10 | 2020-09-22 | 中国建设银行股份有限公司 | Interface management method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Konrad et al. | Facilitating the construction of specification pattern-based properties | |
US20010037490A1 (en) | Web application generator | |
US20020103835A1 (en) | Methods and apparatus for constructing semantic models for document authoring | |
CN106897251B (en) | Rich text display method and device | |
CN113312108B (en) | SWIFT message verification method and device, electronic equipment and storage medium | |
CN103914438A (en) | Template and tag implementation based excel display and export method and system | |
WO2005067418A2 (en) | Automatic object generation and user interface transformation | |
CN112650533A (en) | Interface document generation method and device and terminal equipment | |
CN110941950A (en) | Interface document generation method, device, server and storage medium | |
CN109783752A (en) | Page loading method and device, electronic equipment and computer readable storage medium | |
CN109445775A (en) | One key activity inline code method, apparatus and computer readable storage medium | |
CN114138244A (en) | Method and device for automatically generating model files, storage medium and electronic equipment | |
WO2011008862A2 (en) | Markup language-based authoring and runtime environment for interactive content platform | |
CN106776779B (en) | Method for generating entity file by JSON data based on Mac platform | |
JP2007034571A (en) | Document processing program and document processing method | |
US20090157725A1 (en) | System and method for expressing xml schema validation using java in a declarative manner | |
CN111339745A (en) | Follow-up report generation method, device, electronic device and storage medium | |
CN109358845A (en) | Method, tool and the storage medium of JS code are write based on XMPP protocol | |
CN113741893A (en) | JSON (Java Server object notation) -analysis-based open platform interface document automatic generation method and system | |
JP7064680B1 (en) | Program code automatic generation system | |
CN114546937B (en) | Intelligent document editing management system, method, equipment and storage medium | |
CN110321129A (en) | Business based on developing instrument executes method, apparatus and computer equipment | |
CN114996427A (en) | Message display method, device, equipment and storage medium based on intelligent question answering | |
CN111882419B (en) | Method and device for quality inspection of files and server | |
CN115116069A (en) | Text processing method and device, electronic equipment and storage medium |
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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20211203 |
|
WW01 | Invention patent application withdrawn after publication |