add-rest-client
CommunityGenerate REST clients with contract tests
System Documentation
What problem does it solve?
This Skill removes the friction of adding reliable outbound REST calls by turning a provider OpenAPI spec into a typed Spring Boot 4 client, then proving the consumer expectations with automated tests.
Core Features & Use Cases
- OpenAPI-driven client generation: Creates a type-safe REST client from a local OpenAPI 3.x spec using OpenAPI Generator and integrates it with Spring’s RestClient.
- Contract testing with Pact (consumer side): Generates Pact consumer tests to record expected interactions and produce a pact file for provider verification.
- Resilient outbound calls: Adds optional production-ready resilience using Spring Retry and (optionally) Spring Cloud Circuit Breaker backed by Resilience4j.
- Correct testing layers: Supports unit tests (mock adapter), component tests (WireMock for HTTP behavior), and consumer pact tests (Pact mock server).
Quick Start
Generate an OpenAPI client from src/main/resources/openapi/<provider>-api.yaml, wire it via a Spring @Configuration that reads app.clients.<provider>.base-url, and implement a small adapter that translates RestClient exceptions into domain exceptions with matching WireMock component tests and Pact consumer tests.
Dependency Matrix
Required Modules
None requiredComponents
Standard packageđź’» Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: add-rest-client Download link: https://github.com/dprice-dev/claude-java-skills/archive/main.zip#add-rest-client Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.