Skip to content

fix(types): request model account fields still return removed AccountReference RootModel #1087

Description

@bokelley

Version

adcp==8.0.0b9

Reproduction

from adcp.types import AccountReference, GetProductsRequest

request = GetProductsRequest(
    buying_mode="wholesale",
    brief="test",
    account={"account_id": "acc_123"},
)

print(AccountReference)
print(GetProductsRequest.model_fields["account"].annotation)
print(type(request.account), request.account)

Observed:

  • Public AccountReference is the new composable union alias.
  • GetProductsRequest.model_fields["account"].annotation is still the generated outer RootModel type.
  • request.account is AccountReference(root=AccountReference1(...)), not AccountReferenceById.

The same stale annotation is present on make_versioned_base("3.1", "GetProductsRequest").

Expected

SDK request models that expose an account field should use the public composable union and return its concrete arms, consistent with the beta.9 migration contract in #1084. Otherwise adopter code must support both the new public union and the removed wrapper depending on whether it validates the field directly or through an SDK request model.

Context

This surfaced while applying the beta.9 object-union migration from #1084.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions