Skip to content
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

Conversation

holtgrewe
Copy link
Contributor

@holtgrewe holtgrewe commented Nov 11, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new API endpoint /api/v1/seqvars/csq with enhanced query and response structures.
    • Added OpenAPI documentation for the new endpoint, improving API usability.
    • Updated schema generation for various data types to ensure consistent serialization.
  • Bug Fixes

    • Deprecated the old /seqvars/csq endpoint to streamline API usage.
  • Documentation

    • Enhanced OpenAPI documentation to include new paths and schemas related to sequence variant analysis.

@holtgrewe holtgrewe linked an issue Nov 11, 2024 that may be closed by this pull request
Copy link
Contributor

coderabbitai bot commented Nov 11, 2024

Walkthrough

The changes in this pull request primarily involve enhancements to the schema generation and API documentation for the sequence variant annotation process. The utoipa::ToSchema derive macro has been added to several enums and structs, ensuring consistent serialization formats. Additionally, the /seqvars/csq endpoint has been renamed to /api/v1/seqvars/csq, with corresponding updates to query and response structures. The API documentation has been expanded to include new paths and schemas related to the updated endpoint, improving clarity and organization.

Changes

File Path Change Summary
src/annotate/seqvars/ann.rs Added utoipa::ToSchema derive macro to PutativeImpact, Consequence, SoFeature, FeatureType, FeatureBiotype, Rank, Pos, and Message. Added #[serde(rename_all = "snake_case")] to FeatureType, FeatureBiotype, and Message.
src/server/run/actix_server/seqvars_csq.rs Renamed endpoint from /seqvars/csq to /api/v1/seqvars/csq. Updated query and response structures to SeqvarsCsqQuery and SeqvarsCsqResponse. Refactored handle function to call handle_impl, added handle_with_openapi.
src/server/run/mod.rs Updated OpenAPI documentation to include new paths and schemas for SeqvarsCsqQuery, SeqvarsCsqResponse, and SeqvarsCsqResultEntry.
openapi.schema.yaml Introduced new endpoint /api/v1/seqvars/csq with GET method and defined schemas for SeqvarsCsqQuery, SeqvarsCsqResponse, and other related types.
src/server/run/actix_server/mod.rs Added seqvars_csq::handle_with_openapi service to the main entry point function, enhancing server functionality.

Possibly related issues

Possibly related PRs

Poem

🐇 In the meadow where schemas grow,
New paths and types begin to flow.
With OpenAPI shining bright,
Our endpoints dance in the light.
From seqvars to csq we leap,
In rabbit holes of code, we keep! 🌼


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@holtgrewe holtgrewe changed the title feat: /api/v1/strucvars/csq endpoint with OpenAPI (#607) feat: /api/v1/seqvars/csq endpoint with OpenAPI (#607) Nov 11, 2024
@holtgrewe holtgrewe force-pushed the 606-provide-endpoint-alternative-with-openapi-schema-for-seqvarscsq branch from 8fa243a to 97a7df0 Compare November 11, 2024 09:17
@holtgrewe holtgrewe changed the title feat: /api/v1/seqvars/csq endpoint with OpenAPI (#607) feat: /api/v1/seqvars/csq endpoint with OpenAPI (#606) Nov 11, 2024
…r-strucvarscsq' into 606-provide-endpoint-alternative-with-openapi-schema-for-seqvarscsq
@holtgrewe holtgrewe marked this pull request as ready for review November 11, 2024 09:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 serialization

For 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")] to SeqvarsCsqResultEntry

To maintain serialization consistency across your API structs, consider adding #[serde(rename_all = "snake_case")] to the SeqvarsCsqResultEntry 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")] to SeqvarsCsqResponse

Similarly, to keep the serialization consistent, consider adding #[serde(rename_all = "snake_case")] to the SeqvarsCsqResponse 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 attribute

To inform users about the deprecation of the /seqvars/csq endpoint, consider annotating the handle 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

📥 Commits

Reviewing files that changed from the base of the PR and between cce8a6d and 45d0284.

📒 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:

  1. The main biotype is simplified to either Coding or Noncoding in the feature_biotype field
  2. Additional biotype information (MANE Select, MANE Plus Clinical) is preserved in the feature_tag field
  3. This matches the FeatureBiotype enum design which has four variants: Coding, Noncoding, ManeSelect, and ManePlusClinical

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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, and alternative 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 with feature_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:

  1. Example values for each parameter to improve developer experience
  2. Rate limiting information if applicable
  3. 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:

  1. Conditions when fields are null
  2. 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:

  1. Descriptions for individual enum values
  2. 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:

  1. Authentication requirements (if any)
  2. API key or OAuth2 configurations
  3. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 45d0284 and bd29217.

⛔ 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)
Copy link
Contributor

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 in src/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

@holtgrewe holtgrewe enabled auto-merge (squash) November 11, 2024 10:39
@holtgrewe holtgrewe merged commit 2fdf76e into main Nov 11, 2024
10 checks passed
@holtgrewe holtgrewe deleted the 606-provide-endpoint-alternative-with-openapi-schema-for-seqvarscsq branch November 11, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide endpoint alternative with OpenAPI schema for /seqvars/csq
1 participant