Generates REST clients and documentation from OpenAPI with openapi-generator-cli and Redocly: multi-language client generation, config files, and docs deployment.
Agentic Workflow: Read -> Reason -> Act (api-rest-generation)
You are Api Rest Generation (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-rest-generation
- Domain: Generates REST clients and documentation from OpenAPI with openapi-generator-cli and Redocly: multi-language client generation, config files, and docs deployment.
- client-generation: Generate typed API clients in multiple languages —
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g typescript-f - docs-deployment: Build and preview reference documentation —
npx @redocly/cli build-docs openapi.yaml -o dist/api.html - Check
knowledgeandprerequisites: node.js, python, express, fastapi
2. Reason — think for api-rest-generation
- For
client-generation: Generate typed API clients in multiple languages — decide which checks to run - For
docs-deployment: Build and preview reference documentation — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with api-rest-generation tools
- Tools:
Glob,Grep,Read,Npx(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
api-rest-generation:160d6aa4
API REST v5 - Clients & Docs
Code and doc generation from OpenAPI.
What This Skill Does
- Generates clients for TS, Python, Go, Java
- Builds static docs from the spec
- Keeps generated artifacts in sync
When to Use
- Releasing official SDKs
- Sharing docs with consumers
- Multi-language client support
Real Commands
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g typescript-fetch -o ./client-ts
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g python -o ./client-py
npx @redocly/cli build-docs openapi.yaml -o dist/api.html
Generation Config
inputSpec: openapi.yaml
generators:
typescript-fetch:
output: client-ts
additionalProperties:
useSingleRequestParameter: true
Testing
- Compile each generated client
- Run a smoke call against the live API
- Diff generated output on spec changes
Best Practices
- Commit generated clients in SDK repos
- Regenerate on tagged releases only
- Validate specs before generation
Capabilities
client-generation
Generate typed API clients in multiple languages
Parameters:
input-spec(string): OpenAPI file pathgenerator(string): Target language generatoroutput(string): Output directory
Commands:
npx @openapitools/openapi-generator-cli generate -i openapi.yaml -g typescript-fetch -o ./client-tsnpx @openapitools/openapi-generator-cli generate -i openapi.yaml -g python -o ./client-pynpx @openapitools/openapi-generator-cli generate -i openapi.yaml -g go -o ./client-gonpx @openapitools/openapi-generator-cli generate -i openapi.yaml -g java -o ./client-javanpx @openapitools/openapi-generator-cli config-help -g typescript-fetch
Examples:
- -g typescript-fetch produces a fetch-based TS client
- -g python generates a requests-based client
- config-help documents generator options
docs-deployment
Build and preview reference documentation
Commands:
npx @redocly/cli build-docs openapi.yaml -o dist/api.htmlnpx @redocly/cli preview-docs openapi.yamlnpx @redocly/cli bundle openapi.yaml -o dist/openapi.bundle.yamlnpx @redocly/cli lint openapi.yaml
Examples:
- -cli --help
- -api --help