openapi-generator output didn't compile - the agent never ran the build and shipped a client with missing imports
Fixes shipped clients that fail to compile because openapi-generator output was never built. Use when generated code arrives with missing imports or syntax errors and nobody ran the compiler. Not for compile errors in hand-written code, or for runtime errors in code that builds fine.
TL;DR
Run the build on the generated output before it ships, fix or regenerate the broken imports, and the client compiles. The generator emits code with bad imports sometimes; the agent just never compiled it.
Make the build a mandatory gate: generated code that does not compile never leaves the machine that generated it.
Verbatim query
openapi-generator output didn't compile - the agent never ran the build and shipped a client with missing importsSteps
- Reproduce the compile failure locally
Check out the generated client and run its build command with no changes. Capture the full compiler output - missing imports are usually named explicitly. Expected: The build fails on the pristine generated output, naming the missing imports.
- Fix or regenerate the imports
If the imports are fixable by hand, patch them and note the patch for the next regen. If the generator config is wrong, fix the config and regenerate instead of hand-patching. Expected: The build passes after the fix or regen.
- Check for the usual generator bugs
Look for imports the spec implies but never declares, and for name collisions the generator mangled. Verify template overrides or custom mappings are not stale. Expected: You can name the generator-side cause, not just patch the symptom.
- Add the build as a generation gate
Script it: generate, then immediately build, and fail the pipeline on any compile error. Store the patch script so the next regen applies known fixes automatically. Expected: A regen that produces broken code fails in CI instead of shipping.
- Smoke-test the compiled client
Run one real call against the sandbox with the compiled client. Confirm the previously missing imports are actually exercised. Expected: The compiled client makes a real call successfully.
Use this when
- Generated client code fails to compile out of the generator
- Shipped code crashes at import time because the generator dropped imports
- An agent declared a client done without ever running the build
Not for this skill when
- The code compiles and fails at runtime - that is a logic or spec problem
- Compile errors are in code the agent wrote by hand - review it like normal code
- The build fails on dependencies, not generated code - that is a packaging problem
Variant phrasings
generated client does not compile
openapi-generator output is a starting draft, not shippable code; the build is the first quality gate.
missing imports in generated code
The classic generator bug: types referenced in signatures but never imported in the file.
shipped uncompiled generated client
If nobody ran the compiler, nobody tested anything. The build gate is the minimum viable review.
Why it happens
Generators translate specs to code mechanically, and specs are full of implied references the generator does not resolve: an import the example assumes, a type the schema hints at but never declares. The output compiles on happy-path specs and breaks on real ones. The agent skipped the one step that catches this - running the build - because generation felt like the hard part.
Edge cases
- Some generators need a specific version to produce compiling output - pin the generator version and test upgrades
- Language targets vary wildly in quality: the python and java generators are battle-tested, niche targets are not
- Template customizations drift: a custom template that worked last year may break on the new generator version
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_K7YJyEX6l0qxy670Z4BUew
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.