Skip to content

fix(flexible/databases): rename Database.activated to activated_on (wire field is activatedOn)#86

Merged
joshrotenberg merged 1 commit into
mainfrom
fix/database-activated-rename
May 15, 2026
Merged

fix(flexible/databases): rename Database.activated to activated_on (wire field is activatedOn)#86
joshrotenberg merged 1 commit into
mainfrom
fix/database-activated-rename

Conversation

@joshrotenberg
Copy link
Copy Markdown
Contributor

Summary

Database.activated was named to serialize as "activated" on the wire (via rename_all = "camelCase"), but the Redis Cloud API returns the activation timestamp under activatedOn per the OpenAPI spec example. Every real response silently deserialized to None.

Renamed the Rust field to activated_on; the camelCase derive now produces the correct wire name activatedOn automatically.

Test changes

  • test_get_database_by_id mock now uses "activatedOn" (the real wire key) and asserts the value round-trips — regression guard.

Breaking change

Database.activatedDatabase.activated_on. In practice the previous field was always None, so callers can't have been using it meaningfully. CHANGELOG-worthy note when releasing.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — all pass

Closes #76
Refs #40 (spec deltas)

…ire field is `activatedOn`)

The struct field was named `activated`, which with the `rename_all = "camelCase"`
serde attribute serialized as `"activated"` on the wire. The Redis Cloud API
actually returns the activation timestamp under the key `activatedOn` (per the
OpenAPI spec example for `Database`), so every real response silently
deserialized this field to `None`.

Renaming the Rust field to `activated_on` lets the camelCase derive produce the
correct wire name with no explicit `#[serde(rename = ...)]`.

Test updates:
- `test_get_database_by_id` mock body now uses `"activatedOn"` (the wire name)
  and asserts the deserialized value comes through — regression guard.

This is a breaking change to the public field name, but the previous field was
always `None` in practice so no caller was using it meaningfully.

Refs #40 (spec deltas tracking)
Closes #76
@joshrotenberg joshrotenberg merged commit 2f254c7 into main May 15, 2026
8 checks passed
@joshrotenberg joshrotenberg deleted the fix/database-activated-rename branch May 15, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(flexible/databases): Database.activated should be activatedOn (silent data drop)

1 participant