Skip to content

feat(api): derive macros for TryFromConn and Handler - #802

Open
jbr wants to merge 1 commit into
mainfrom
api-derives
Open

feat(api): derive macros for TryFromConn and Handler#802
jbr wants to merge 1 commit into
mainfrom
api-derives

Conversation

@jbr

@jbr jbr commented May 3, 2026

Copy link
Copy Markdown
Contributor

An effort to address #688

There's likely further surface area that could be added eventually, such as:

#[derive(TryFromConn)]
struct CreatePost {
    #[api(state)]
    db: Db,

    #[api(body)]
    input: NewPostInput,

    #[api(header = "x-request-id")]
    request_id: String,

    #[api(param = "team_id")]
    team: TeamId,
}

@github-actions

github-actions Bot commented May 3, 2026

Copy link
Copy Markdown
Contributor

Public API Changes

Changes to trillium-api
impl core::default::Default for trillium_api::Halt
pub fn trillium_api::Halt::default() -> trillium_api::Halt
pub mod trillium_api::extractors::deriving
pub use trillium_api::Handler
pub use trillium_api::TryFromConn

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.23256% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.94%. Comparing base (5ee3d08) to head (520c418).
⚠️ Report is 205 commits behind head on main.

Files with missing lines Patch % Lines
api-macros/src/attributes.rs 69.35% 19 Missing ⚠️
api-macros/src/handler.rs 0.00% 18 Missing ⚠️
api-macros/src/try_from_conn.rs 71.05% 11 Missing ⚠️
api-macros/tests/test.rs 8.33% 11 Missing ⚠️
api-macros/src/lib.rs 0.00% 4 Missing ⚠️
api-macros/tests/integration.rs 98.76% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #802    +/-   ##
========================================
  Coverage   68.93%   68.94%            
========================================
  Files         337      343     +6     
  Lines       19312    19527   +215     
========================================
+ Hits        13313    13463   +150     
- Misses       5999     6064    +65     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant