Description
Describe the bug
A clear and concise description of what the bug is.
Ref #1427 I'm working on creating a tool in Rust and I've used the open api and openapi-generator-cli to create some Rust bindings. This function was generated from the openapi-generator-cli so it's also possible this is the fault of that, but just in case I'm reporting here as well. This particular function is supposed to return an array of evals (just like how the function for getting jobsets returns a json array of jobsets), at least that's what the function signature indicates, however what is actually returned is an object with a field "evals" which contains the array. This causes deserialization to fail.
To Reproduce
Steps to reproduce the behavior:
See #1427
Expected behavior
A clear and concise description of what you expected to happen.
I just expected the api to return an array of evals, just like it does for jobsets, since the api seems to indicate that's what it should return.
Screenshots
If applicable, add screenshots to help explain your problem.
Here's the code:
pub async fn jobset_project_id_jobset_id_evals_get(
configuration: &configuration::Configuration,
project_id: &str,
jobset_id: &str,
) -> Result<Vec<models::Evaluations>, Error<JobsetProjectIdJobsetIdEvalsGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}/jobset/{}/{}/evals",
local_var_configuration.base_path,
crate::apis::urlencode(project_id),
crate::apis::urlencode(jobset_id)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<JobsetProjectIdJobsetIdEvalsGetError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
Output as described above:
[hydra-api/src/apis/default_api.rs:502:9] &local_var_content = "{\"evals\":[{\"flake\":\"gitlab:sweng-infra/nix/f68b9802b2c32369aec7da31fa5088c3ab584d09\",\"timestamp\":1733370436,\"checkouttime\":0,\"builds\":[1200371,1200372,1200373,1200374,1200375,1200376,1200377,1200378,1200379,1200380,1200381,1200382,1200383,1200384,1200385,1200386,1200387,1200388,1200389,1200390,1200391,1200392,1200393,1200394,1200395,1200396,1200397,1200398,1200399,1200400,1200401,1200402,1200403,1200404,1200405,1200406,1200407,1200408,1200409,1200410,1200411],\"jobsetevalinputs\":{},\"evaltime\":356,\"id\":84895,\"hasnewbuilds\":1}],\"first\":\"?page=1\",\"last\":\"?page=1\"}"
Error: Error while attempting to list evaluations for jobset 'v2-34-devel/v2.34.0-20241205033931-0':
Serde(Error("invalid type: map, expected a sequence", line: 1, column: 0))
Hydra Server:
Please fill out this data as well as you can, but don't worry if you can't -- just do your best.
- OS and version: [e.g. NixOS 22.05.20211203.ee3794c]
- Version of Hydra
- Version of Nix Hydra is built against
- Version of the Nix daemon
Additional context
Add any other context about the problem here.