Replies: 1 comment 5 replies
-
Do you mean to inspect the content type and parse things based on that, without requiring a specific type? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Here's an API I keep looking for: you specify a single
MyRequest
type, you annotate it with#[derive(FromRequest, IntoRequest)]
, you annotate the contents with attributes that specify the way the type should be converted into HTTP requests and parsed back (like whether it should be parsed from resource name, from query string, from JSON body, etc.), and you're done.So instead of mixing the parsing logic with the handling logic in handler functions you write a single framework-agnostic Rust type, you annotate it with macros using the framework, and then you write a single framework-agnostic handler function that gets a single Rust type as input.
Sounds viable? Any previous discussions I should be aware of?
Beta Was this translation helpful? Give feedback.
All reactions