fix(flexible/databases): rename Database.activated to activated_on (wire field is activatedOn)#86
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Database.activatedwas named to serialize as"activated"on the wire (viarename_all = "camelCase"), but the Redis Cloud API returns the activation timestamp underactivatedOnper the OpenAPI spec example. Every real response silently deserialized toNone.Renamed the Rust field to
activated_on; the camelCase derive now produces the correct wire nameactivatedOnautomatically.Test changes
test_get_database_by_idmock now uses"activatedOn"(the real wire key) and asserts the value round-trips — regression guard.Breaking change
Database.activated→Database.activated_on. In practice the previous field was alwaysNone, so callers can't have been using it meaningfully. CHANGELOG-worthy note when releasing.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace— all passCloses #76
Refs #40 (spec deltas)