The sheets crate deserializes Spreadsheet value range responses as Vec<Vec<String>>, however when using ValueRenderOption::Formula or ValueRenderOption::UnformattedValue the Google sheets API will return numbers as JSON number values.
The problem is here:
|
serde_json::from_slice::<Out>(&response_body)? |
Ultimately being called from here:
Where the type Out is ValueRange which has type: Vec<Vec<String>>, but the actual JSON has number values in it. Perhaps it's a bug in the API specification?
My ugly hack is to turn them into strings, and this diff can also help visualize the problem:
https://github.com/oxidecomputer/third-party-api-clients/compare/0861ac206f597ddc709508ef711692576b761389...webern:oxide-third-party-api-clients:patch-v1?expand=1
The
sheetscrate deserializes Spreadsheet value range responses asVec<Vec<String>>, however when usingValueRenderOption::FormulaorValueRenderOption::UnformattedValuethe Google sheets API will return numbers as JSON number values.The problem is here:
third-party-api-clients/google/sheets/src/lib.rs
Line 723 in 0861ac2
Ultimately being called from here:
third-party-api-clients/google/sheets/src/spreadsheets.rs
Line 222 in 0861ac2
Where the type
OutisValueRangewhich hastype: Vec<Vec<String>>, but the actual JSON has number values in it. Perhaps it's a bug in the API specification?My ugly hack is to turn them into strings, and this diff can also help visualize the problem:
https://github.com/oxidecomputer/third-party-api-clients/compare/0861ac206f597ddc709508ef711692576b761389...webern:oxide-third-party-api-clients:patch-v1?expand=1