Skip to content

fix(fixed/databases): add missing 'subscription' field to AccountFixedSubscriptionDatabases#81

Merged
joshrotenberg merged 1 commit into
mainfrom
fix/fixed-databases-subscription-field
May 15, 2026
Merged

fix(fixed/databases): add missing 'subscription' field to AccountFixedSubscriptionDatabases#81
joshrotenberg merged 1 commit into
mainfrom
fix/fixed-databases-subscription-field

Conversation

@joshrotenberg
Copy link
Copy Markdown
Contributor

Summary

  • Adds the missing subscription field to AccountFixedSubscriptionDatabases so FixedDatabaseHandler::list() actually surfaces the databases array.
  • Introduces FixedSubscriptionDatabasesInfo mirroring the Pro side's SubscriptionDatabasesInfo, but as a single object (not an array — Essentials returns one, not many).
  • Replaces the previous vacuous test_get_fixed_subscription_databases with one that asserts a populated databases[] round-trips: database id, name, and the subscription_id/number_of_databases summary.

Why

The OpenAPI schema for AccountFixedSubscriptionDatabases declares only accountId and links as properties — but the spec's own example for the same schema shows subscription as an object containing databases[]. The Rust struct mirrored the schema, not the example. Result: every list call returned an empty wrapper with no way to access the databases. The existing test passed only because it asserted on the two fields that did deserialize.

Scope

Tightly scoped to fixing the response shape. Harmonizing list() to return Vec<FixedDatabase> directly (as the Pro side already does via the harmonization work) is out of scope here and remains tracked under #65.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace — all tests pass (288 total)
  • cargo test --test fixed_databases_tests — 11 pass

Closes #73
Refs #40 (spec deltas tracking)

…dSubscriptionDatabases

The Essentials list endpoint (`GET /fixed/subscriptions/{id}/databases`)
returns a wrapper whose `subscription` field carries the actual databases.
The OpenAPI schema for `AccountFixedSubscriptionDatabases` lists only
`accountId` and `links`, but the spec's own `example` for the same schema
clearly shows a single `subscription` object containing `subscriptionId`,
`numberOfDatabases`, `databases[]`, and `links`.

The Rust struct mirrored only the broken schema. The result: every call to
`FixedDatabaseHandler::list()` returned an `account_id`+`links` wrapper
with the `databases` array silently dropped. The existing test passed
because it only asserted on the two fields that did deserialize.

This commit:
- Adds the missing `subscription: Option<FixedSubscriptionDatabasesInfo>`
  field on `AccountFixedSubscriptionDatabases`.
- Introduces `FixedSubscriptionDatabasesInfo` mirroring the Pro side's
  `SubscriptionDatabasesInfo`. Note: Essentials wraps it as a single
  object (not an array — that's an architectural difference from Pro
  documented in the doc comments).
- Replaces the previous vacuous test with one that exercises the full
  shape including a populated `databases` array, asserting database id
  and name come through.

Harmonizing `list()` to return `Vec<FixedDatabase>` directly (as the
Pro side already does) is out of scope here and tracked under #65.

Closes #73
Refs #40
@joshrotenberg joshrotenberg force-pushed the fix/fixed-databases-subscription-field branch from fc91b86 to c57d32e Compare May 15, 2026 18:33
@joshrotenberg joshrotenberg merged commit 2bc3f38 into main May 15, 2026
8 checks passed
@joshrotenberg joshrotenberg deleted the fix/fixed-databases-subscription-field branch May 15, 2026 18:37
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(fixed/databases): list() returns broken AccountFixedSubscriptionDatabases (missing 'subscription')

1 participant