openapi-generator
Skill1 starsChanged 3 months agoMITView on GitHub
Use when the user has an OpenAPI 2.0 (Swagger) or 3.x spec and wants a typed client SDK, a server stub, generated API documentation, or config scaffolded from it via openapi-generator-cli — instead of hand-writing boilerplate. Covers 50+ language/framework targets, Docker/JAR/npm CLI options, and spec validation before generation.
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- automacoescomerciaisintegradas/skillstheir own version, first seen Oct 13, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- automacoescomerciaisintegradas/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository58 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- api-test-suiteSkill
- ascii-artSkill
- caddy-reverse-proxySkill
- changelog-generatorSkill
- color-palette-generatorSkill
- cron-taskSkill
- csv-toolkitSkill
- discord-bot-buildSkill
- docker-umbrellaSkill
- dotfiles-manageSkill
- email-sendSkill
- env-config-managerSkill
- excalidraw-diagramSkill
- file-organizerSkill
- forgejo-self-hostSkill
- frontend-design-toolkitSkill
- generate-dockerfileSkill
- gif-searchSkill
- git-backupSkill
- github-actions-ciSkill
- hallmark-readmeSkill
- http-api-testerSkill
- invoice-generatorSkill
- json-formatterSkill
- log-analyzerSkill
- markdown-linterSkill
- markdown-to-pdfSkill
- markdown-to-slidesSkill
- mcp-server-buildSkill
- media-id-mappingSkill
- movie-catalogue-siteSkill
- movie-night-calendarSkill
- ntfy-notifierSkill
- ocr-documentsSkill
- ollama-localSkill
- password-generatorSkill
- pdf-extractSkill
- portfolio-upkeepSkill
- qr-code-generatorSkill
- regex-testerSkill
- resume-builderSkill
- rss-monitorSkill
- searxng-self-hostSkill
- skill-publishSkill
- skill-registry-catalogSkill
- skills-portfolio-scaffoldSkill
- snippet-managerSkill
- sqlite-dashboardSkill
- streaming-provider-embedsSkill
- tailscale-deploySkill
- telegram-bot-buildSkill
- tmdb-metadataSkill
- uptime-kuma-self-hostSkill
- watchlist-syncSkill
- webhook-receiverSkill
- youtube-transcriptSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 42
Do not use this for: writing the OpenAPI spec itself (that's design work), runtime API mocking (use Prism/httpbin), or contract testing …
- Very specific: line 117
Use interfaceOnly=true to emit just the interfaces/models — ideal when you already have a framework set up and only want the contract types.
- Very specific: line 162
If a user asks for a language not listed by list, tell them it is unsupported rather than guessing a generator name — a wrong name fails …
- Very specific: line 239
Overwriting hand-written code: Never generate into a directory that contains source you've edited — a regeneration silently clobbers your …
- Very specific: line 240
hideGenerationTimestampleft off in committed code: Leave it off while debugging, but set it true before committing so every regeneration … - Distinctive: line 244
Hand-resolving merge conflicts inside generated folders: Treat generated code as a build artifact — regenerate rather than resolve Git …
- Very specific: line 245
Docker writes output owned by root: Add --user $(id -u):$(id -g) to the docker run command so generated files aren't root-owned on the host.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
openapi-generator
Overview
Turn an OpenAPI specification into working code. This skill wraps OpenAPI Generator so an agent can produce client SDKs, server stubs, documentation, and supporting config directly from a spec file — with the right flags, the right generator, and none of the common pitfalls.
When to Use
Load this skill when the user:
- Has an OpenAPI 2.0 (Swagger) or 3.0/3.1 spec and wants a client SDK in a specific language (TypeScript, Python, Go, Java, C#, Ruby, etc.).
- Wants a server stub / skeleton to implement an API described by a spec.
- Needs API documentation (HTML, Markdown, AsciiDoc, Redoc) generated from a spec.
- Asks to scaffold a new project "from the API contract".
- Wants to keep generated clients/stubs in sync with a changing spec.
- Mentions Swagger Codegen,
openapi-generator,openapi-generator-cli,nswag, or "generate a client from this YAML/JSON".
Do not use this for: writing the OpenAPI spec itself (that's design work), runtime API mocking (use Prism/httpbin), or contract testing (use Dredd/Schemathesis). This skill is about code generation from an existing spec.
openapi-generator-cli
The CLI is distributed as a Java JAR, Docker image, and native installers. Pick one and reuse it for every generation in a session.
Option A — Docker (recommended, no Java install)
# List every available generator
docker run --rm openapitools/openapi-generator-cli list
# Generate a TypeScript fetch client
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i /local/openapi.yaml \
-g typescript-fetch \
-o /local/out/typescriptThe -v "${PWD}:/local" bind mount is mandatory — the container writes output
into /local, which maps to your working directory.
Option B — JAR (needs Java 11+)
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.6.0/openapi-generator-cli-7.6.0.jar \
-o openapi-generator-cli.jar
java -jar openapi-generator-cli.jar list
java -jar openapi-generator-cli.jar generate -i openapi.yaml -g python -o out/pythonOption C — npm wrapper (single-binary, no Java)
npm install -g @openapitools/openapi-generator-cli
openapi-generator-cli version-manager set 7.6.0
openapi-generator-cli generate -i openapi.yaml -g go -o out/goPin a specific version (openapi-generator-cli version-manager set 7.6.0) so
generated output is reproducible across machines.
Generator Types
Client
Generates a typed SDK to call the API. Most common request.
openapi-generator-cli generate \
-i openapi.yaml -g typescript-fetch -o sdk/ts \
--additional-properties=supportsES6=true,npmName=my-api-sdk,npmVersion=1.0.0Common client generators: typescript-fetch, typescript-axios, python,
java, go, csharp-netcore, ruby, php, rust, kotlin, swift5, dart.
Server
Generates a server stub with routing, models, and (optionally) business-logic stubs you fill in.
openapi-generator-cli generate \
-i openapi.yaml -g spring -o server/java \
--additional-properties=interfaceOnly=true,useSpringBoot3=trueCommon server generators: spring (Java), flask / fastapi (Python),
express (Node), go-server, aspnetcore (C#), ruby-on-sinatra, php-symfony.
Use interfaceOnly=true to emit just the interfaces/models — ideal when you
already have a framework set up and only want the contract types.
Documentation
# Static HTML2 docs
openapi-generator-cli generate -i openapi.yaml -g html2 -o docs/html
# Markdown
openapi-generator-cli generate -i openapi.yaml -g markdown -o docs/md
# AsciiDoc
openapi-generator-cli generate -i openapi.yaml -g asciidoc -o docs/asciiOther doc-ish generators: openapi (normalizes/re-exports the spec),
openapi-yaml, redoc (bundles Redoc viewer), confluencewiki.
Language Support
OpenAPI Generator supports 50+ targets. The agent should verify the exact
generator name before invoking — names are case-sensitive and change between
versions. Run list (Docker/JAR) or openapi-generator-cli list (npm) and grep
for the language.
docker run --rm openapitools/openapi-generator-cli list | grep -i typescriptHigh-traffic families and their canonical generator names:
| Family | Generator(s) |
| TypeScript | typescript-fetch, typescript-axios, typescript-node |
| Python | python, python-fastapi |
| Go | go, go-server |
| Java | java, spring |
| C# | csharp-netcore, aspnetcore |
| Rust | rust, rust-server |
| Kotlin | kotlin, kotlin-spring |
| Swift | swift5 |
| PHP | php, php-symfony, php-laravel |
| Ruby | ruby, ruby-on-sinatra |
If a user asks for a language not listed by list, tell them it is unsupported
rather than guessing a generator name — a wrong name fails loudly.
Customization
Generators are configured with --additional-properties (comma-separated
key=value) and -c config.json for many properties.
openapi-generator-cli generate -i openapi.yaml -g python -o out/python \
-c config.jsonconfig.json:
{
"packageName": "my_api_client",
"projectName": "my-api-client",
"packageVersion": "2.1.0",
"generateSourceCodeOnly": false,
"useOneOfDiscriminatorLookup": true
}Useful properties (generator-specific — always confirm with config-help):
openapi-generator-cli config-help -g typescript-fetchuseOneOfDiscriminatorLookup,useInlineModelResolver— shape of models.enumClassPrefix,enumNameMappings— enum naming.hideGenerationTimestamp— settrueto keep diffs clean in version control.sourceFolder,apiPackage,modelPackage— output layout.
For deeper changes (custom templates, license headers, naming), use the
-t templates/ flag to supply a Mustache template directory. Copy the default
templates first:
openapi-generator-cli author template -g typescript-fetch -o my-templates/Validation
Validate the spec before generating — most failures trace back to an invalid or partially-resolved spec.
# Built-in structural validation
openapi-generator-cli validate -i openapi.yaml
# Stronger linting with Spectral (separate tool)
npm install -g @stoplight/spectral-cli
spectral lint openapi.yamlWorkflow the agent should follow:
validatethe spec — fix schema/reference errors first.list/config-helpto confirm generator name and properties.generateinto a clean output directory.- Inspect the output: does
out/<lang>/README.md/ build file exist? - For client/server, optionally compile/build the generated project to confirm it is non-trivial and importable.
# Example check after generating a Python client
cd out/python && python -m pip install -e . && python -c "import openapi_client"Common Pitfalls
- Forgetting to mount the spec into Docker. Omitting
-v "${PWD}:/local"means the container can't see your spec and silently writes nothing where you expect. Always bind the working directory. - Remote
$refs break in air-gapped runs. Remote (URL)$refs resolve fine online but fail with no network access. Bundle first withopenapi-generator-cli mergeorswagger-cli bundleto inline all references. - Version drift produces different code on different machines. Pin the CLI version (
version-manager set 7.6.0) and record it in the generated project's README or a Makefile/CI step. - Overwriting hand-written code. Never generate into a directory that contains source you've edited — a regeneration silently clobbers your changes. Use
interfaceOnly=trueor generate into a dedicatedgenerated/subtree and import it. hideGenerationTimestampleft off in committed code. Leave it off while debugging, but set ittruebefore committing so every regeneration doesn't create a noisy timestamp-only diff.- Case-sensitive generator names.
TypeScript-Fetchfails outright; the correct name istypescript-fetch. Always copy the exact string fromlistrather than guessing casing. - JVM runs out of memory on large specs. The JAR path can OOM on big specs. Raise the heap:
java -Xmx2g -jar openapi-generator-cli.jar generate .... - OpenAPI 3.1 features aren't fully supported by every generator. Webhooks and some discriminator patterns lag behind on certain generators. If a 3.1 spec fails, try converting to 3.0 first with
openapi-generator-cli mergeorswagger2openapi. - Hand-resolving merge conflicts inside generated folders. Treat generated code as a build artifact — regenerate rather than resolve Git conflicts inside it.
- Docker writes output owned by root. Add
--user $(id -u):$(id -g)to thedocker runcommand so generated files aren't root-owned on the host.
Verification Checklist
openapi-generator-cli validate -i <spec>passes with no schema/reference errors before generating- The exact generator name was confirmed via
list(case-sensitive), not guessed - Output directory contains the expected files (
README.md, build file, model/client sources) after generation - For client SDKs: the generated project actually installs/builds/imports (e.g.
pip install -e .thenimport <package>succeeds) - Generated output was written to a dedicated directory, not one containing hand-edited source
- CLI version used is recorded (README, Makefile, or CI config) so regeneration is reproducible
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

