openapi3: add T.WalkParameters to visit every parameter in a document#22
Closed
reuvenharrison wants to merge 2 commits into
Closed
openapi3: add T.WalkParameters to visit every parameter in a document#22reuvenharrison wants to merge 2 commits into
reuvenharrison wants to merge 2 commits into
Conversation
The parameter counterpart of WalkSchemas: visits every parameter reachable from the document exactly once (components.parameters, path items, operations, callbacks, webhooks), following resolved $refs so a shared parameter is visited a single time, at its definition, in deterministic sorted order with RFC 6901 pointers. Useful for validation, linting, and parameter transformation without re-deriving the traversal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BqJA1X6suZYtR3tRbX8sLj
reuvenharrison
force-pushed
the
walk-parameters
branch
from
July 14, 2026 16:39
8ce15f4 to
27bc6a2
Compare
With walk_parameters.go added, name the schema walker's file to match.
Author
|
Merged upstream as getkin#1224; this fork copy is superseded. |
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.
The parameter counterpart of
WalkSchemas(getkin#1206): visits every parameter reachable from the document exactly once (components.parameters, path items, operations, callbacks, and webhooks), following resolved$reftargets so a shared parameter is visited a single time, at its definition, in deterministic (sorted) order, with RFC 6901 pointers. The callback may modifyparam.Valuein place, so it serves transformers as well as read-only inspection.Any consumer acting on parameters (validators/linters, e.g. per-parameter serialization rules; transformers, e.g. name normalization; documentation) currently re-derives this traversal, and hand-rolled versions tend to miss
components.parameters, callbacks, or webhooks. Same motivation asWalkSchemas, one object type over.Implemented as a parallel walker in the
WalkSchemasstyle (self-contained, no changes to the schema walker); the two traversal skeletons could be unified later if desired. Since this adds a second walker,walk.gois renamedwalk_schemas.goalongside the newwalk_parameters.go.Tests cover the five parameter sites,
$refdedup at the definition, deterministic pointers (including a callback expression key), error abort, and a nil document.