fix: add required dependencies automatically after generating - #71
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds post-generation dependency reporting (and optional installation) to make generated Rust output easier to compile by automatically surfacing the exact crates/features the emitters reference.
Changes:
- Add a new dependency scanner (
depsmodule) that infers required crates/features by scanning the generated source. - Extend the CLI to print a
Cargo.tomlsnippet +cargo addcommands after writing, and add--install-depsto runcargo addautomatically. - Update README/docs/examples to reflect the new dependency output and CLI flag.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates example output to show the new dependency note after generation. |
| examples/bookstore/README.md | Updates all example runs to include the new dependency note (server/models/client). |
| docs/configuration.md | Documents the new dependency reporting/installation behavior. |
| docs/cli.md | Documents the new --install-deps flag in the generated CLI reference. |
| crates/oapi-codegen/src/main.rs | Computes required deps from generated code; optionally runs cargo add based on TTY/flag. |
| crates/oapi-codegen/src/lib.rs | Exposes the new deps module from the library crate. |
| crates/oapi-codegen/src/deps.rs | Implements dependency detection + formatting as TOML snippet and cargo add args; includes unit tests. |
| crates/oapi-codegen/src/console.rs | Adds dependency reporting, prompting, and install status/failure output. |
| crates/oapi-codegen/src/cli.rs | Adds the --install-deps flag to the Clap CLI. |
dotkas
force-pushed
the
dotkas/dependency-report
branch
from
July 24, 2026 12:46
2ca4a2b to
bd4a45f
Compare
dotkas
force-pushed
the
dotkas/dependency-report
branch
from
July 24, 2026 14:57
bd4a45f to
4962075
Compare
Contributor
|
🎉 This PR is included in version 1.0.0-dev.14 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
dotkas
added a commit
that referenced
this pull request
Jul 27, 2026
Contributor
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.