fix(types): align SyncCreativesResponse Creative & CreateMediaBuyResponse1 with rc.9 schema#921
Closed
bokelley wants to merge 1 commit into
Closed
fix(types): align SyncCreativesResponse Creative & CreateMediaBuyResponse1 with rc.9 schema#921bokelley wants to merge 1 commit into
bokelley wants to merge 1 commit into
Conversation
…sponse1 with rc.9 schema The Creative item in SyncCreativesResponse declared only creative_id, action, and errors, dropping 9 optional fields the AdCP schema defines on oneOf[0].properties.creatives.items. Add account, status, platform_id, changes, warnings, preview_url, expires_at, assigned_to, and assignment_errors with types derived from the rc.9 bundled schema. CreateMediaBuyResponse1 declared buyer_ref, which the response schema does not define (it exists only on the request). Remove it. Both classes are hand-authored snippets in scripts/post_generate_fixes.py; edit the snippets and regenerate from the cached rc.9 schemas. Closes #918 Closes #914 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by #922, which is now merged. #922 fixes this at the root cause — it removes the hand-authored |
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.
Two codegen type-accuracy fixes against the cached AdCP 3.1.0-rc.9 schemas. Both buggy classes are hand-authored snippets in
scripts/post_generate_fixes.py, so a future schema regen would not auto-fix them — the snippets are edited and the generated files regenerated to match.#918 —
SyncCreativesResponseCreativemissing 9 of 12 spec fieldsThe per-creative result item (
oneOf[0].properties.creatives.itemsinsync-creatives-response.json,required=[creative_id, action]) defines 12 properties. The snippet declared onlycreative_id,action,errors. Added the 9 missing optional fields with types derived from the rc.9 bundled schema:accountAccount | None = NonestatusCreativeStatus | str | None = Noneplatform_idstr | None = Nonechangeslist[str] | None = Nonewarningslist[str] | None = Nonepreview_urlstr | None = Noneexpires_atAwareDatetime | None = Noneassigned_tolist[str] | None = Noneassignment_errorsdict[str, str] | None = None#914 —
CreateMediaBuyResponse1incorrectly declaresbuyer_refbuyer_refis absent fromcreate-media-buy-response.jsonarm 0 (it exists only on the request). Removed the field.Tests
Added to
tests/test_code_generation.py:test_sync_creatives_response_creative_covers_all_spec_fields— asserts all 12 schema property names are inCreative.model_fieldstest_create_media_buy_response_arm0_omits_buyer_ref— assertsbuyer_refnot inCreateMediaBuyResponse1.model_fieldsVerification
make lint,make typecheck,validate-generated, andtests/test_code_generation.pyall pass. Regenerated locally from the cached rc.9 schemas (no re-download, no version bump). Variant-renumber churn in other generated files was discarded per CLAUDE.md.Closes #918
Closes #914
🤖 Generated with Claude Code