Skip to content

IntoParams does not support types with generics #1546

@Paul-E

Description

@Paul-E

On version 5.5, the following example

#[derive(utoipa::ToSchema, utoipa::IntoParams)]
#[into_params(parameter_in = Query)]
struct Foo<R: utoipa::ToSchema> {
    x: Option<R>,
}

produces the compiler error:

error[E0425]: cannot find value `generics` in this scope
 --> src/main.rs:8:15
  |
8 |     x: Option<R>,
  |               ^ not found in this scope

I'm not sure if this is intended and generics are not supported, or if this is a bug.

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