Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the API routing and error handling by introducing an API version extractor and reorganizing module paths. Key changes include:
- Moving API endpoints from the resources module to a dedicated api module.
- Implementing a new version extractor in version.rs and integrating it into the endpoints.
- Replacing ResourceError with ApiError and updating error handling and route definitions accordingly.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| veno-web/src/server.rs | Updated import path to use the new API module for serve_api. |
| veno-web/src/resources/v1/mod.rs | Removed deprecated v1 routes now replaced by versioned API routes. |
| veno-web/src/main.rs | Cleaned up unused modules and adjusted module imports for the new API structure. |
| veno-web/src/api/version.rs | Added the version extractor implementation for API version management. |
| veno-web/src/api/openapi.rs | Updated module imports to reflect the new API structure. |
| veno-web/src/api/notifiers/handlers.rs | Integrated API version extraction and updated error handling. |
| veno-web/src/api/mod.rs | Reorganized module structure and updated API route nesting. |
| veno-web/src/api/errors.rs | Renamed ResourceError to ApiError and adjusted related functions. |
| veno-web/src/api/artifacts/handlers.rs | Integrated API version extraction, refactored error types, and updated endpoint implementations. |
| veno-core/src/app.rs | Updated function calls to match new signature of message functions. |
Comments suppressed due to low confidence (2)
veno-web/src/api/artifacts/handlers.rs:28
- Typo in the description text: 'Retursn' should be 'Returns'.
(status= OK, description = "Retursn a message if there are no new versions", body = serde_json::Value),
veno-web/src/api/artifacts/handlers.rs:96
- Typo in the variable name 'response_boddy'. Consider renaming it to 'response_body' for clarity.
let response_boddy = ArtifactResponse::from(artifact.clone());
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.
API Versioning
ApiVersionenum and related logic to handle API version extraction and validation, enabling support for versioned API routesError Handling Improvements
ResourceErrorwithApiErrorthroughout the codebase for a more consistent and descriptive error handling mechanismApiErrorand provide better error messagesEndpoint Enhancements
ApiVersionandOriginalUriparameters to artifact and notifier handlers to dynamically handle API versioning and URI-based error messages