You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the trait bound `UserAuthorization: OpenApiFromRequest<'_>` is not satisfied
the following other types implement trait `OpenApiFromRequest<'a>`:
&'r ContentType
&'r Host<'r>
&'r Limits
&'r Route
&'r rocket::Config
&'r rocket::State<T>
&'r rocket::http::Accept
&'r rocket::http::CookieJar<'r>
and 8 others
I feel like this UserAuthorization - which exists to implement an authentication guard - should not be part of the API spec. But it also seems like this might be a common pattern so maybe I am unaware of how to make okapi do the right thing?
The text was updated successfully, but these errors were encountered:
If you just want to ignore it: See #113 (recent addition, not released yet, only in master)
But you might also want to take a look at this example: https://github.com/GREsau/okapi/tree/master/examples/secure_request_guard/src
This example shows how you can implement different authentication methods into the spec. This way you can still use the try buttons in the swagger/rapidoc. So definitely worth a look in my opinion.
I have an API implemented thus:
This generates an error:
I feel like this UserAuthorization - which exists to implement an authentication guard - should not be part of the API spec. But it also seems like this might be a common pattern so maybe I am unaware of how to make okapi do the right thing?
The text was updated successfully, but these errors were encountered: