CN112015468A - Interface document processing method and device, electronic equipment and storage medium - Google Patents

Interface document processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112015468A
CN112015468A CN202011025704.6A CN202011025704A CN112015468A CN 112015468 A CN112015468 A CN 112015468A CN 202011025704 A CN202011025704 A CN 202011025704A CN 112015468 A CN112015468 A CN 112015468A
Authority
CN
China
Prior art keywords
parameter
request
service request
description information
target
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.)
Granted
Application number
CN202011025704.6A
Other languages
Chinese (zh)
Other versions
CN112015468B (en
Inventor
陈佳熠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011025704.6A priority Critical patent/CN112015468B/en
Publication of CN112015468A publication Critical patent/CN112015468A/en
Application granted granted Critical
Publication of CN112015468B publication Critical patent/CN112015468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Library & Information Science (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses an interface document processing method and device, electronic equipment and a storage medium, relates to the technical field of cloud computing, and further relates to the fields of application program interface development and the like. The specific implementation scheme is as follows: determining target description information of request parameters in a service request example according to the service request example provided by an application program interface provider and a parameter list associated with the service request example; and generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter. The method solves the problems of high cost, low efficiency and the like of the parameter calling explanation mode in the current generation of the interface document, provides a scheme for processing the application program interface document, does not need an application program interface provider to carry out a complicated manual input process, and can automatically, efficiently and low-cost generate the parameter calling explanation content in the interface document.

Description

Interface document processing method and device, electronic equipment and storage medium
Technical Field
The application relates to the technical field of cloud computing, in particular to software development and testing and an intelligent search technology, and specifically relates to an interface document processing method and device, electronic equipment and a storage medium.
Background
With the development of computer technology, Application Programming Interface (API) development and Application are becoming more and more common. Application interface providers need to configure a comprehensive and sophisticated usage specification (i.e., interface documentation) for the services provided in order for callers to invoke interfaces based on the interface documentation. Among them, the calling description of the parameters in the interface document is the most cumbersome and complicated. However, the generation of the calling description of the parameter mainly by manual editing is costly and inefficient, and needs to be improved.
Disclosure of Invention
The present disclosure provides an interface document processing method, apparatus, electronic device, and storage medium, which generate call description contents of parameters in an interface document at low cost and high efficiency.
According to an aspect of the present disclosure, there is provided an interface document processing method including:
determining target description information of request parameters in a service request example according to the service request example provided by an application program interface provider and a parameter list associated with the service request example;
and generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter.
According to another aspect of the present disclosure, there is provided an interface document processing apparatus including:
the target information determining module is used for determining target description information of request parameters in a service request example according to the service request example provided by an application program interface provider and a parameter list associated with the service request example;
and the content generation module is used for generating parameter calling explanatory content in the application program interface document according to the target description information of the request parameter.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the interface document processing method of any of the embodiments of the present application.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the interface document processing method according to any one of the embodiments of the present application.
According to the technology of the application, the problems that the cost is high, the efficiency is low and the like in the existing parameter calling and explaining mode in the interface document generation are solved, the scheme for processing the application program interface document is provided, the application program interface provider is not required to carry out a complicated manual input process, and the parameter calling and explaining content in the interface document can be automatically, efficiently and at low cost.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flow chart of an interface document processing method according to an embodiment of the present application;
FIG. 2 is a flow chart of another interface document processing method provided according to an embodiment of the application;
FIG. 3 is a flow chart of yet another interface document processing method provided in accordance with an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an interface document processing apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing an interface document processing method according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of an interface document processing method according to an embodiment of the present application. The embodiment of the application is suitable for the condition of how to process the interface document, and is particularly suitable for how to generate the calling description of the parameters in the interface document efficiently and at low cost. The embodiment can be executed by an interface document processing device, which can be implemented by software and/or hardware, and can be integrated in an electronic device carrying the interface document processing function, such as an API gateway control platform in the electronic device. As shown in fig. 1, the method includes:
s101, according to a service request example provided by an application program interface provider and a parameter list associated with the service request example, determining target description information of a request parameter in the service request example.
In this embodiment, the application program interface provider is a party that develops the application program interface, or may be a party that provides the application program interface call service to the outside. Alternatively, an application program interface may provide a type of service, that is, the data format of all service requests of an application program interface is the same, and a service request example is an example of a service that can be provided by an application program interface, and is essentially a real application program interface call request. In addition, the application program interface provider may adopt a canonical data structure when developing the application program interface, for example, JAVA, Json, or C language may be adopted. Because the Json data structure has the characteristics of simplicity, clear hierarchy, easiness in writing, easiness in conversion and the like, the Json data structure is preferably used for writing by the application program interface provider in the embodiment when the application program interface is developed. Further, an example of a service request provided by an application program interface provider may be written in a Json data structure.
In this embodiment, the application program interface provider may obtain a service request example from its service log and provide the service request example to the API gateway control platform. Further, the API gateway control platform may provide a visual interactive interface, and then when the application program interface provider has a requirement for generating a parameter call description in the application program interface document, the application program interface provider may input related content according to prompt information in the visual interactive interface, for example, a service request instance in the service log may be pasted and copied to the visual interactive interface, and then the API gateway control platform may obtain the service request instance provided by the application program interface provider from the visual interactive interface.
Further, the service request example may include all request parameters that need to be called when the application program interface is called, and specifically may include parameter names, parameter types, example values, and the like of all request parameters, but cannot refer to all content information of the request parameters. In turn, the application programming interface provider may also provide the API gateway control platform with a list of parameters associated with the service request instance. In this embodiment, the parameter list associated with the service request example is a parameter detail form locally maintained by the application program interface provider in the process of developing the application program interface, and may include part or all of the request parameters in the service request example, and the detail content of each request parameter included in the parameter list may include other content information of the request parameter that needs to be displayed to the interface caller but cannot be embodied in the service request example, such as a parameter position, a parameter value range, a parameter description, whether necessary or not, an optional value, a parameter verification rule, and the like.
In this embodiment, while the application program interface provider inputs the service request instance in the visual interactive interface, the locally maintained parameter list may be pasted and copied to the visual interactive interface, or the locally maintained parameter list may be imported into the visual interactive interface, and the API gateway control platform may further obtain the parameter list associated with the application program interface from the visual interactive interface.
Optionally, after the API gateway control platform obtains the service request example and the parameter list provided by the application program interface provider, all the request parameters may be extracted from the service request example, and the request parameters are described according to a preset data format in combination with the parameter list, so as to obtain target description information of the request parameters. In this embodiment, the target description information may adopt a general specification format of description parameter information, and perfectly shows details of all parameters in the service request example, and specifically may include details of all request parameters in the service request example and request parameters in the parameter list, and the like. Furthermore, in order to facilitate fast generation of related content of the parameter call description part in the interface document, and to enable other callers to perform export and import operations on the application program interface without performing data format conversion, in this embodiment, the target description information is preferably written in a Json Schema data structure.
Optionally, when the service request example is compiled by using a Json data structure and the target description information is compiled by using a Json Schema data structure, a conversion algorithm between the Json data structure and the Json Schema data structure may be used, and the target description information of the request parameter in the service request example is obtained by combining the service request example and the parameter list.
And S102, generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter.
Specifically, after the target description information of the request parameter is obtained, the relevant content of the parameter calling description in the application program interface document may be generated according to the target description information of the request parameter based on a preset parameter calling description format. For example, format conversion may be directly performed on the target description information of the request parameter, for example, conversion may be performed to a set parameter invocation specification format, so as to obtain the relevant content of the parameter invocation specification in the application program interface document.
It should be noted that, because one application program interface may involve many request parameters, the existing call description mode for generating parameters through manual editing has the problems of low efficiency, high cost, and the like; by adopting the mode of combining the service request instance and the parameter list, the input cost of the application program provider can be reduced, all information of the request parameters can be displayed more perfectly, and the user experience is improved. A new idea is provided for automatically, efficiently and inexpensively generating the parameter calling explanation content in the interface document. In addition, the application program interface provider in the embodiment also does not need to pay attention to the format of the parameter list, and the satisfaction degree of the user is increased.
According to the technical scheme of the embodiment of the application, the target description information of all request parameters in the service request example can be obtained by adopting a mode of combining the service request example and the parameter list, and further rich parameter calling explanation can be obtained. The method solves the problems of high cost, low efficiency and the like of the parameter calling explanation mode in the current generation of the interface document, provides a scheme for processing the application program interface document, does not need an application program interface provider to carry out a complicated manual input process, and can automatically, efficiently and low-cost generate the parameter calling explanation content in the interface document.
Fig. 2 is a flowchart of another interface document processing method provided in an embodiment of the present application. On the basis of the foregoing embodiments, the present embodiment further explains that the target description information for determining the request parameter in the service request example is determined according to the service request example provided by the application program interface provider and the parameter list associated with the service request example. As shown in fig. 2, the method includes:
s201, analyzing the service request example to obtain the basic description information of the request parameter in the service request example.
In this embodiment, the basic description information is an intermediate bridge for determining the target description information of the request parameter, and a general canonical format for describing parameter information may be adopted; further, in order to generate the target description information quickly, the same data format as the target description information may be used in this embodiment, for example, the basic description information may be written in a Json Schema data structure.
Specifically, all request parameters can be analyzed from the service request example in a recursive traversal manner, specifically parameter names and parameter types of all request parameters are analyzed, and further, example values can be analyzed under the condition that the request parameters have the example values; and then, the parameter name, the parameter type, the example value and the like of the analyzed request parameter can be described according to a preset data format, so that basic description information of the request parameter is obtained. Optionally, the basic description information may include a parameter name and a parameter type of the request parameter, and may further include an example value of the request parameter.
Further, in a case that the service request example is compiled by using a Json data structure, and the basic description information is compiled by using a Json Schema data structure, for example, the service request example is as follows:
{"instanceType":"N1",
"tags":[{"tagKey":"tag1","tagValue":"var1"}]
}
because the standard Json data structure represents the request in a Key-Value pair (Key-Value) form, the parameter names, the parameter types and the like of all request parameters can be analyzed from the service request example in a recursive traversal mode based on the Json data structure and the Json Schema data structure. In the present embodiment, the parameter name is used as Key, and the parameter example Value is used as Value. For example, by analyzing the service request example, a request parameter with a parameter name of instanceType and an example value of N1 can be obtained; since the example value of the request parameter, N1, is a string, the parameter type of the request parameter is string. Through the logic, based on the Json Schema data structure, the following basic description information can be obtained:
Figure BDA0002702055940000061
s202, according to the basic description information of the request parameters and the parameter list associated with the service request example, the target description information of the request parameters is obtained.
Optionally, the basic description information of the request parameter may be expanded according to a parameter list associated with the service request example, so as to obtain the target description information of the request parameter. For example, when both the basic description information and the target description information are written in a Json Schema data structure, the corresponding request parameters in the basic description information may be expanded according to the Json Schema data structure according to the parameter list, so as to obtain the target description information of the request parameters.
S203, generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter.
According to the technical scheme of the embodiment of the application, the basic description information is introduced and is taken as the intermediate bridge for determining the target description information of the request parameter, and an optional mode is provided for quickly generating the target description information of the request parameter. In addition, in this embodiment, the target description information adopts a data description specification of the Json Schema standard, which provides convenience for each caller to import an application program interface.
Further, in order to obtain the target description information quickly, in this embodiment, S202 may be: matching from a parameter list associated with the service request example according to the parameter name in the basic description information of the request parameter; and then expanding the basic description information of the request parameters according to the matching result to obtain the target description information of the request parameters.
Specifically, matching may be performed from a parameter list associated with the service request instance by using a parameter name in the basic description information of the request parameter as an index. For example, the service request example provided by the application program interface provider is shown in step S202, and the parameter list associated with the service request example is shown in table 1. The instanceType can be used as an index, matching is performed from a parameter list associated with the service request example, all details of the request parameter with the parameter name instanceType can be acquired from the list, such as whether the request parameter is necessary, description, parameter type and the like, and further, the basic description information of the request parameter can be extended according to all details of the acquired request parameter with the parameter name instanceType, so that the target description information of the request parameter can be acquired. For example:
{"type":"object",
"properties" { "instanceType": { "type": string "," description ": the type of virtual machine instance to be created", "example": N1 "}.
Based on the above logic, the target description information of other request parameters (including tags, tagKey, and tagValue) can be obtained. The embodiment provides an optional way for quickly generating the target description information of the request parameter by connecting the basic description information and the parameter list by the parameter name.
Figure BDA0002702055940000071
Figure BDA0002702055940000081
Table 1 example associated parameter list for service request
In order to ensure the accuracy of the target description information, further, in a case that the request parameter in the parameter list includes a parameter type, whether the parameter type in the basic description information of the request parameter is consistent with the parameter type of the request parameter in the parameter list may be compared, and if not, the parameter type in the basic description information may be used as the standard.
Fig. 3 is a flowchart of still another interface document processing method provided in an embodiment of the present application. On the basis of the foregoing embodiments, the present embodiment further explains and explains the determination of target description information of the request parameter in the service request example according to the service request example provided by the application program interface provider and the parameter list associated with the service request example. As shown in fig. 3, the method includes:
s301, the request parameters with the same parameter name and different parameter values in the service request example are used as repeated request parameters.
It will be appreciated that for a Json data structure, parameter names are unique at the same level, and parameter names may be the same at different levels. Further, in one example of a service request, there may be request parameters with the same parameter name. In order to ensure the accuracy of the target description information, the present embodiment may process the request parameter with the same parameter name through S301 and S302.
Specifically, the request parameters with the same parameter name and different parameter values can be obtained from the service request example in a traversal manner, and the request parameters are used as the repeated request parameters.
For example, the service request example of the application program interface is as follows, wherein the request parameters with the parameter name of key1 and the parameter value of value1 are the same as the request parameters with the parameter name of key1 and the parameter value of 111, but the parameter values are different, and the request parameters with the parameter name of key1 can be used as the repeat request parameters.
Figure BDA0002702055940000082
S302, according to the position information of the repeat request parameter in the service request example and the parameter list associated with the service request example, a parameter detail queue associated with the repeat request parameter is constructed.
Optionally, the location information of each repeat request parameter in the service request example may be obtained according to a parameter name of the repeat request parameter, where the location information may be a number of lines in the service request example where the repeat request parameter is located, for example, the repeat request parameter with the parameter name of key1 and the parameter value of value1 is located in a first line of the service request example.
Then, according to the position information, a first queue including parameter values, for example [ "value1", "111" ]; the framework includes a second queue of detail content in the parameter list, e.g., [ "this is a string," "this is a value" ], based on the parameter name, location information, and the parameter list; from the first queue and the second queue, a parameter detail queue associated with the repeat request parameter is constructed, for example [ "value 1": "this is a character string", "111": "this is a numerical value" ].
S303, determining target description information of the request parameters in the service request example according to the service request example, the parameter list associated with the service request example and the parameter detail queue.
Specifically, the basic description information of the request parameter in the service request example can be obtained according to the service request example; according to the basic description information of the request parameters, the parameter list associated with the service request example and the parameter detail queue, the target description information of the request parameters in the service request example can be determined.
S304, generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter.
According to the technical scheme of the embodiment of the application, the parameter detail queue is introduced, and the ordering of the parameter names in the parameter list is guaranteed based on the first-in first-out characteristic of the queue, so that the target description information of the requested parameters can be accurately obtained.
Fig. 4 is a schematic structural diagram of an interface document processing apparatus according to an embodiment of the present application. The embodiment of the application is suitable for the condition of how to process the interface document, and is particularly suitable for how to generate the calling description of the parameters in the interface document efficiently and at low cost. The device can realize the interface document processing method in any embodiment of the application. The device can be integrated in electronic equipment bearing interface document processing functions. The interface document processing apparatus 400 specifically includes:
a target information determining module 401, configured to determine target description information of a request parameter in a service request example according to a service request example provided by an application program interface provider and a parameter list associated with the service request example;
a content generating module 402, configured to generate parameter invocation specification content in the application program interface document according to the target description information of the request parameter.
According to the technical scheme of the embodiment of the application, the target description information of all request parameters in the service request example can be obtained by adopting a mode of combining the service request example and the parameter list, and further rich parameter calling explanation can be obtained. The method solves the problems of high cost, low efficiency and the like of the parameter calling explanation mode in the current generation of the interface document, provides a scheme for processing the application program interface document, does not need an application program interface provider to carry out a complicated manual input process, and can automatically, efficiently and low-cost generate the parameter calling explanation content in the interface document.
Illustratively, the target information determination module 401 includes:
the basic information determining unit is used for analyzing the service request example to obtain basic description information of the request parameters in the service request example; the basic description information comprises parameter names and parameter types;
and the target information determining unit is used for obtaining the target description information of the request parameter according to the basic description information of the request parameter and the parameter list associated with the service request example.
Illustratively, the target information determining module 401 is specifically configured to:
taking request parameters with the same parameter name and different parameter values in the service request example as repeated request parameters;
according to the position information of the repeat request parameters in the service request examples and the parameter list associated with the service request examples, a parameter detail queue associated with the repeat request parameters is constructed;
and determining the target description information of the request parameter in the service request example according to the service request example, the parameter list associated with the service request example and the parameter detail queue.
Illustratively, the target information determining unit is specifically configured to:
matching from a parameter list associated with the service request example according to the parameter name in the basic description information of the request parameter;
and according to the matching result, expanding the basic description information of the request parameter to obtain the target description information of the request parameter.
For example, in the present embodiment, a service request example is written by using a Json data structure; the target description information and the basic description information are written by adopting a Json Schema data structure.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 5, it is a block diagram of an electronic device according to the interface document processing method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the interface document processing method provided by the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the interface document processing method provided by the present application.
The memory 502, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules (e.g., the target information determination module 401 and the content generation module 402 shown in fig. 4) corresponding to the interface document processing method in the embodiment of the present application. The processor 501 executes various functional applications of the server and data processing, i.e., implements the interface document processing method in the above-described method embodiment, by running non-transitory software programs, instructions, and modules stored in the memory 502.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device of the interface document processing method, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 502 may optionally include a memory remotely located from the processor 501, and these remote memories may be connected to the electronic device interfacing the document processing method through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the interface document processing method may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus interfacing the document processing method, such as an input device of a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
According to the technical scheme of the embodiment of the application, the target description information of all request parameters in the service request example can be obtained by adopting a mode of combining the service request example and the parameter list, and further rich parameter calling explanation can be obtained. The method solves the problems of high cost, low efficiency and the like of the parameter calling explanation mode in the current generation of the interface document, provides a scheme for processing the application program interface document, does not need an application program interface provider to carry out a complicated manual input process, and can automatically, efficiently and low-cost generate the parameter calling explanation content in the interface document.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. An interface document processing method, comprising:
determining target description information of request parameters in a service request example according to the service request example provided by an application program interface provider and a parameter list associated with the service request example;
and generating parameter calling explanation content in the application program interface document according to the target description information of the request parameter.
2. The method of claim 1, wherein determining the target description information of the request parameter in the service request instance according to the service request instance provided by the application program interface provider and the parameter list associated with the service request instance comprises:
analyzing the service request example to obtain basic description information of request parameters in the service request example; the basic description information comprises parameter names and parameter types;
and obtaining the target description information of the request parameter according to the basic description information of the request parameter and the parameter list associated with the service request example.
3. The method of claim 1, wherein determining the target description information of the request parameter in the service request instance according to the service request instance provided by the application program interface provider and the parameter list associated with the service request instance comprises:
taking the request parameters with the same parameter name and different parameter values in the service request example as repeated request parameters;
according to the position information of the repeated request parameters in the service request examples and the parameter list associated with the service request examples, constructing a parameter detail queue associated with the repeated request parameters;
and determining target description information of the request parameters in the service request example according to the service request example, the parameter list associated with the service request example and the parameter detail queue.
4. The method of claim 2, wherein obtaining the target description information of the request parameter according to the basic description information of the request parameter and the parameter list associated with the service request instance comprises:
matching from the parameter list associated with the service request example according to the parameter name in the basic description information of the request parameter;
and according to the matching result, expanding the basic description information of the request parameter to obtain the target description information of the request parameter.
5. The method of claim 2, wherein the service request instance is written in a Json data structure; the target description information and the basic description information are written by adopting a Json Schema data structure.
6. An interface document processing apparatus comprising:
the target information determining module is used for determining target description information of request parameters in a service request example according to the service request example provided by an application program interface provider and a parameter list associated with the service request example;
and the content generation module is used for generating parameter calling explanatory content in the application program interface document according to the target description information of the request parameter.
7. The apparatus of claim 6, wherein the target information determination module comprises:
a basic information determining unit, configured to analyze the service request example to obtain basic description information of a request parameter in the service request example; the basic description information comprises parameter names and parameter types;
and the target information determining unit is used for obtaining the target description information of the request parameter according to the basic description information of the request parameter and the parameter list associated with the service request example.
8. The apparatus of claim 6, wherein the target information determination module is specifically configured to:
taking the request parameters with the same parameter name and different parameter values in the service request example as repeated request parameters;
according to the position information of the repeated request parameters in the service request examples and the parameter list associated with the service request examples, constructing a parameter detail queue associated with the repeated request parameters;
and determining target description information of the request parameters in the service request example according to the service request example, the parameter list associated with the service request example and the parameter detail queue.
9. The apparatus according to claim 7, wherein the target information determining unit is specifically configured to:
matching from the parameter list associated with the service request example according to the parameter name in the basic description information of the request parameter;
and according to the matching result, expanding the basic description information of the request parameter to obtain the target description information of the request parameter.
10. The apparatus of claim 7, wherein the service request instance is written in a Json data structure; the target description information and the basic description information are written by adopting a Json Schema data structure.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the interface document processing method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the interface document processing method of any one of claims 1 to 5.
CN202011025704.6A 2020-09-25 2020-09-25 Interface document processing method and device, electronic equipment and storage medium Active CN112015468B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011025704.6A CN112015468B (en) 2020-09-25 2020-09-25 Interface document processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011025704.6A CN112015468B (en) 2020-09-25 2020-09-25 Interface document processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112015468A true CN112015468A (en) 2020-12-01
CN112015468B CN112015468B (en) 2024-05-14

Family

ID=73527512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011025704.6A Active CN112015468B (en) 2020-09-25 2020-09-25 Interface document processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112015468B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799659A (en) * 2021-01-12 2021-05-14 杨飞 Method, device and terminal for automatically generating data interface without programming
CN112835561A (en) * 2021-03-09 2021-05-25 吉林省裕林信息科技有限公司 Method, open platform, terminal and medium for quickly generating API service interface
CN113821254A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Interface data processing method, device, storage medium and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110167432A1 (en) * 2005-03-14 2011-07-07 Oracle International Corporation Web Services Layer Synchrony in Relation to the Business Layer Synchrony
CN108932122A (en) * 2018-06-19 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Interface document generation method, device, computer equipment and storage medium
CN110941950A (en) * 2019-11-26 2020-03-31 北京明略软件系统有限公司 Interface document generation method, device, server and storage medium
CN111258563A (en) * 2020-01-16 2020-06-09 江苏满运软件科技有限公司 Interface document generation method and device, storage medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110167432A1 (en) * 2005-03-14 2011-07-07 Oracle International Corporation Web Services Layer Synchrony in Relation to the Business Layer Synchrony
CN108932122A (en) * 2018-06-19 2018-12-04 上海陆家嘴国际金融资产交易市场股份有限公司 Interface document generation method, device, computer equipment and storage medium
CN110941950A (en) * 2019-11-26 2020-03-31 北京明略软件系统有限公司 Interface document generation method, device, server and storage medium
CN111258563A (en) * 2020-01-16 2020-06-09 江苏满运软件科技有限公司 Interface document generation method and device, storage medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林钰杰;皇甫汉聪;: "基于SOA的文档管理系统集成方案研究", 电子设计工程, no. 18, 20 September 2017 (2017-09-20) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799659A (en) * 2021-01-12 2021-05-14 杨飞 Method, device and terminal for automatically generating data interface without programming
CN112835561A (en) * 2021-03-09 2021-05-25 吉林省裕林信息科技有限公司 Method, open platform, terminal and medium for quickly generating API service interface
CN113821254A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Interface data processing method, device, storage medium and equipment

Also Published As

Publication number Publication date
CN112015468B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
CN110765024B (en) Simulation test method, simulation test device, electronic equipment and computer readable storage medium
US9645838B2 (en) Automatic discovery of a JavaScript API
CN112015468B (en) Interface document processing method and device, electronic equipment and storage medium
CN111694857B (en) Method, device, electronic equipment and computer readable medium for storing resource data
CN110727434B (en) Rendering method, rendering device, electronic equipment and storage medium
JP2021193606A (en) Operator registration processing method, device and electronic apparatus based on deep learning
US11741002B2 (en) Test automation systems and methods using logical identifiers
CN112506602B (en) Page generation method and device, electronic equipment and computer readable medium
JP2021168190A (en) Method, apparatus, electronic device, and storage medium for providing applet service capability
KR20170016362A (en) Converting presentation metadata to a browser-renderable format during compilation
CN112506854A (en) Method, device, equipment and medium for storing page template file and generating page
CN113254043A (en) Web front-end project processing method and device, electronic equipment and storage medium
WO2023169193A1 (en) Method and device for generating smart contract
WO2023221416A1 (en) Information generation method and apparatus, and device and storage medium
CN111767149A (en) Scheduling method, device, equipment and storage equipment
US9489436B2 (en) Gateway enablement of analytic database services
CN113010811B (en) Webpage acquisition method and device, electronic equipment and computer readable storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN111177558B (en) Channel service construction method and device
JP2021120899A (en) User identification method, device, storage medium, and electronic apparatus
CN110618944A (en) Device simulation method, device, electronic device and storage medium
CN112925482B (en) Data processing method, device, system, electronic equipment and computer storage medium
US20220198301A1 (en) Method and apparatus for update processing of question answering system
CN113468055A (en) System testing method and device
CN115761093A (en) Rendering method, rendering 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
GR01 Patent grant