Skip to content

fix: enforce custom totals display text - #75

Merged
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/totals-custom-display-text
Aug 14, 2026
Merged

fix: enforce custom totals display text#75
damaz91 merged 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/totals-custom-display-text

Conversation

@FanouZeng-TT

Copy link
Copy Markdown
Contributor

Problem

The pinned totals.json schema requires display_text when a total uses a custom type, but generated Totals, TotalsCreateRequest, and TotalsUpdateRequest aliases currently accept custom entries without it.

Fix

  • extract the schema's simple array-item not.enum / then.required condition
  • include that condition in the existing schema-driven totals AfterValidator
  • regenerate the three totals aliases
  • cover custom, known, and request-variant behavior

Validation

  • ./generate_models.sh 2026-04-08
  • uv run python -m unittest discover -s tests -p "test_*.py" (79 passed)
  • uvx pre-commit run --all-files
  • git diff --check

@damaz91damaz91 added status:needs-triage Signal that the PR is ready for human triage status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Aug 13, 2026
@damaz91
damaz91 merged commit 64daebe into Universal-Commerce-Protocol:mainAug 14, 2026
16 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@FanouZeng-TT@damaz91