ApiOperationResponse is currently implemented for many common types, such as Json, Result, etc. However, it might be useful to use an enum, indicating that one of many responses might be returned. Currently though, one has to implement both IntoResponse and ApiOperationResponse manually for such enum. An example how the enum could look like can be seen below:
enum MyResponse {
A(Json<VariantAResponse>),
B(Json<VariantBResponse>),
}
This sounds like a perfect candidate for creating derive macros which would just take all the types from the variants and create IntoResponse and ApiOperationResponse that would call respective methods depending on the variant matched on self.
ApiOperationResponseis currently implemented for many common types, such asJson,Result, etc. However, it might be useful to use an enum, indicating that one of many responses might be returned. Currently though, one has to implement bothIntoResponseandApiOperationResponsemanually for such enum. An example how the enum could look like can be seen below:This sounds like a perfect candidate for creating derive macros which would just take all the types from the variants and create
IntoResponseandApiOperationResponsethat would call respective methods depending on the variant matched onself.