-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: /api/v1/seqvars/csq endpoint with OpenAPI (#606) #614
feat: /api/v1/seqvars/csq endpoint with OpenAPI (#606) #614
Conversation
…alternative-with-openapi-schema-for-genestxs
…alternative-with-openapi-schema-for-strucvarscsq
WalkthroughThe changes in this pull request primarily involve enhancements to the schema generation and API documentation for the sequence variant annotation process. The Changes
Possibly related issues
Possibly related PRs
Poem
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 (
|
8fa243a
to
97a7df0
Compare
…r-strucvarscsq' into 606-provide-endpoint-alternative-with-openapi-schema-for-seqvarscsq
…alternative-with-openapi-schema-for-seqvarscsq
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 (5)
src/server/run/mod.rs (1)
Line range hint
141-146
: Remove duplicate example URL.This example URL for
/strucvars/csq
endpoint is identical to the one above (lines 134-139) and should be removed.src/annotate/seqvars/ann.rs (1)
454-463
: Consider adding snake_case serializationFor consistency with other enums in the codebase, consider adding the
serde(rename_all = "snake_case")
attribute.#[derive( Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Display, serde::Deserialize, serde::Serialize, utoipa::ToSchema, )] +#[serde(rename_all = "snake_case")] pub enum FeatureType {
src/server/run/actix_server/seqvars_csq.rs (3)
44-46
: Ensure consistent serialization by adding#[serde(rename_all = "snake_case")]
toSeqvarsCsqResultEntry
To maintain serialization consistency across your API structs, consider adding
#[serde(rename_all = "snake_case")]
to theSeqvarsCsqResultEntry
struct.Apply this diff to include the attribute:
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)] +#[serde(rename_all = "snake_case")] pub(crate) struct SeqvarsCsqResultEntry { /// The consequences of the allele. pub consequences: Vec<Consequence>,
82-83
: Ensure consistent serialization by adding#[serde(rename_all = "snake_case")]
toSeqvarsCsqResponse
Similarly, to keep the serialization consistent, consider adding
#[serde(rename_all = "snake_case")]
to theSeqvarsCsqResponse
struct.Apply this diff to include the attribute:
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, utoipa::ToSchema)] +#[serde(rename_all = "snake_case")] pub(crate) struct SeqvarsCsqResponse { /// Version information.
195-204
: Mark the deprecated endpoint with a deprecation attributeTo inform users about the deprecation of the
/seqvars/csq
endpoint, consider annotating thehandle
function with the#[deprecated]
attribute. This will generate compiler warnings for any usage of the deprecated endpoint.Apply this diff to mark the function as deprecated:
+#[deprecated( + since = "1.0.0", + note = "Please use the /api/v1/seqvars/csq` endpoint instead" +)] #[allow(clippy::unused_async)] #[get("/seqvars/csq")] async fn handle( data: Data<super::WebServerData>, _path: Path<()>, query: web::Query<SeqvarsCsqQuery>, ) -> actix_web::Result<Json<SeqvarsCsqResponse>, super::CustomError> { handle_impl(data, _path, query).await }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
src/annotate/seqvars/ann.rs
(8 hunks)src/server/run/actix_server/seqvars_csq.rs
(6 hunks)src/server/run/mod.rs
(2 hunks)
🔇 Additional comments (13)
src/server/run/mod.rs (4)
19-21
: LGTM: Well-organized imports for sequence variant consequence types.
The imports are logically grouped and align with the PR objective of adding the /api/v1/seqvars/csq
endpoint.
Also applies to: 27-29
37-37
: LGTM: Consistent import for seqvars_csq module.
59-68
: LGTM: Comprehensive schema registration for sequence variant consequence types.
The schema registration is well-organized and includes all necessary types for the sequence variant consequence endpoint.
42-46
: 🛠️ Refactor suggestion
Update example URLs in print_hints function.
The OpenAPI path registration looks good. However, I noticed that the example URLs in the print_hints
function (around line 120) still use the old endpoint path /seqvars/csq
instead of /api/v1/seqvars/csq
.
Update the example URLs in the print_hints
function to use the new endpoint path /api/v1/seqvars/csq
.
src/annotate/seqvars/ann.rs (7)
30-30
: LGTM: ToSchema derive macro addition
The addition of utoipa::ToSchema
derive macro is appropriate for OpenAPI schema generation.
58-58
: LGTM: ToSchema derive macro with rich documentation
The addition of utoipa::ToSchema
derive macro will expose the comprehensive variant documentation in the OpenAPI schema.
445-445
: LGTM: ToSchema derive macro addition
The addition of utoipa::ToSchema
derive macro is appropriate for OpenAPI schema generation.
501-501
: LGTM: ToSchema and consistent serialization
The addition of utoipa::ToSchema
and serde(rename_all = "snake_case")
ensures consistent schema generation and serialization.
Also applies to: 503-503
535-535
: LGTM: ToSchema derive macro addition
The addition of utoipa::ToSchema
derive macro is appropriate for OpenAPI schema generation.
557-566
: LGTM: Comprehensive derive macros
The addition of derive macros including utoipa::ToSchema
is appropriate and well-structured.
645-645
: Verify serialization format consistency
There's a potential inconsistency between the Display style (SNAKE_CASE
) and serde rename style (snake_case
). Verify if this difference is intentional and aligns with the API requirements.
Also applies to: 648-648
src/server/run/actix_server/seqvars_csq.rs (2)
208-218
: Great job integrating OpenAPI documentation for the new endpoint
The addition of OpenAPI documentation for the /api/v1/seqvars/csq
endpoint enhances the API's clarity and maintainability. This helps users interact with the API more effectively.
Line range hint 153-174
: Verify the transformation of feature_biotype
to prevent data loss
The current logic simplifies feature_biotype
to either Coding
or Noncoding
, potentially losing detailed biotype information (e.g., miRNA
, lncRNA
, etc.). Please verify that this simplification is intentional and will not affect other parts of the system that may rely on the full biotype data.
Run the following script to check for usages of feature_biotype
in the codebase that might require the detailed biotype information:
✅ Verification successful
Let me analyze the search results and generate additional verification scripts to understand how the feature biotype is used in the codebase.
The first pattern will help us understand what values are possible in the FeatureBiotype enum, and the second pattern will show us how feature_biotype is used in function implementations. This will help us determine if the simplification to Coding/Noncoding with additional tags is a valid approach.
Let me try a different approach to understand the FeatureBiotype enum and its usage.
This should help us understand the enum variants and how they're used throughout the codebase.
The feature biotype transformation is correctly implemented
The code's handling of feature_biotype
is well-designed and preserves all necessary information:
- The main biotype is simplified to either
Coding
orNoncoding
in thefeature_biotype
field - Additional biotype information (MANE Select, MANE Plus Clinical) is preserved in the
feature_tag
field - This matches the
FeatureBiotype
enum design which has four variants:Coding
,Noncoding
,ManeSelect
, andManePlusClinical
The codebase consistently uses this pattern, with feature_biotype.contains(&FeatureBiotype::Coding)
checks for coding status, while preserving additional biotype information in tags. No information is lost in this transformation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for usages of `feature_biotype` in the codebase.
# Test: Find all occurrences. Expectation: No critical dependencies on the full biotype list.
rg 'feature_biotype'
Length of output: 24956
Script:
#!/bin/bash
# Check the FeatureBiotype enum definition and its usage in type definitions
ast-grep --pattern 'enum FeatureBiotype {
$$$
}'
# Check how feature_biotype is used in function implementations
ast-grep --pattern 'fn $name($_) {
$$$
feature_biotype
$$$
}'
Length of output: 122
Script:
#!/bin/bash
# Search for FeatureBiotype enum definition
rg -A 10 "enum FeatureBiotype"
# Search for functions that process feature_biotype
rg -A 5 "fn.*feature_biotype"
# Look for any direct usage of FeatureBiotype variants other than Coding/Noncoding
rg "FeatureBiotype::"
Length of output: 3118
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: 1
🧹 Outside diff range and nitpick comments (8)
src/server/run/actix_server/seqvars_csq.rs (4)
Line range hint
22-42
: Consider enhancing field documentation.While the structure is well-designed, consider adding examples or format specifications to the documentation of string fields like
chromosome
,reference
, andalternative
to help API users understand the expected input format.Example improvement:
/// SPDI sequence. + /// Example: "chr1" or "1" pub chromosome: String, /// SPDI deletion. + /// Example: "A" for a single base or "ATG" for multiple bases pub reference: String,
Line range hint
43-89
: Consider clarifying feature_tag field naming and documentation.The
feature_tag
field name is singular but contains a Vec (plural). Additionally, its relationship withfeature_biotype
could be better documented.Suggested improvements:
/// The feature biotype. + /// Primary biotype classification (either Coding or Noncoding) pub feature_biotype: FeatureBiotype, - /// The feature tags. + /// Additional feature biotype tags excluding the primary classification - pub feature_tag: Vec<FeatureBiotype>, + pub feature_tags: Vec<FeatureBiotype>,
Line range hint
152-183
: Consider optimizing feature biotype handling.The current implementation performs multiple heap allocations and iterations over feature biotypes. This could be optimized for better performance.
Consider this optimization:
- feature_biotype: if feature_biotype.contains(&FeatureBiotype::Coding) { - FeatureBiotype::Coding - } else { - FeatureBiotype::Noncoding - }, - feature_tag: feature_biotype - .iter() - .cloned() - .filter(|b| *b != FeatureBiotype::Coding && *b != FeatureBiotype::Noncoding) - .collect(), + feature_biotype: { + let is_coding = feature_biotype.contains(&FeatureBiotype::Coding); + if is_coding { FeatureBiotype::Coding } else { FeatureBiotype::Noncoding } + }, + feature_tag: { + let mut tags = Vec::with_capacity(feature_biotype.len()); + for biotype in feature_biotype { + if biotype != FeatureBiotype::Coding && biotype != FeatureBiotype::Noncoding { + tags.push(biotype); + } + } + tags + },
207-218
: Enhance OpenAPI documentation with more details.Consider adding more descriptive OpenAPI documentation to improve API discoverability and usability.
Add more context to the OpenAPI attributes:
#[utoipa::path( get, operation_id = "seqvarsCsq", + description = "Predict consequences of sequence variants using SPDI notation", + tag = "Sequence Variants", params( SeqvarsCsqQuery ), responses( - (status = 200, description = "Seqvars consequence information.", body = SeqvarsCsqResponse), + (status = 200, description = "Successfully predicted variant consequences", body = SeqvarsCsqResponse), (status = 500, description = "Internal server error.", body = CustomError) ) )]openapi.schema.yaml (4)
12-70
: Enhance API documentation with examples and rate limiting info.While the endpoint is well-structured, consider adding:
- Example values for each parameter to improve developer experience
- Rate limiting information if applicable
- More detailed description of the endpoint's purpose and use cases
Example enhancement:
/api/v1/seqvars/csq: get: tags: - seqvars_csq - summary: Query for consequence of a variant. + summary: Query for predicted consequences of a sequence variant. + description: | + Predicts the functional consequences of sequence variants using genomic coordinates. + Rate limit: X requests per minute. + + Example query: + ``` + GET /api/v1/seqvars/csq?genome_release=grch37&chromosome=chr17&position=41234451&reference=A&alternative=G + ```
310-429
: Enhance schema documentation for nullable fields.The response schema is well-structured but could benefit from more detailed documentation for nullable fields. Consider adding:
- Conditions when fields are null
- Examples of typical values
Example enhancement for
hgvs_t
field:hgvs_t: type: string - description: HGVS c. notation. + description: | + HGVS c. notation for transcript variant. + Null when variant is not within or near a transcript. + Example: "c.123A>G" nullable: true
Line range hint
154-297
: Add descriptions for enum values and examples for complex types.The enum schemas are comprehensive but could be more developer-friendly with:
- Descriptions for individual enum values
- Examples for complex types like
FeatureType
Example enhancement for
Consequence
enum:Consequence: type: string - description: Putative impact. + description: | + Predicted consequence of the variant. + Values are aligned with Sequence Ontology terms. enum: - transcript_ablation # Complete destruction of transcript - exon_loss_variant # Loss of exon(s) - splice_acceptor_variant # Change in splice acceptor site # ... (add descriptions for other values)Example for
FeatureType
:FeatureType: oneOf: - type: object required: - so_term properties: so_term: type: object required: - term properties: term: $ref: '#/components/schemas/SoFeature' - type: object required: - custom properties: custom: type: object required: - value properties: value: type: string description: Enum for `AnnField::feature_type`. + example: + so_term: + term: "Transcript"
Line range hint
1-11
: Consider adding security scheme definitions.The API specification would benefit from explicit security definitions. Consider adding:
- Authentication requirements (if any)
- API key or OAuth2 configurations
- CORS policies
Example addition:
info: title: mehari description: Variant effect prediction all in Rust + security: + - apiKey: [] # If API key auth is used + - bearerAuth: [] # If bearer token auth is used +components: + securitySchemes: + apiKey: + type: apiKey + in: header + name: X-API-Key + bearerAuth: + type: http + scheme: bearer
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (73)
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193311167-ATGT-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193311170-TGGC-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193311170-TGGCG-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193311180-GTCG-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193409910-GAAA-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_del_opa1_csqs@3-193409913-ATAA-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197820-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197821-A-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197822-C-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197823-C-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197824-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197825-C-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197835-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197836-G-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41197837-G-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199651-C-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199652-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199653-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199654-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199655-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199656-A-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199657-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199658-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199659-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_csq@17-41199660-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41196309-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41196310-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41196311-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41196312-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41196313-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197701-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197818-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197819-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197820-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197821-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197822-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41197823-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277379-A-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277380-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277381-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277382-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277383-A-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_one_variant@17-41277384-G-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_transcript_picking_reporting@17-41197701-G-C-false-false.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_transcript_picking_reporting@17-41197701-G-C-false-true.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_transcript_picking_reporting@17-41197701-G-C-true-false.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_brca1_transcript_picking_reporting@17-41197701-G-C-true-true.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332503-T-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332504-T-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332505-C-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332506-T-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332507-T-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332508-T-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332509-C-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332510-A-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332511-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332512-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332831-G-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332832-T-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332833-G-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332834-A-C.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332835-A-T.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332836-C-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332837-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332838-T-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332839-G-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332846-A-G.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332847-G-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_opa1_csq@3-193332848-T-A.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_ttn_transcript_picking_reporting@2-179631246-G-A-false-false.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_ttn_transcript_picking_reporting@2-179631246-G-A-false-true.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_ttn_transcript_picking_reporting@2-179631246-G-A-true-false.snap
is excluded by!**/*.snap
src/annotate/seqvars/snapshots/mehari__annotate__seqvars__csq__test__annotate_snv_ttn_transcript_picking_reporting@2-179631246-G-A-true-true.snap
is excluded by!**/*.snap
📒 Files selected for processing (5)
openapi.schema.yaml
(3 hunks)src/annotate/seqvars/ann.rs
(8 hunks)src/server/run/actix_server/mod.rs
(1 hunks)src/server/run/actix_server/seqvars_csq.rs
(6 hunks)src/server/run/mod.rs
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/annotate/seqvars/ann.rs
- src/server/run/mod.rs
🔇 Additional comments (2)
src/server/run/actix_server/mod.rs (1)
64-64
: LGTM! Good addition of OpenAPI documentation.
The addition of seqvars_csq::handle_with_openapi
service follows the established pattern and enhances API documentation.
src/server/run/actix_server/seqvars_csq.rs (1)
1-3
: LGTM! Clear documentation of endpoint paths and deprecation status.
The file documentation clearly indicates both the new /api/v1/seqvars/csq
endpoint and the deprecated /seqvars/csq
endpoint.
@@ -61,6 +61,7 @@ pub async fn main( | |||
.service(gene_txs::handle) | |||
.service(gene_txs::handle_with_openapi) | |||
.service(seqvars_csq::handle) | |||
.service(seqvars_csq::handle_with_openapi) |
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.
💡 Codebase verification
Missing handle_with_openapi
implementation for versions endpoint
The versions
module only implements the handle
function but lacks the corresponding handle_with_openapi
implementation, while all other endpoints (gene_txs
, seqvars_csq
, strucvars_csq
) consistently implement both. This inconsistency should be addressed by:
- Adding
handle_with_openapi
implementation insrc/server/run/actix_server/versions.rs
- Registering it in
src/server/run/actix_server/mod.rs
🔗 Analysis chain
Verify endpoint pattern consistency.
Let's verify that all endpoints follow the same pattern of having both handle
and handle_with_openapi
services.
Let me gather more specific information about the versions
endpoint since it appears to be missing the handle_with_openapi
service registration.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if all endpoints have both handle and handle_with_openapi implementations
# Search for handle function implementations
echo "Checking handle implementations:"
ast-grep --pattern 'fn handle($$$) {
$$$
}'
echo -e "\nChecking handle_with_openapi implementations:"
ast-grep --pattern 'fn handle_with_openapi($$$) {
$$$
}'
# Check service registrations in main function
echo -e "\nChecking service registrations in main:"
rg '\.service\((.*handle.*)\)' src/server/run/actix_server/mod.rs
Length of output: 781
Script:
#!/bin/bash
# Check if versions module has handle_with_openapi implementation
echo "Checking versions module for handle_with_openapi:"
rg -A 5 "mod versions" src/
rg "handle_with_openapi" src/ | grep -i "versions"
# Check the actual versions module implementation
echo -e "\nChecking versions module implementation:"
fd "versions.rs" --exec cat {}
Length of output: 5365
Summary by CodeRabbit
New Features
/api/v1/seqvars/csq
with enhanced query and response structures.Bug Fixes
/seqvars/csq
endpoint to streamline API usage.Documentation