Agent skill
generate-api-client
Generate typed API client from OpenAPI/Swagger specification
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/generate-api-client-erp-core-dev-eagles-claude-config
SKILL.md
Generate Typed API Client from OpenAPI
Generate a fully typed HTTP client from an OpenAPI/Swagger specification.
For .NET (NSwag)
dotnet tool install -g NSwag.ConsoleCore
nswag openapi2csclient /input:swagger.json /output:ApiClient.cs /namespace:MyApp.ApiClients /className:SourcingApiClient /generateClientInterfaces:true /injectHttpClient:true
Register in DI:
builder.Services.AddHttpClient<ISourcingApiClient, SourcingApiClient>(client =>
client.BaseAddress = new Uri(config["ApiBaseUrl"]));
For TypeScript (openapi-typescript + openapi-fetch)
npm install openapi-typescript openapi-fetch
npx openapi-typescript ./openapi.yaml -o ./src/api/schema.d.ts
Usage:
import createClient from "openapi-fetch";
import type { paths } from "./api/schema";
const client = createClient<paths>({ baseUrl: "http://localhost:5000" });
const { data } = await client.GET("/api/candidates/{id}", { params: { path: { id: "c-001" } } });
For .NET (Microsoft Kiota)
dotnet tool install -g Microsoft.OpenApi.Kiota
kiota generate -l CSharp -d openapi.yaml -c SourcingClient -n MyApp.ApiClients -o ./Generated
Arguments
<openapi-url-or-path>: URL or path to OpenAPI spec--lang=<typescript|csharp>: Target language (default: csharp)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?