Java API Extractor for Openclaw

Automatically extracts Controller-level API definitions from Spring Boot Java projects into standard JSON formats for downstream documentation and frontend integration.

snowzhouj
v1.0.0
Jun 17, 2026
0
441
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install java-api-extractor

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install java-api-extractor using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Java API Extractor?

The Java API Extractor is a highly efficient development tool designed to parse Java Spring Boot projects and automatically extract Controller-level interface definitions into a standard, structured JSON schema. This skill streamlines documentation workflows, allowing team members to quickly prepare backend specifications for frontend integration, API gateways, or product data platforms without writing manual OpenAPI definitions.

As part of the Openclaw Skills ecosystem, this tool automates metadata mapping, parses Spring MVC annotations, and extracts Swagger/OpenAPI details. It ensures that your backend definitions and API documentation stay completely synchronized, reducing manual errors and saving precious engineering hours.

Java API Extractor Use Cases

  • Automating the extraction of API endpoints to generate up-to-date frontend integration schemas.
  • Creating unified JSON documents for product-level data platforms and internal documentation portals.
  • Batch-parsing Java Spring Boot Controller classes to audit request mapping paths, query parameters, and security headers.
  • Exporting endpoint metadata dynamically before pushing to downstream environments or mock servers.

How Java API Extractor Works

  1. Directory Targeting: Point the script to your Java project's root folder or specify a specific controller package.
  2. Static Code Analysis: The utility scans the src/main/java directory for @RestController and @Controller classes.
  3. Annotation Parsing: It extracts request mappings (such as @GetMapping, @PostMapping), method parameters, and Swagger annotations (like @ApiOperation).
  4. Type Conversion: Fields and payloads are mapped from Java classes to standard JSON Schema data types.
  5. JSON Export / Integration: Outputs a comprehensive JSON file or pushes the structure directly to external portals using target product identifiers.

Java API Extractor Setup

First, ensure you have the required runtime environment (Python is preferred, but Node.js is also supported).

# Extract the entire project to JSON (Python engine - default and preferred)
python scripts/extract_java_api.py --project "/path/to/msa-icmp-dev-manage" --output api-definitions.json

# Extract definitions from a specific Java package
python scripts/extract_java_api.py --project "/path/to/msa-icmp-dev-manage" --package "com.example.user.controller" --output user-api.json

# Extract definitions and push them directly to a target product platform
python scripts/extract_java_api.py --project "/path/to/msa-icmp-dev-manage" --prdid "PRD-2026-001" --push

# Run in verbose mode to log extensive debug details
python3 scripts/extract_java_api.py --project "/path/to/project" --output api.json --verbose

Alternatively, you can run the Node.js version of the Openclaw Skills parser if Python is not available in your environment:

# Node.js fallback parser invocation
node scripts/extract_java_api.js --project "/path/to/msa-icmp-dev-manage" --package "com.example.user.controller" --output user-api.json

Java API Extractor Data Schema & Taxonomy

The output schema structured as raw JSON matches standard API endpoints structures. Below is an example format:

[
  {
    "name": "Create User",
    "path": "/api/user",
    "method": "POST",
    "description": "Creates a new user",
    "requestParams": [
      {
        "name": "userName",
        "type": "String",
        "required": true,
        "description": "Target username"
      }
    ],
    "responseSchema": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "string",
          "description": "The generated user ID"
        }
      }
    }
  }
]

Annotation Support Matrix

Annotation Category Supported Spring & Swagger Annotations
Request Mappings @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping, @RequestMapping
Parameter Mappings @PathVariable, @RequestParam, @RequestHeader, @RequestBody, @ModelAttribute
Documentation Annotations @ApiOperation, @Operation, @ApiParam, @Parameter, @Tag, @Api

Data Type Mapping Standard

Java Class Type JSON Type
String string
Integer, int, Long, long integer
Boolean, boolean boolean
Double, double, Float, float number
Date, LocalDateTime string (date-time)
List array
Object object

Java API Extractor Advanced Features

  • Dual Execution Environments: Works natively out-of-the-box with both Python and Node.js execution routes.
  • Optimized Parsing Engines: The default Python parser has superior accuracy, handling up to 82 extracted endpoints compared to 47 on the JS fallback.
  • Swagger and OpenAPI Priorities: Auto-prioritizes rich descriptive annotations over standard variables whenever swagger mappings are available.
  • Implicit Property Inference: Intelligently deduces missing parameter details directly from property types and controller method definitions.
  • Smart Error and Code Defensiveness: Safely circumvents broken code syntax with inline warnings, bypasses circular references, and auto-detects system encoding standards like UTF-8 or GBK.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*