mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-10-21 05:23:19 +00:00
fix(dock): serialize claudeProfiles in camelCase on DockQuota::Ready (#1594)
serde's rename_all on an internally tagged enum only renames the variant tag, not the fields of a struct-like variant, so this field shipped as claude_profiles. The frontend reads answer.claudeProfiles, so the Claude profiles settings row and the per-config dock rings from #1570 never showed. Adds a field-level rename plus a test pinning the serialized key.
This commit is contained in:
parent
986d72ce1e
commit
d3929746ae
1 changed files with 13 additions and 0 deletions
|
|
@ -151,6 +151,8 @@ pub struct CliStatus {
|
|||
pub enum DockQuota {
|
||||
Ready {
|
||||
providers: Value,
|
||||
/// `rename_all` above only covers the variant tag, not this field.
|
||||
#[serde(rename = "claudeProfiles")]
|
||||
claude_profiles: Option<Value>,
|
||||
},
|
||||
CliOutdated,
|
||||
|
|
@ -1174,6 +1176,17 @@ mod which {
|
|||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn dock_quota_ready_serializes_claude_profiles_as_camel_case() {
|
||||
let answer = DockQuota::Ready {
|
||||
providers: serde_json::json!([]),
|
||||
claude_profiles: Some(serde_json::json!([{"id": "x"}])),
|
||||
};
|
||||
let value = serde_json::to_value(&answer).unwrap();
|
||||
assert!(value.get("claudeProfiles").is_some());
|
||||
assert!(value.get("claude_profiles").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn only_a_named_read_only_subcommand_opens_a_terminal() {
|
||||
assert!(is_allowed_subcommand(&["report"]));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue