feat: sync ADCP schemas to latest, add brand compat and AAO member API#132
Merged
feat: sync ADCP schemas to latest, add brand compat and AAO member API#132
Conversation
…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>
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
latest: Updated from3.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).ResolvedBrandnow cross-populatesbrand↔brand_manifestso code using either field name keeps working. The live AAO API still returnsbrand_manifest; the schema direction is towardbrand.BrandManifesttype is kept as a permissive stub in_generated.pysince it's part of the public API but no longer has an upstream schema.lookup_operator/lookup_operatorsremoved — operators are brands in the AAO registry, uselookup_brand("wpp.com")instead.Membertype andlist_members(limit)/get_member(slug)methods covering the/api/membersendpoint.Test plan
pytest tests/)lookup_brand("nike.com")returns brand with bothbrandandbrand_manifestpopulatedBrandManifeststill importable fromadcpandadcp.typeslist_members()andget_member("adgentek")covered by new testssync_schemas.pyproduces no changes🤖 Generated with Claude Code