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
error[E0277]: the trait bound `HeaderValue: From<&Vec<std::string::String>>` is not satisfied
--> catalog-api-v1/src/client.rs:2635:41
|
2635 | header_map.append("accept", HeaderValue::try_from(v)?);
| ^^^^^^^^^^^ the trait `From<&Vec<std::string::String>>` is not implemented for `HeaderValue`, which is required by `HeaderValue: TryFrom<&Vec<std::string::String>>`
|
= help: the following other types implement trait `From<T>`:
<HeaderValue as From<isize>>
<HeaderValue as From<i16>>
<HeaderValue as From<i32>>
<HeaderValue as From<i64>>
<HeaderValue as From<usize>>
<HeaderValue as From<u16>>
<HeaderValue as From<u32>>
<HeaderValue as From<u64>>
and 2 others
= note: required for `&Vec<std::string::String>` to implement `Into<HeaderValue>`
= note: required for `HeaderValue` to implement `TryFrom<&Vec<std::string::String>>`
In short, all that's necessary for this to compile is for the generated code to loop over the values in the Vec and append them individually rather than appending the entire Vec. Now, detecting that you have a Vec and special casing it may be another story that I'll leave as an exercise to the readerimplementor.
The text was updated successfully, but these errors were encountered:
Given this snippet from an OpenAPI spec:
You'll generate the following code:
This fails to compile:
In short, all that's necessary for this to compile is for the generated code to loop over the values in the
Vec
andappend
them individually rather than appending the entireVec
. Now, detecting that you have aVec
and special casing it may be another story that I'll leave as an exercise to thereaderimplementor.The text was updated successfully, but these errors were encountered: