fastly-rust icon indicating copy to clipboard operation
fastly-rust copied to clipboard

`fastly_api::apis::kv_store_item_api::set_value_for_key` fails to deserialize response body

Open 0rphon opened this issue 1 year ago • 1 comments

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.

0rphon avatar Jun 11 '24 21:06 0rphon

Updating this ticket to mark that an internal ticket exists to track this issue.

harmony7 avatar Jan 20 '25 04:01 harmony7