-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
In Spin 2.0.1, the Rust template referenced the http crate, and we supported the Json<T> extractor as a body type parameter e,g, http::Request<Json<Person>>.
In Spin 2.1, the Rust template does not reference the http crate and users are directed instead to the spin_sdk::http::Request type. This type is not generic - the body is always presented as bytes - and we do not have seem to have samples of how to use the extractors with it. I guess you can do something like Jsion::<Person>::try_from_body(req.into_body()) but it's not as friendly as the extractor syntax!
If the extractors work with the SDK request type, it would be good to provide samples that show how; if they don't, we should provide that functionality.
Metadata
Metadata
Assignees
Labels
No labels