CN117370242A - Adapter and method for generating multilingual SDK client by parsing interface document - Google Patents
Adapter and method for generating multilingual SDK client by parsing interface document Download PDFInfo
- Publication number
- CN117370242A CN117370242A CN202311306780.8A CN202311306780A CN117370242A CN 117370242 A CN117370242 A CN 117370242A CN 202311306780 A CN202311306780 A CN 202311306780A CN 117370242 A CN117370242 A CN 117370242A
- Authority
- CN
- China
- Prior art keywords
- interface
- sdk
- data
- generator
- parser
- 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
- 238000000034 method Methods 0.000 title claims abstract description 29
- 238000013499 data model Methods 0.000 claims abstract description 50
- 238000011161 development Methods 0.000 claims abstract description 27
- 230000008569 process Effects 0.000 claims abstract description 14
- 238000012360 testing method Methods 0.000 claims description 24
- 230000006978 adaptation Effects 0.000 claims description 12
- 230000006870 function Effects 0.000 claims description 11
- 238000003058 natural language processing Methods 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 5
- 238000013473 artificial intelligence Methods 0.000 claims description 4
- 239000008186 active pharmaceutical agent Substances 0.000 description 14
- 238000005516 engineering process Methods 0.000 description 5
- 238000012423 maintenance Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000001747 exhibiting effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000003032 molecular docking Methods 0.000 description 1
- 239000010979 ruby Substances 0.000 description 1
- 229910001750 ruby Inorganic materials 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/253—Grammatical analysis; Style critique
Abstract
The invention discloses an adapter and a method for generating a multilingual SDK client by analyzing an interface document, which can generate the SDK only by the interface document, support multiple development languages and solve the problem of non-uniform interface formats in enterprises. The technical proposal is as follows: the adapter comprises a parser and a generator, wherein the parser is configured to parse the interface document into an SDK-DATA DATA model, and the SDK-DATA DATA model is an abstract DATA model based on an interface HTTP request protocol; the generator is configured to process the SDK-DATA DATA model into SDK source code and interface DEMO and automatically upload the Git repository.
Description
Technical Field
The invention relates to a technology for rapid delivery of items SDK (Software Development Kit) and rapid docking of services, in particular to an adapter and a method for generating a multilingual SDK client by analyzing an interface document.
Background
Swagger Codegen is an open source tool that automatically generates API client libraries, server stubs, documents, and other related code according to the Swagger specification (now known as the OpenAPI specification). The Swagger specification is a standard format for describing RESTful APIs that defines the endpoints, parameters, request and response formats, etc. of the API so that the developer can more easily understand and use the API.
The following are the main functions and uses of Swagger Codegen:
automatically generating a client library: swagger Codegen can generate client libraries of multiple programming languages according to the Swagger specification, and the libraries can help a developer to easily interact with the API without manually writing HTTP requests and parsing responses;
automatically generating a server stub: besides the client library, the Swagger Codegen can also generate server stub codes for creating an API server conforming to the Swagger specification, which is helpful for accelerating the development process of the API and reducing the workload of manually writing routing, request processing and response processing codes;
automatically generating a document: swagger Codegen can generate API documents, including interactive API documents and static documents, which help developers and API users understand the function and usage of the API;
multilingual support: swagger Codegen supports multiple programming languages, including Java, python, javaScript, ruby, go, etc., and thus can meet the requirements of different technology stacks;
and (5) customizing a template: the developer can use the custom template to generate code meeting the requirements of the project, which makes Swagger Codegen very flexible;
community support: swagger Codegen has active community support, and can acquire rich plug-ins and templates to meet the requirements of various projects.
In summary, swagger Codegen is a tool that helps to simplify API development and maintenance, automatically generates code using the Swagger (OpenAPI) specification, reduces the effort to manually write a large number of repeated codes, improves development efficiency, and ensures consistency and maintainability of APIs. If there is an API definition of the Swagger specification, the use of Swagger Codegen to generate relevant code and documents may be considered.
In the process of using the Swagger Codegen tool, the tool needs to be introduced into items, and the request mode, the request parameters and the like of the interface are described on each interface in a specific annotation mode, and the tool acquires interface contents by scanning the annotations to form a standard object model and then generates the SDK of the interface.
As can be seen from the above implementation, the Swagger Codegen tool generates the SDK of the interface suffers from the following problems: the tool has strong invasiveness to codes, more importantly, the interface annotation needs to be manually maintained, and the phenomenon that the interface or field meaning description is inconsistent with the product interface document meaning is often encountered, and each time of adjustment and modification needs to be carried out, so that the complexity is increased and the maintenance is complicated.
Disclosure of Invention
The following presents a simplified summary of one or more aspects in order to provide a basic understanding of such aspects. This summary is not an extensive overview of all contemplated aspects, and is intended to neither identify key or critical elements of all aspects nor delineate the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed description that is presented later.
The invention aims to solve the problems, and provides an adapter and a method for generating a multi-language SDK client by analyzing an interface document, which can generate the SDK by only analyzing the interface document, support multiple development languages, solve the problems of non-uniform interface formats and great maintenance difficulty in enterprises, and can be built into a uniform test platform.
The technical scheme of the invention is as follows: the invention discloses an adapter for generating a multilingual SDK client by parsing an interface document, wherein the adapter comprises a parser and a generator, and the adapter comprises:
the parser is configured to parse the interface document into an SDK-DATA DATA model, wherein the SDK-DATA DATA model is an abstract DATA model based on an interface HTTP request protocol;
the generator is configured to process the SDK-DATA DATA model into SDK source code and interface DEMO and automatically upload the Git repository.
According to an embodiment of the invention, the SDK-DATA comprises an interface request URL, an interface request mode, an interface request parameter object and an interface signing and signing rule, wherein the interface request parameter object comprises parameter attributes, description, types and lengths.
According to an embodiment of the adapter for generating the multilingual SDK client by parsing the interface document, the interface DEMO is an example for demonstrating or exhibiting a specific interface function or function, and after the generator deploys a unified test platform, the test case is provided for unified SDK test on the test platform.
According to one embodiment of the adapter for generating the multilingual SDK client by analyzing the interface document, SDK source codes generated by the generator are directly packed into JAR format for access party project reference; the interface DEMO is directly executed and used for interface test, and can be used by an access party as an access reference, and parameters are modified into actual parameters after direct copying.
According to an embodiment of the invention, the parser is further configured to:
the parser parses the interface documents of different types to obtain the content of the interface documents;
the parser analyzes the lexical and grammatical contents of the interface document, and extracts the interface information from the interface document;
the parser directly converts the DATA that has been extracted after the analysis into an SDK-DATA model, and passes the SDK-DATA model to the generator.
According to the embodiment of the adapter for generating the multilingual SDK client by analyzing the interface document, in the process that the analyzer acquires the content of the interface document, the analyzer performs different processes according to whether a natural language processing model based on artificial intelligence is accessed, if the natural language processing model is accessed, the document content and a defined extraction data model are used as an access reference to acquire returned analyzed data by using the natural language processing model, and if the natural language processing model is not accessed, the document content is directly used.
According to an embodiment of the adapter for generating a multilingual SDK client by parsing an interface document, the information of the interface extracted by the parser includes an interface name, an interface URL, an interface request mode, an interface parameter, a type of parameter, and a relationship to which a containment relationship belongs.
According to an embodiment of the invention, the method further comprises generating the multi-language SDK client by parsing the interface document, the generator further configured to:
the generator performs validity check on the DATA content of the received SDK-DATA DATA model;
after verification is passed, the generator firstly acquires templates of each development language preconfigured in the project, and the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode;
the generator generates source codes of languages of all versions through a template engine by using the template objects of the development languages and the SDK-DATA objects after the difference adaptation;
the generator automatically submits the generated source codes to the Git warehouse.
The invention also discloses a method for generating the multi-language SDK client by analyzing the interface document, which is realized on the adapter, and comprises the following steps:
the parser parses the interface documents of different types to obtain the content of the interface documents;
the parser analyzes the lexical and grammatical contents of the interface document, and extracts the interface information from the interface document;
the parser directly converts the DATA which are already extracted after analysis into an SDK-DATA DATA model, and the SDK-DATA DATA model is transmitted to the generator;
the generator performs validity check on the DATA content of the received SDK-DATA DATA model;
after verification is passed, the generator firstly acquires templates of each development language preconfigured in the project, and the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode;
the generator generates source codes of languages of all versions through a template engine by using the template objects of the development languages and the SDK-DATA objects after the difference adaptation;
the generator automatically submits the generated source codes to the Git warehouse.
Compared with the prior art, the invention has the following beneficial effects: first, the invention can generate SDK only by interface file, and support various development languages, and generate interface DEMO. The SDK can be directly packaged into JAR format for access party project reference, the interface DEMO can be directly executed for interface test, and can be used for access party as access reference, and parameters can be modified into actual parameters after direct copying for use. If the SDK and the DEMO are used as the output party, the SDK and the DEMO of the project interface can be conveniently and rapidly produced, and the SDK and the DEMO are provided for the demand party after passing the test. If the interface is used as an access party, the interface is greatly convenient to dock, particularly when the interface is docked in multiple parties, the multiple party SDKs can be conveniently managed, multiple SDKs are not required to be introduced, and the interface can be developed through DEMO call test and reference DEMO.
Secondly, the invention combines the language big model GPT technology, so that the writing format of the interface document is not limited by a fixed format, and the problems of non-uniform interface format and great maintenance in enterprises are solved.
Thirdly, the unified test platform and the test cases are built, so that the multi-language SDK can be tested and executed only by using one set of test cases, and the full regression verification of the SDK interface can be completed in a minute level.
Drawings
The above features and advantages of the present invention will be better understood after reading the detailed description of embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily to scale and components having similar related features or characteristics may have the same or similar reference numerals.
FIG. 1 illustrates a core flow diagram of one embodiment of an adapter of the present invention for generating a multilingual SDK client by parsing an interface document.
FIG. 2 illustrates a main process flow diagram of two core processors in the adapter embodiment shown in FIG. 1.
FIG. 3 illustrates a flow chart of one embodiment of a method of generating a multilingual SDK client by parsing an interface document of the present invention.
Detailed Description
The invention is described in detail below with reference to the drawings and the specific embodiments. It is noted that the aspects described below in connection with the drawings and the specific embodiments are merely exemplary and should not be construed as limiting the scope of the invention in any way.
FIG. 1 illustrates the core flow of one embodiment of the present invention for generating an adapter for a multilingual SDK client by parsing an interface document. Referring to fig. 1, the adapter of the present embodiment includes a parser and a generator.
The parser is configured to parse the interface document into an SDK-DATA DATA model. The SDK-DATA DATA model is a core DATA model abstracted by the system based on an interface HTTP request protocol, and mainly comprises an interface request URL, an interface request mode, an interface request parameter object (the parameter object mainly comprises parameter attributes, description, types, lengths and the like), an interface signature adding and checking rule and the like. A complete HTTP interface request may be constructed based on the SDK-DATA model.
The generator is configured to process the SDK-DATA DATA model into SDK source code and interface DEMO and automatically upload the Git repository for saving the project's files, history and metadata to enable developers to track, manage and collaborate on project's version control. Among them, the interface DEMO is an example for demonstrating or exposing a specific interface function or functions. This is typically created to help a developer, partner or user better understand the manner and capabilities of the interface. After the generator deploys a unified test platform, the generator is used for uniformly carrying out SDK test on the test platform by the test cases.
SDK source codes generated by the generator are directly packed into JAR format for access party project reference; the interface DEMO can be directly executed for interface test, and can be used by an access party as access reference, and parameters can be directly copied and modified into actual parameters for use. If the SDK and the DEMO are used as the output party, the SDK and the DEMO of the project interface can be conveniently and rapidly produced, and the SDK and the DEMO are provided for the demand party after passing the test. If the interface is used as an access party, the interface is greatly convenient to dock, particularly when the interface is docked in multiple parties, the multiple party SDKs can be conveniently managed, multiple SDKs are not required to be introduced, and the interface can be developed through DEMO call test and reference DEMO.
FIG. 2 illustrates the main process flow of two core processors in the adapter embodiment shown in FIG. 1. Referring to figure 2 of the drawings in which,
in the parser, the parser performs input parsing on an input interface document (the interface document is not limited to an interface format or a document writing format), and the parsing process is specifically as follows.
The parser parses the interface document of different types to obtain the content of the interface document. If a GPT (generating Pre-trained Transformer) model (the GPT model is taken as an example, or other natural language processing models based on artificial intelligence) is accessed, the document content and a defined extracted data model (the defined extracted data model mainly comprises an interface name, a request URL, a request mode, a request parameter and the like) are used as the analyzed data returned by the GPT model for accessing. If the GPT model is not accessed, the document content is directly used for further lexical and grammatical analysis, and the main information of the interfaces is extracted from the interface document (the main information of the interfaces comprises interface names, interface URLs, interface request modes, interface parameters, types of the parameters, and the relationship of the relationship). The next conversion is then performed, and the parser directly converts the DATA that has been extracted after the analysis into an SDK-DATA model, which is then passed to the generator.
The following specific processes are performed inside the generator.
After the generator receives the SDK-DATA DATA model from the analyzer, the validity of the DATA content of the SDK-DATA DATA model is checked, after the DATA content passes the verification, the generator firstly obtains templates (development languages are Java, GO, PHP, C #, PYTHON and the like) of each development language preconfigured in the project, the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode (the characteristics of the development language are mainly a code format style, the case of a parameter or a hump and the like), the template object of the development language and the SDK-DATA object after the difference adaptation are generated through a template engine (e.g. a musche open source template engine), and the generated source codes of each version language are automatically submitted to a Git warehouse.
FIG. 3 illustrates a flow of one embodiment of a method of generating a multilingual SDK client by parsing an interface document of the present invention. Referring to fig. 3, the method of the present embodiment includes the following steps.
Step S1: the parser obtains the content of the interface document.
In this step, the parser performs different processing according to whether the GPT model is accessed. If a GPT (generating Pre-trained Transformer) model (the GPT model is taken as an example, or other natural language processing models based on artificial intelligence) is accessed, the document content and a defined extracted data model (the defined extracted data model mainly comprises an interface name, a request URL, a request mode, a request parameter and the like) are used as the analyzed data returned by the GPT model for accessing. If the GPT model is not accessed, the document content is directly used.
Step S2: the parser analyzes the lexical and grammatical contents of the interface document, and extracts the main information of the interface from the interface document (the main information of the interface includes interface name, interface URL, interface request mode, interface parameter, type of parameter, relationship of the relationship, etc.).
Step S3: the parser directly converts the DATA that has been extracted after the analysis into an SDK-DATA model, and passes the SDK-DATA model to the generator.
The SDK-DATA DATA model is a core DATA model abstracted by the system based on an interface HTTP request protocol, and mainly comprises an interface request URL, an interface request mode, an interface request parameter object (the parameter object mainly comprises parameter attributes, description, types, lengths and the like), an interface signature adding and checking rule and the like. A complete HTTP interface request may be constructed based on the SDK-DATA model.
Step S4: the generator performs a validity check on the DATA content of the received SDK-DATA DATA model.
Step S5: after verification is passed, the generator firstly acquires templates (development languages are Java, GO, PHP, C #, PYTHON and the like) of each development language preconfigured in the project, and the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode.
Step S6: the generator generates source codes of various languages through a template engine (such as a musche open source template engine) according to the template objects of the development languages and the SDK-DATA objects after the difference adaptation.
Step S7: the generator automatically submits the generated source codes to the Git warehouse.
While, for purposes of simplicity of explanation, the methodologies are shown and described as a series of acts, it is to be understood and appreciated that the methodologies are not limited by the order of acts, as some acts may, in accordance with one or more embodiments, occur in different orders and/or concurrently with other acts from that shown and described herein or not shown and described herein, as would be understood and appreciated by those skilled in the art.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In the alternative, the processor and the storage medium may reside as discrete components in a user terminal.
In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software as a computer program product, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a web site, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk (disk) and disc (disk) as used herein include Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk and blu-ray disc where disks (disk) usually reproduce data magnetically, while discs (disk) reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (9)
1. An adapter for generating a multilingual SDK client by parsing an interface document, the adapter comprising a parser and a generator, wherein:
the parser is configured to parse the interface document into an SDK-DATA DATA model, wherein the SDK-DATA DATA model is an abstract DATA model based on an interface HTTP request protocol;
the generator is configured to process the SDK-DATA DATA model into SDK source code and interface DEMO and automatically upload the Git repository.
2. The adapter for generating a multilingual SDK client by parsing an interface document according to claim 1, wherein the SDK-DATA contains an interface request URL, an interface request means, an interface request parameter object, and an interface signing and signing rule, wherein the interface request parameter object includes a parameter attribute, a description, a type, and a length.
3. The adapter for generating a multilingual SDK client by parsing an interface document according to claim 1, wherein the interface DEMO is an example for demonstrating or exposing a specific interface function or functions, and after the generator deploys a unified test platform, the test cases are subjected to SDK test on the test platform in a unified manner.
4. The adapter for generating a multilingual SDK client by parsing an interface document according to claim 1, wherein the SDK source code generated by the generator is directly packaged in JAR format for access party project reference; the interface DEMO is directly executed and used for interface test, and can be used by an access party as an access reference, and parameters are modified into actual parameters after direct copying.
5. The adapter for generating a multi-language SDK client by parsing an interface document according to claim 1, wherein the parser is further configured to:
the parser parses the interface documents of different types to obtain the content of the interface documents;
the parser analyzes the lexical and grammatical contents of the interface document, and extracts the interface information from the interface document;
the parser directly converts the DATA that has been extracted after the analysis into an SDK-DATA model, and passes the SDK-DATA model to the generator.
6. The adapter for generating a multilingual SDK client by parsing an interface document according to claim 5, wherein in the process of obtaining the content of the interface document by the parser, the parser performs different processes according to whether a natural language processing model based on artificial intelligence is accessed, if the natural language processing model is accessed, the document content and a defined extracted data model are used as an access reference to the natural language processing model to obtain returned analyzed data, and if the natural language processing model is not accessed, the document content is directly used.
7. The adapter for generating a multilingual SDK client by parsing an interface document according to claim 5, wherein the information of the interface extracted by the parser comprises an interface name, an interface URL, an interface request mode, an interface parameter, a type of parameter, and a relationship to which the inclusion relationship belongs.
8. The adapter for generating a multilingual SDK client by parsing an interface document as recited in claim 1, wherein the generator is further configured to:
the generator performs validity check on the DATA content of the received SDK-DATA DATA model;
after verification is passed, the generator firstly acquires templates of each development language preconfigured in the project, and the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode;
the generator generates source codes of languages of all versions through a template engine by using the template objects of the development languages and the SDK-DATA objects after the difference adaptation;
the generator automatically submits the generated source codes to the Git warehouse.
9. A method of generating a multilingual SDK client by parsing an interface document, implemented on an adapter as claimed in any one of claims 1 to 8, the method comprising:
the parser parses the interface documents of different types to obtain the content of the interface documents;
the parser analyzes the lexical and grammatical contents of the interface document, and extracts the interface information from the interface document;
the parser directly converts the DATA which are already extracted after analysis into an SDK-DATA DATA model, and the SDK-DATA DATA model is transmitted to the generator;
the generator performs validity check on the DATA content of the received SDK-DATA DATA model;
after verification is passed, the generator firstly acquires templates of each development language preconfigured in the project, and the SDK-DATA DATA model is subjected to specific difference adaptation aiming at the characteristics of each development language through a strategy mode;
the generator generates source codes of languages of all versions through a template engine by using the template objects of the development languages and the SDK-DATA objects after the difference adaptation;
the generator automatically submits the generated source codes to the Git warehouse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311306780.8A CN117370242A (en) | 2023-10-09 | 2023-10-09 | Adapter and method for generating multilingual SDK client by parsing interface document |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311306780.8A CN117370242A (en) | 2023-10-09 | 2023-10-09 | Adapter and method for generating multilingual SDK client by parsing interface document |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117370242A true CN117370242A (en) | 2024-01-09 |
Family
ID=89407010
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311306780.8A Pending CN117370242A (en) | 2023-10-09 | 2023-10-09 | Adapter and method for generating multilingual SDK client by parsing interface document |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117370242A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009033953A2 (en) * | 2007-09-14 | 2009-03-19 | Siemens Aktiengesellschaft | A method and a system for automatic extraction of requirements |
US20140244254A1 (en) * | 2013-02-25 | 2014-08-28 | Microsoft Corporation | Facilitating development of a spoken natural language interface |
CN108491199A (en) * | 2018-03-06 | 2018-09-04 | 福建天泉教育科技有限公司 | A kind of method and terminal automatically generating interface |
CN108958727A (en) * | 2018-04-13 | 2018-12-07 | 北京优帆科技有限公司 | A kind of generation method and system of API client code |
CN113778421A (en) * | 2021-09-16 | 2021-12-10 | 京东方科技集团股份有限公司 | Method and equipment for generating service code |
CN114443905A (en) * | 2022-01-27 | 2022-05-06 | 厦门雅基软件有限公司 | Interface document updating method and device, electronic equipment and readable storage medium |
CN114489629A (en) * | 2022-01-18 | 2022-05-13 | 广州优谷信息技术有限公司 | Rapid development and test method based on interface document |
-
2023
- 2023-10-09 CN CN202311306780.8A patent/CN117370242A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2009033953A2 (en) * | 2007-09-14 | 2009-03-19 | Siemens Aktiengesellschaft | A method and a system for automatic extraction of requirements |
US20140244254A1 (en) * | 2013-02-25 | 2014-08-28 | Microsoft Corporation | Facilitating development of a spoken natural language interface |
CN108491199A (en) * | 2018-03-06 | 2018-09-04 | 福建天泉教育科技有限公司 | A kind of method and terminal automatically generating interface |
CN108958727A (en) * | 2018-04-13 | 2018-12-07 | 北京优帆科技有限公司 | A kind of generation method and system of API client code |
CN113778421A (en) * | 2021-09-16 | 2021-12-10 | 京东方科技集团股份有限公司 | Method and equipment for generating service code |
CN114489629A (en) * | 2022-01-18 | 2022-05-13 | 广州优谷信息技术有限公司 | Rapid development and test method based on interface document |
CN114443905A (en) * | 2022-01-27 | 2022-05-06 | 厦门雅基软件有限公司 | Interface document updating method and device, electronic equipment and readable storage medium |
Non-Patent Citations (1)
Title |
---|
尹彦均;王普;李亚芬;: "基于J2EE开源框架的业务组件代码生成器设计", 微型机与应用, no. 1, 6 June 2007 (2007-06-06) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7371141B2 (en) | Tools and methods for real-time dataflow programming languages | |
Marrs | JSON at work: practical data integration for the web | |
CN106980504B (en) | Application program development method and tool and equipment thereof | |
CN109885311B (en) | Application program generation method and device | |
US8762962B2 (en) | Methods and apparatus for automatic translation of a computer program language code | |
US7240279B1 (en) | XML patterns language | |
US20160147578A1 (en) | Api validation system | |
US20150242194A1 (en) | System for Translating Diverse Programming Languages | |
Yalamanchili | VHDL starter's guide | |
Texel et al. | Use cases combined with BOOCH/OMT/UML: process and products | |
US20090254926A1 (en) | Registering network applications with an api framework | |
CN108829467B (en) | Third-party platform docking implementation method, device, equipment and storage medium | |
US9021348B1 (en) | Composition of templates using transclusion that guarantee a valid HTML document | |
US20220236971A1 (en) | Adapting existing source code snippets to new contexts | |
US20170054790A1 (en) | System and Method for Object Compression and State Synchronization | |
FR2934388A1 (en) | METHOD FOR CREATING COMPUTER PROGRAM | |
US11947976B2 (en) | System and method for semantic metadata extensions in API governance using validation rulesets | |
CN114625349A (en) | Front-end page generation method and device, terminal equipment and storage medium | |
US11119896B1 (en) | Browser based visual debugging | |
CN115237805A (en) | Test case data preparation method and device | |
KR100762712B1 (en) | Method for transforming of electronic document based on mapping rule and system thereof | |
CN113238739A (en) | Plug-in development and data acquisition method, device, electronic equipment and medium | |
CN117370242A (en) | Adapter and method for generating multilingual SDK client by parsing interface document | |
US8161376B2 (en) | Converting a heterogeneous document | |
CN115640279A (en) | Method and device for constructing data blood relationship |
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 |