Skip to content

sheets: Client implementation assumes Vec<Vec<String>> but numbers are possible #112

Description

@webern

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions