Skip to content

fix: enforce custom totals display text - #75

Open
FanouZeng-TT wants to merge 1 commit into
Universal-Commerce-Protocol:mainfrom
FanouZeng-TT:fix/totals-custom-display-text
Open

fix: enforce custom totals display text#75
FanouZeng-TT wants to merge 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

@damaz91 damaz91 added the status:needs-triage Signal that the PR is ready for human triage label Aug 13, 2026
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.

2 participants