-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: seqvarsAnnosQuery missing in OpenAPI spec #600
Conversation
Caution Review failedThe pull request is closed. WalkthroughThe changes in this pull request focus on the Rust implementation of the Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/server/run/annos_variant.rs (1)
Line range hint
2828-3024
: Consider refactoring the handler implementation for better maintainability and performance.The implementation is functionally correct but could be improved:
- Extract genome release parsing into a separate function for better reusability
- Reduce query cloning by storing the parsed query once
- Make error messages more descriptive for better debugging
Consider applying these changes:
+ fn parse_genome_release(release: &str) -> Result<GenomeRelease, CustomError> { + release.parse().map_err(|e: strum::ParseError| { + CustomError::new(anyhow::anyhow!( + "invalid genome release '{}': {}", + release, + e + )) + }) + } pub async fn handle_with_openapi( data: Data<crate::server::run::WebServerData>, _path: Path<()>, query: web::Query<SeqvarsAnnosQuery>, ) -> actix_web::Result<Json<SeqvarsAnnosResponse>, CustomError> { - let genome_release = query - .genome_release - .parse() - .map_err(|e: strum::ParseError| { - CustomError::new(anyhow::anyhow!("problem getting genome release: {}", e)) - })?; + let genome_release = parse_genome_release(&query.genome_release)?; + let query_inner = query.into_inner(); + let query_key: keys::Var = query_inner.clone().into();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/server/run/annos_variant.rs
(1 hunks)
🔇 Additional comments (2)
src/server/run/annos_variant.rs (2)
2827-2827
: Operation ID typo fix looks good!
The operation ID has been correctly updated from "seqvarsAnosQuery" to "seqvarsAnnosQuery", fixing the typo as intended.
Line range hint 1-2826
: Type definitions and implementations are well-structured!
The code demonstrates:
- Comprehensive type definitions for various annotation sources
- Consistent use of derive macros for serialization/deserialization
- Clear documentation for each type
- Proper error handling in type conversions
Summary by CodeRabbit
New Features
/api/v1/seqvars/annos
for querying annotations for a single variant.Bug Fixes
Improvements
Style