Skip to content

feat: sync ADCP schemas to latest, add brand compat and AAO member API#132

Merged
bokelley merged 5 commits intomainfrom
bokelley/brand-json-compat
Feb 18, 2026
Merged

feat: sync ADCP schemas to latest, add brand compat and AAO member API#132
bokelley merged 5 commits intomainfrom
bokelley/brand-json-compat

Conversation

@bokelley
Copy link
Contributor

Summary

  • Schema sync to latest: Updated from 3.0.0-beta.3. Two schemas removed upstream (brand-manifest.json, brand-manifest-ref.json); four new ones added (creative-brief, creative-brief-ref, reference-asset, promoted-offerings-requirement).
  • Brand field compatibility: ResolvedBrand now cross-populates brandbrand_manifest so code using either field name keeps working. The live AAO API still returns brand_manifest; the schema direction is toward brand.
  • BrandManifest backwards compat: The BrandManifest type is kept as a permissive stub in _generated.py since it's part of the public API but no longer has an upstream schema.
  • Simplified registry API: lookup_operator/lookup_operators removed — operators are brands in the AAO registry, use lookup_brand("wpp.com") instead.
  • AAO member directory: New Member type and list_members(limit)/get_member(slug) methods covering the /api/members endpoint.

Test plan

  • All 597 tests pass (pytest tests/)
  • lookup_brand("nike.com") returns brand with both brand and brand_manifest populated
  • BrandManifest still importable from adcp and adcp.types
  • list_members() and get_member("adgentek") covered by new tests
  • Schema sync idempotent: re-running sync_schemas.py produces no changes

🤖 Generated with Claude Code

bokelley and others added 5 commits February 18, 2026 16:02
…ber API

- Update ADCP_VERSION from 3.0.0-beta.3 to latest; sync all 274 schemas
- Remove brand-manifest.json (dropped upstream); keep BrandManifest as
  backwards-compat stub in _generated.py for existing imports
- Add brand/brand_manifest cross-population on ResolvedBrand so both field
  names are always accessible regardless of which the registry returns
- Replace lookup_operator/lookup_operators with lookup_brand — operators are
  brands in the AAO registry, no separate endpoint needed
- Add Member type and list_members/get_member to RegistryClient for the AAO
  member directory (/api/members)
- Fix FieldModel.format_ → FieldModel.format (format is not a Python keyword)
- Fix CreateMediaBuyRequest test: brand_manifest field replaced by brand ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two CI failures were found on PR #132:

1. Schema validation: NameError for BrandManifest in _generated.py
   - consolidate_exports.py hardcoded BrandManifest.model_rebuild() but
     BrandManifest is no longer defined (schema removed upstream in latest)
   - Fix: remove BrandManifest.model_rebuild() call; emit a backwards-compat
     stub class in the generated _generated.py output so existing imports work

2. Mypy valid-type errors in 5 generated files
   - datamodel-code-generator emits constr(pattern=...) as dict key types
   - mypy's Pydantic v2 plugin rejects this; requires Annotated[str, StringConstraints(...)]
   - Fix: add fix_constr_type_annotations() to post_generate_fixes.py to
     automatically rewrite the pattern after every schema sync

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The local consolidate_exports.py run couldn't format with black
(not installed in system Python), leaving _generated.py with
single-line imports. CI has black installed, so it reformats to
multi-line, causing the validation check to always fail with a diff.

Pre-format the committed _generated.py with black so it matches
CI's regenerated output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ting

When run outside the uv virtualenv, sys.executable may not have black
installed. This caused consolidate_exports.py to silently skip formatting,
producing single-line imports that CI's black would then reformat differently.

Try uv run black first (always available in this project), fall back to
sys.executable for environments without uv.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…imit

The test was using asyncio.run() directly in a sync method while all
surrounding tests use @pytest.mark.asyncio. Align for consistency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bokelley bokelley merged commit 0dca021 into main Feb 18, 2026
8 checks passed
@bokelley bokelley deleted the bokelley/brand-json-compat branch February 18, 2026 21:38
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.

1 participant

Comments