Skip to content

Fix empty object schemas to allow additional properties#464

Open
benedikt-buchert wants to merge 1 commit into
AdobeDocs:mainfrom
benedikt-buchert:fix/empty-object-schemas-additionalproperties
Open

Fix empty object schemas to allow additional properties#464
benedikt-buchert wants to merge 1 commit into
AdobeDocs:mainfrom
benedikt-buchert:fix/empty-object-schemas-additionalproperties

Conversation

@benedikt-buchert
Copy link
Copy Markdown

Summary

Four schemas are defined as bare `type: object` with no `properties` and no `additionalProperties`: TargetRule, JsonNode, SegmentRule, and BatchAuthData.

The Adobe Target API accepts and returns arbitrary fields on these types — for example `TargetRule.script` (audience rule script), and `JsonNode` content values. Without `additionalProperties: true`, strictly-typed clients (e.g. Pydantic, TypeScript strict mode) silently drop all fields on these objects, causing 400 errors when creating audiences with script-based rules.

Affected schemas and known fields:

  • `TargetRule` — accepts `script` (JS expression) and `booleanOperator`+`rules` for rule-based audiences
  • `JsonNode` — used in `JsonOffer.content` and `BatchOperation.body`; holds arbitrary JSON
  • `SegmentRule` — used in `CompositeSegmentRule.rules[]`; holds arbitrary rule fields
  • `BatchAuthData` — holds arbitrary auth data fields

Fix: Add `"additionalProperties": true` to each of these schemas so typed clients pass all fields through.

🤖 Generated with Claude Code

TargetRule, JsonNode, SegmentRule, and BatchAuthData are all defined as
bare type: object with no properties. The API accepts and returns
arbitrary fields on these types (e.g. TargetRule.script, JsonNode
content values). Without additionalProperties: true, strictly-typed
clients silently drop all fields on these objects.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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