oxidecomputer / oxidecomputer/third-party-api-clients
sheets: Client implementation assumes `Vec<Vec<String>>` but numbers are possible
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 150
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
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:
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:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in google/sheets/src/lib.rs around line 723, then follow the ValueRange use in google/sheets/src/spreadsheets.rs around line 222. Inspect how spreadsheet value range responses are deserialized for ValueRenderOption::Formula and ValueRenderOption::UnformattedValue. Done means responses containing JSON numbers deserialize successfully instead of assuming every value is a string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100