You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Macro declaration models are reachable only by numbered names (MacroDeclaration15, MacroDeclaration16, asset_union.MacroDeclaration6) #1783
A seller that validates or builds an asset's macro_declarations has to pick the generated model for that asset. Today the only names are codegen counters. On 10.0.0b4:
display_tag_asset has MacroDeclaration (tag URL: location.field is Literal['url']), MacroDeclaration15 (inline markup: Literal['markup']) and MacroDeclaration16 (paired redirect: ad_request_url / clickthrough_url);
asset_union has MacroDeclaration through MacroDeclaration10 plus MacroDeclarationModel.
The numbers move when the bundle changes. On 9.3.0 the three display-tag variants shared one location type. AdCP 3.3 gave each delivery its own fields, so the same import now validates different things. Code written against MacroDeclaration for a paired redirect started refusing clickthrough_url on 10.0.0b2 with no rename to signal it.
Example
The Scope3 embedded sales agent's test factory (tests/factories/macro_declaration.py) builds declarations for each display_tag delivery and has to import:
fromadcp.types.domains.core.assets.display_tag_assetimportMacroDeclarationMacroDeclaration.model_validate({..., "location": {"field": "clickthrough_url", "occurrence": 0, "context": "url_query_value"}})
# ValidationError: location.field Input should be 'url'
Suggested fix
Emit stable, meaningful names for these variants: per delivery_type for display_tag (TagUrlMacroDeclaration, InlineMarkupMacroDeclaration, PairedRedirectMacroDeclaration) and per asset type in asset_union, or a title-derived name from the schema. Export them from adcp.types, as #1360 did for other generated classes. A helper such as macro_declaration_model(asset_type, delivery_type) would also work.
Fixed on next by #1801 (squash 64bc9b77): adcp.types exports one name per asset arm (TagUrlMacroDeclaration, PairedRedirectMacroDeclaration, UrlVastMacroDeclaration, ...) plus macro_declaration_model(asset_type, delivery_type=None); tests/test_macro_declaration_names.py derives the mapping from the AssetVariant arms so a renumber fails instead of repointing a name.
Activity
feat(types): name macro declaration variants by their asset arm (#1801)
bokelley commentedon Nov 2, 2026
Fixed on
nextby #1801 (squash64bc9b77):adcp.typesexports one name per asset arm (TagUrlMacroDeclaration,PairedRedirectMacroDeclaration,UrlVastMacroDeclaration, ...) plusmacro_declaration_model(asset_type, delivery_type=None);tests/test_macro_declaration_names.pyderives the mapping from theAssetVariantarms so a renumber fails instead of repointing a name.