Skip to content

fastly_api::apis::kv_store_item_api::set_value_for_key fails to deserialize response body #11

@0rphon

Description

@0rphon

Version
fastly-api = "4.6.0"

What happened

The following successfully adds the key to the kv store, but returns an error when deserializing the response body:

use fastly_api::apis::configuration::{ApiKey, Configuration};
use fastly_api::apis::kv_store_item_api::{set_value_for_key, SetValueForKeyParams};

#[tokio::main]
async fn main() {
    let mut config = Configuration {
        api_key: Some(ApiKey {
            prefix: None,
            key: "OMITTED".into(),
        }),
        ..Default::default()
    };
    let params = SetValueForKeyParams {
        store_id: "OMITTED".into(),
        key_name: "test".into(),
        body: Some("test".into()),
        ..Default::default()
    };
    let out = set_value_for_key(&mut config, params).await;
    dbg!(out);
}

output:

[src/main.rs:20:5] out = Err(
    Serde(
        Error("EOF while parsing a value", line: 1, column: 0),
    ),
)

the equivalent curl command works fine. im assuming this is because the function expects the endpoint to return a string, but the actual endpoint response doesn't contain a body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions