Doc2Spec Web API Specification Generation from Documentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Application developers face challenges in discovering, selecting, and correctly invoking web APIs due to varying URL structures, HTTP methods, and status codes across different APIs, requiring manual effort to create and maintain API specifications, which are often semi-structured and in natural language.

Innovation Solution

A tool, called Doc2Spec, automatically generates web API specifications by extracting base URLs, path templates, HTTP request types, and query parameters from unstructured web API documentation using machine learning techniques and hierarchical clustering, allowing for consistent and automated API invocations and client code synthesis.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Manufacturing precision

If manual effort is used to create and maintain API specifications, then the specifications can be customized and detailed, but the process is time-consuming and requires significant human resources

Engineering Contradiction:
Improvespecification accuracyVSAvoidspecification creation time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system performs preliminary extraction of API documentation in advance, storing it for later processing. This allows the actual specification generation to start from pre-prepared data, reducing the time required when specifications are needed while maintaining accuracy through systematic processing of the pre-extracted documentation.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent replaces manual mechanical processes of reading, analyzing, and documenting API specifications with an automated computer-based system that uses machine learning models and natural language processing to extract and generate specifications automatically, eliminating human labor while maintaining or improving accuracy.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Adaptability or versatility

If manual API specification creation is performed, then flexibility in handling diverse API formats is possible, but consistency between documentation and implementation is difficult to maintain

Engineering Contradiction:
Improveformat flexibilityVSAvoiddocumentation consistency
Core Design Contradiction:
Adaptability or versatilityVSStability of the object's composition

Solution Approach 1:

The system changes the parameters of processing by using configurable extraction rules and machine learning models that can adapt to different API documentation formats. This allows the same systematic process to handle diverse formats while producing consistent output, as the parameters of the processing system itself are adjusted rather than relying on manual adaptation.

Inventive Principle:
Principle #35Parameter changes

Solution Approach 2:

The system implements feedback mechanisms where extracted specifications are validated against the original documentation and implementation code. This feedback loop ensures consistency by automatically detecting and correcting discrepancies between documentation and actual API behavior, maintaining stability without sacrificing adaptability to different formats.

Inventive Principle:
Principle #23Feedback

3Productivity

If automated tools are used for API specification generation, then productivity increases, but the ability to handle complex and varied API structures may be reduced

Engineering Contradiction:
Improvespecification generation speedVSAvoidAPI structure handling capability
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system introduces machine learning models and natural language processing algorithms as intermediaries between the diverse API documentation formats and the structured specification output. These intermediaries automatically adapt to different input structures while maintaining consistent output formats, enabling high productivity without sacrificing the ability to handle complex and varied API structures.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS10942708B2Generating web API specification from online documentation
Publication Date: 2021.03.09 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10942708B2 patent drawing
  • US10942708B2 patent drawing
  • US10942708B2 patent drawing

AI summary

A tool that automatically generates a web API specification from a web API documentation is provided. The tool extracts a base uniform resource locator (URL) string from the received documentation by identifying URL strings in the documentation that are valid web application programming interface (API) calls. The tool infers path templates by identifying and clustering path expressions in the documentation that invoke the same URL endpoints. The tool extracts hypertext transfer protocol (HTTP) request type and query parameters associated with the inferred path templates. The tool generates a specification that includes the extracted base URL, the inferred path templates, the extracted HTTP request types, and the extracted query parameters.