Skip to content

Support generics in route handlers? #38

@Jaltaire

Description

@Jaltaire

When trying to apply the #[oasgen] macro to a route handler like this:

#[oasgen]
pub(super) async fn version_post<D>(
    State(_state): State<AppState<D>>,
    Json(payload): Json<RequestBody>,
) -> Result<OkResponse, ErrResponse>
where
    D: Debug,
{
    // route handler implementation
}

We get an error: Cannot find type "D" in this scope.

Is it possible to add retention of generics to the #[oasgen] macro generation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions