Skip to content

fix: Add missing impressions and paused fields to package request schemas#756

Merged
BaiyuScope3 merged 2 commits into
mainfrom
fix/add-impressions-to-package-requests
Jan 13, 2026
Merged

fix: Add missing impressions and paused fields to package request schemas#756
BaiyuScope3 merged 2 commits into
mainfrom
fix/add-impressions-to-package-requests

Conversation

@BaiyuScope3

@BaiyuScope3 BaiyuScope3 commented Jan 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

Schema inconsistency report identified that core/package.json defines fields that cannot be set when creating or updating packages:

Field core/package.json package-request.json update-media-buy-request.json
impressions ✅ Defined ❌ Missing ❌ Missing
paused ✅ Defined (default: false) ❌ Missing ✅ Present

This made it impossible for buyers to:

  • Set impression goals when creating or updating packages
  • Create packages in a paused state (e.g., for setup-then-activate workflows)

Solution

Added the missing fields to the request schemas:

package-request.json:

  • Added impressions (number, optional) - Impression goal for the package
  • Added paused (boolean, optional, default: false) - Create package in paused state

update-media-buy-request.json:

  • Added impressions (number, optional) - Update impression goal for the package

Why add impressions?

Buyers need to specify delivery goals. The impressions field was defined in the entity schema but unreachable via API, making impression-based campaign planning impossible.

Why add paused to creation?

Common use cases require creating packages in a paused state:

  • Setup-then-activate workflows - Create everything, review, then manually activate
  • Multi-package coordination - Create all packages paused, then activate together
  • Approval workflows - Create in draft/paused state pending approval
  • Testing/Staging - Verify setup before going live

Since update_media_buy already supports paused, it makes sense for create_media_buy to support it too—avoiding the need for an immediate follow-up API call.

Why NOT change format_ids vs format_ids_to_provide?

We evaluated the naming inconsistency between:

  • format_ids (in package-request.json) - buyer's selection
  • format_ids_to_provide (in core/package.json) - publisher's confirmation

Decision: Keep as-is. This is intentional design:

  1. Different semantics - Request = "I want these formats" → Response = "Provide creatives for these formats"
  2. Avoiding breaking change - Renaming would require field deprecation cycle, which contains more efforts for now, let's leave it as it is.
  3. Instructive naming - format_ids_to_provide clearly communicates "action required" to the buyer

Changes

  • static/schemas/source/media-buy/package-request.json - Added impressions and paused
  • static/schemas/source/media-buy/update-media-buy-request.json - Added impressions
  • docs/media-buy/task-reference/create_media_buy.mdx - Updated parameter table
  • docs/media-buy/task-reference/update_media_buy.mdx - Updated parameter table
  • .changeset/fix-package-request-fields.md - Changeset for release notes
  • Fixed missing @jest/test-sequencer dev dependency

Testing

All existing tests pass:

  • ✅ Schema validation
  • ✅ Example validation
  • ✅ Extension fields
  • ✅ JSON schema validation
  • ✅ Composed schema validation
  • ✅ Migration validation
  • ✅ Unit tests

- Add impressions field to package-request.json and update-media-buy-request.json
- Add paused field to package-request.json (default: false)
- Update create_media_buy and update_media_buy documentation
- Fix jest missing @jest/test-sequencer dependency

These fields were defined in core/package.json but missing from request schemas,
making it impossible to set impression goals or initial paused state.
Comment thread package.json
@BaiyuScope3 BaiyuScope3 merged commit d4b7989 into main Jan 13, 2026
7 checks passed
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.

2 participants