Skip to content

Type Model Target request handling as recursive JSON - #3624

Merged
adamtheturtle merged 1 commit into
mainfrom
type-model-target-json
Sep 12, 2026
Merged

adamtheturtle merged 1 commit into
mainfrom
type-model-target-json

Conversation

@adamtheturtle

@adamtheturtle adamtheturtle commented Sep 12, 2026

Copy link
Copy Markdown
Member

Issue

Model Target request validation used Any throughout the decoded JSON tree. That hid the actual container shapes from Pyrefly and required 19 ignores around ordinary dictionary, list, string, and number operations. The view helper also retained a branch for non-object values even though the request boundary normalizes every such value before calling it; its only test had to bypass two lint rules to call the private helper directly.

Change

Use the existing recursive JSONValue domain type at the response and request boundaries, then narrow nested arrays and objects before inspecting them. OAuth and validation response bodies are also constructed as recursive JSON values. Remove the unreachable view-helper branch and its implementation-detail test. This removes 21 suppression lines without changing HTTP behavior.

Validation

  • uv run --group=dev prek run --all-files --hook-stage pre-commit
  • uv run --group=dev prek run --all-files --hook-stage pre-push
  • uv run --group=dev coverage run -m pytest --skip-backend=real -n auto . - 1,947 passed, 843 skipped
  • changed production module: 100% local coverage

The local aggregate coverage command reports 99% because real-Vuforia-only and platform paths are skipped locally; the repository hosted coverage job combines those partitions.

This branch was successfully deployed

2 active deployments
development 6ce27365 Deployed Sep 12, 2026 by adamtheturtle via pages #2133
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