-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
C-macrosCrate: cot-macrosCrate: cot-macrosenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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.
Metadata
Metadata
Assignees
Labels
C-macrosCrate: cot-macrosCrate: cot-macrosenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers