Skip to content

fix(schema): require the actions map to be non-empty - #669

Open
vishkaty wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/actions-nonempty-map
Open

fix(schema): require the actions map to be non-empty#669
vishkaty wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/actions-nonempty-map

Conversation

@vishkaty

@vishkaty vishkaty commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Problem

docs/specification/overview.md requires the Business to omit the actions map when nothing is outstanding:

the Business MUST include every outstanding Action and MUST omit actions when none are outstanding.

But source/schemas/common/types/actions.json placed no minProperties on the map (only minItems: 1 on the array values), so an empty "actions": {} validated while violating that MUST.

Fix

Add minProperties: 1 to the map. The map should be absent, not empty, when there is no outstanding work, and a schema-driven validator now catches the empty case.

Verification

ucp-schema lint source/ clean; validate_examples.py 282 passed (unchanged). No example emits an empty actions map. Verified with a JSON Schema validator that {} is now rejected and a non-empty map still passes.

Raised from #665.

overview.md states the Business MUST include every outstanding Action and MUST
omit `actions` when none are outstanding, but common/types/actions.json placed
no `minProperties` on the map (only `minItems: 1` on the array values), so an
empty `"actions": {}` validated while violating the MUST. Add
`minProperties: 1` so a schema-driven validator catches the empty map; the map
should be absent, not empty, when there is no outstanding work.

No example emits an empty actions map, so the full corpus is unaffected (282
passed, ucp-schema lint clean).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:needs-triage Signal that the PR is ready for human triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants