Skip to content

implement version extractor#28

Merged
marekzan merged 1 commit intomainfrom
feature/version_extractor
Apr 27, 2025
Merged

implement version extractor#28
marekzan merged 1 commit intomainfrom
feature/version_extractor

Conversation

@marekzan
Copy link
Owner

@marekzan marekzan commented Apr 27, 2025

API Versioning

  • Added ApiVersion enum and related logic to handle API version extraction and validation, enabling support for versioned API routes

Error Handling Improvements

  • Replaced ResourceError with ApiError throughout the codebase for a more consistent and descriptive error handling mechanism
  • Updated error handling in artifact and notifier endpoints to use ApiError and provide better error messages

Endpoint Enhancements

  • Added ApiVersion and OriginalUri parameters to artifact and notifier handlers to dynamically handle API versioning and URI-based error messages
  • Improved error responses for missing or invalid parameters in endpoints

@marekzan marekzan requested a review from Copilot April 27, 2025 12:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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());

@marekzan marekzan merged commit 85704c0 into main Apr 27, 2025
1 check passed
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.

2 participants