Build the services validator chains once, per route - #3562
Merged
Merged
Conversation
Every VWS request ran around thirty validators in sequence, and each one worked out for itself whether it applied by re-reading the body or by re-checking the path and the method. Vuforia's error precedence -- which of several simultaneous problems with a request it reports -- was therefore encoded implicitly as the order of the calls in one function, and nothing stated it. Declare the validators which apply to each route, in the order in which they apply, in a route table built once at import time. Each validator now takes a ValidatorContext which carries the route's own facts, so the applicability guards, the per-request route table in the key validator and the validators which could not apply are all gone. Refs #3371 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…xt-issue-v5 # Conflicts: # src/mock_vws/_services_validators/__init__.py # src/mock_vws/_services_validators/json_validators.py
adamtheturtle
temporarily deployed
to
development
September 7, 2026 15:04 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
adamtheturtle
temporarily deployed
to
vuforia
September 7, 2026 15:14 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every VWS request ran around thirty validators in sequence, each working out for itself whether it applied by re-reading the body or re-checking the path and method, so Vuforia's error precedence was encoded implicitly as the call order in one function.
This declares the validators which apply to each route, in the order they apply, in a route table built once at import time in
routes.py. Each validator now takes aValidatorContextcarrying the route's own facts (mandatory and optional keys, rate-limit group, whether an inactive cloud project may use it), so the applicability guards, the per-request route table in the key validator, and the path-based branches which picked between errors are gone. Validators which branched on route are split into named per-route validators, andRequestRateLimitermoves to its own module.Refs #3371. The parse-the-body-once half of that issue is left for a later change.
🤖 Generated with Claude Code