-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
derive ToSchema fails for types using generics #574
Comments
Oh, the scenario with generics having Perhaps the manual implementation is better, but there is the overhead of double declaring the properties. I posted a example of manual implementation with |
@jayvdb I had an issue like this, only it involved
|
Apart from that there are few alternatives one might consider when creating |
Created #588 showing some of the limitations and workarounds for generics. |
My colleague @joaommartins did some work on improving |
There is now new implementation for generics coming up in #1034 which should solve the issue with aliases approach. |
Using
#[derive(ToSchema)]
on types likegeo_types::Coord
fails because it uses genericse.g. jayvdb/geo@9b2c876
becomes
The basic fix for this would be to recognise the
T: CoordNum = f64
, and usef64
for eachT
, and also fail if the struct was designed usingT: CoordNum
without any default type forT
, as in that case utoipa has a lot more work to do in order to know whatCoordNum
might be.The text was updated successfully, but these errors were encountered: