http-generate

Generate .http request samples from Spring controller mappings.

2.8k|1.2k|Updated Dec 12, 2024
One-click install
npx skills add https://github.com/spring-ai-alibaba/examples --skill http-generate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: http-generate
Source: https://github.com/spring-ai-alibaba/examples/tree/main/.claude/skills/http-generate
Command: npx skills add https://github.com/spring-ai-alibaba/examples --skill http-generate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the generation of HTTP request examples from Spring Boot REST controllers, enabling quick API documentation and testing without manual crafting.

Core Features & Use Cases

  • Automatically discovers modules with controllers and extracts mappings from @RequestMapping and related annotations.
  • Generates .http files per module (and per controller) with fully qualified URLs, default @RequestParam values, and proper URL encoding.
  • Provides a clean, separator-based file structure to group requests by controller and module to simplify documentation and testing workflows.
  • Use case: A developer wants to quickly produce a set of API request samples for a newly added REST API surface to seed their team’s API docs.

Quick Start

Run the HTTP generator for a single module: python .claude/skills/http-generate/scripts/http_generator.py <module_path> [output_file]

Run for all modules: python .claude/skills/http-generate/scripts/http_generator.py all

Examples: generate for a basic module at basic/chat and save to custom.http: python .claude/skills/http-generate/scripts/http_generator.py basic/chat custom.http

Frequently Asked Questions about http-generate

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-generate HTTP requests from Spring Boot controllers?

To auto-generate HTTP requests from Spring Boot controllers, run the provided Python script to scan mappings and produce ready-to-use .http files for testing and documentation.

How does generating .http files from Spring controllers work?

Generating .http files works by parsing annotations like @RequestMapping, respecting base paths and default @RequestParam values, and organizing the output by module and controller.

Can I generate HTTP request samples for all Spring Boot modules at once?

Yes, you can generate HTTP request samples for all Spring Boot modules at once by passing the 'all' argument to the generation script instead of a single module path.

Do I need to manually format URLs when generating API request samples?

No, you do not need to manually format URLs when generating API request samples; the tool automatically applies proper URL encoding and constructs fully qualified URLs.

What's the best way to create REST API documentation from existing Spring controllers?

The best way to create REST API documentation from Spring controllers is using an automated generator to extract mappings and output structured .http files grouped by module.