Skip to content

Conversation

@bokelley
Copy link
Contributor

Problem

  • Client validation failing with: Schema validation: primary_channels: Expected array, received null (and similar for other optional fields)
  • ListAuthorizedPropertiesResponse had a 'tags' field that is NOT in the official AdCP v2.2.0 specification
  • Previous fix (fix: AdCP responses now exclude None values in JSON serialization #642) added exclude_none=True but didn't address the root cause

Root Cause

  • The 'tags' field was incorrectly added to both schemas.py and schema_adapters.py
  • Per official spec at /schemas/v1/media-buy/list-authorized-properties-response.json, only these fields are valid:
    • publisher_domains (required)
    • primary_channels, primary_countries, portfolio_description, advertising_policies, last_updated, errors (optional)

Solution

Testing

  • ✅ Updated test_adcp_contract.py to match spec (removed tags field test)
  • ✅ Updated test_authorized_properties.py (removed tags assertions)
  • ✅ Updated test_a2a_response_attribute_access.py (removed tags test)
  • ✅ Unit tests pass (837 passed)
  • ✅ AdCP contract tests pass
  • ✅ Response now validates against official schema

Related

Problem:
- ListAuthorizedPropertiesResponse had a 'tags' field not in AdCP spec
- Official spec at /schemas/v1/media-buy/list-authorized-properties-response.json
  only defines: publisher_domains, primary_channels, primary_countries,
  portfolio_description, advertising_policies, last_updated, errors
- Client validation failed with "Expected array/string, received null" errors
- Previous fix (PR #642) added exclude_none=True but didn't address root cause

Root Cause:
- The 'tags' field was added to both schemas.py and schema_adapters.py
- This field is NOT in the official AdCP v2.2.0 specification
- When None-valued optional fields were excluded, other None fields would still
  cause validation errors in clients

Solution:
- Remove 'tags' field from ListAuthorizedPropertiesResponse in both files
- Now response only includes spec-compliant fields
- Combined with PR #642's exclude_none=True, optional fields are properly omitted
- Result: No null values in JSON, no non-spec fields

Testing:
- Updated test_adcp_contract.py to match spec (removed tags field test)
- Unit tests pass (test_adcp_json_serialization.py)
- AdCP contract tests pass (test_adcp_contract.py)
- Response now validates against official schema

Related: Fixes client validation errors from adcp/client@2.5.1
Follows up: PR #642 (exclude_none fix)
…nse tests

Updates all tests to match the spec-compliant schema which does not include
a tags field. Tests now verify only the fields defined in the official AdCP
v2.2.0 specification:
- publisher_domains (required)
- primary_channels, primary_countries, portfolio_description,
  advertising_policies, last_updated, errors (optional)

Related: Follows up commit 633b498 (remove tags field from schema)
@bokelley bokelley merged commit a38b3d7 into main Oct 27, 2025
9 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…adcontextprotocol#643)

* fix: Remove non-spec tags field from ListAuthorizedPropertiesResponse

Problem:
- ListAuthorizedPropertiesResponse had a 'tags' field not in AdCP spec
- Official spec at /schemas/v1/media-buy/list-authorized-properties-response.json
  only defines: publisher_domains, primary_channels, primary_countries,
  portfolio_description, advertising_policies, last_updated, errors
- Client validation failed with "Expected array/string, received null" errors
- Previous fix (PR adcontextprotocol#642) added exclude_none=True but didn't address root cause

Root Cause:
- The 'tags' field was added to both schemas.py and schema_adapters.py
- This field is NOT in the official AdCP v2.2.0 specification
- When None-valued optional fields were excluded, other None fields would still
  cause validation errors in clients

Solution:
- Remove 'tags' field from ListAuthorizedPropertiesResponse in both files
- Now response only includes spec-compliant fields
- Combined with PR adcontextprotocol#642's exclude_none=True, optional fields are properly omitted
- Result: No null values in JSON, no non-spec fields

Testing:
- Updated test_adcp_contract.py to match spec (removed tags field test)
- Unit tests pass (test_adcp_json_serialization.py)
- AdCP contract tests pass (test_adcp_contract.py)
- Response now validates against official schema

Related: Fixes client validation errors from adcp/client@2.5.1
Follows up: PR adcontextprotocol#642 (exclude_none fix)

* test: Remove tags field references from ListAuthorizedPropertiesResponse tests

Updates all tests to match the spec-compliant schema which does not include
a tags field. Tests now verify only the fields defined in the official AdCP
v2.2.0 specification:
- publisher_domains (required)
- primary_channels, primary_countries, portfolio_description,
  advertising_policies, last_updated, errors (optional)

Related: Follows up commit 633b498 (remove tags field from schema)
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