fix(rapina): re-export validator crate to fix unresolved import with #[derive(Validate)]#2
Closed
richasdev wants to merge 1 commit into
Closed
fix(rapina): re-export validator crate to fix unresolved import with #[derive(Validate)]#2richasdev wants to merge 1 commit into
richasdev wants to merge 1 commit into
Conversation
validator_derive generates code hardcoding `validator::` paths. Downstream crates only depend on `rapina`, so the path was unresolvable — causing E0432/E0433 at compile time. `pub use validator;` makes `rapina::validator` a valid path, enabling `#[validate(crate = "rapina::validator")]` as the documented pattern. CLI templates (AGENT.md, CLAUDE.md, cursor rules) updated to surface this requirement when users add `Validate` to their structs. Closes rapina-rs#511
|
Thanks for your first PR! A maintainer will review it shortly. Make sure CI passes and take a look at our contributing guide if you haven't already. |
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.
Summary
pub use validator;torapina/src/lib.rssorapina::validatorresolves as a path#[validate(crate = "rapina::validator")]requirement in all CLI-generated AI config files (AGENT.md, CLAUDE.md, cursor rules)Root cause
validator_derivehardcodesvalidator::in the generated code. Downstream projects only listrapinaas a dependency — notvalidator— so the compiler cannot resolve the path, producing E0432/E0433.Adding
pub use validator;at the crate root makesrapina::validatora valid path, which is exactly what the#[validate(crate = "...")]attribute requires.Test plan
cargo check -p rapinapassescargo check -p rapina-clipassescargo test -p rapina-cli— 123 passed, 0 failedCloses rapina-rs#511