Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
0rphon opened this issue Jun 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@0rphon
Copy link

0rphon commented Jun 11, 2024

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 0rphon added the bug Something isn't working label Jun 11, 2024
@0rphon 0rphon changed the title fastly_api::apis::kv_store_item_api fails to deserialize response body fastly_api::apis::kv_store_item_api::set_value_for_key fails to deserialize response body Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant