@@ -68,24 +68,24 @@ func walk(ctx context.Context, arazzo *Arazzo, yield func(WalkItem) bool) {
6868 // Visit each of the top level fields in turn populating their location context with field and any key/index information
6969 loc := Locations {}
7070
71- if ! walkInfo (ctx , & arazzo .Info , append (loc , LocationContext {Parent : arazzoMatchFunc , ParentField : "info" }), arazzo , yield ) {
71+ if ! walkInfo (ctx , & arazzo .Info , append (loc , LocationContext {ParentMatchFunc : arazzoMatchFunc , ParentField : "info" }), arazzo , yield ) {
7272 return
7373 }
7474
75- if ! walkSourceDescriptions (ctx , arazzo .SourceDescriptions , append (loc , LocationContext {Parent : arazzoMatchFunc , ParentField : "sourceDescriptions" }), arazzo , yield ) {
75+ if ! walkSourceDescriptions (ctx , arazzo .SourceDescriptions , append (loc , LocationContext {ParentMatchFunc : arazzoMatchFunc , ParentField : "sourceDescriptions" }), arazzo , yield ) {
7676 return
7777 }
7878
79- if ! walkWorkflows (ctx , arazzo .Workflows , append (loc , LocationContext {Parent : arazzoMatchFunc , ParentField : "workflows" }), arazzo , yield ) {
79+ if ! walkWorkflows (ctx , arazzo .Workflows , append (loc , LocationContext {ParentMatchFunc : arazzoMatchFunc , ParentField : "workflows" }), arazzo , yield ) {
8080 return
8181 }
8282
83- if ! walkComponents (ctx , arazzo .Components , append (loc , LocationContext {Parent : arazzoMatchFunc , ParentField : "components" }), arazzo , yield ) {
83+ if ! walkComponents (ctx , arazzo .Components , append (loc , LocationContext {ParentMatchFunc : arazzoMatchFunc , ParentField : "components" }), arazzo , yield ) {
8484 return
8585 }
8686
8787 // Visit Arazzo Extensions
88- yield (WalkItem {Match : getMatchFunc (arazzo .Extensions ), Location : append (loc , LocationContext {Parent : arazzoMatchFunc , ParentField : "" }), Arazzo : arazzo })
88+ yield (WalkItem {Match : getMatchFunc (arazzo .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : arazzoMatchFunc , ParentField : "" }), Arazzo : arazzo })
8989}
9090
9191func walkInfo (_ context.Context , info * Info , loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -100,7 +100,7 @@ func walkInfo(_ context.Context, info *Info, loc Locations, arazzo *Arazzo, yiel
100100 }
101101
102102 // Visit Info Extensions
103- return yield (WalkItem {Match : getMatchFunc (info .Extensions ), Location : append (loc , LocationContext {Parent : infoMatchFunc , ParentField : "" }), Arazzo : arazzo })
103+ return yield (WalkItem {Match : getMatchFunc (info .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : infoMatchFunc , ParentField : "" }), Arazzo : arazzo })
104104}
105105
106106func walkSourceDescriptions (ctx context.Context , sourceDescriptions []* SourceDescription , loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -134,7 +134,7 @@ func walkSourceDescription(_ context.Context, sd *SourceDescription, loc Locatio
134134 }
135135
136136 // Visit SourceDescription Extensions
137- return yield (WalkItem {Match : getMatchFunc (sd .Extensions ), Location : append (loc , LocationContext {Parent : sdMatchFunc , ParentField : "" }), Arazzo : arazzo })
137+ return yield (WalkItem {Match : getMatchFunc (sd .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : sdMatchFunc , ParentField : "" }), Arazzo : arazzo })
138138}
139139
140140func walkWorkflows (ctx context.Context , workflows []* Workflow , loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -168,32 +168,32 @@ func walkWorkflow(ctx context.Context, workflow *Workflow, loc Locations, arazzo
168168 }
169169
170170 // Walk through parameters
171- if ! walkReusableParameters (ctx , workflow .Parameters , append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
171+ if ! walkReusableParameters (ctx , workflow .Parameters , append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
172172 return false
173173 }
174174
175175 // Walk through inputs schema using oas3 walking
176- if ! walkJSONSchema (ctx , workflow .Inputs , append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "inputs" }), arazzo , yield ) {
176+ if ! walkJSONSchema (ctx , workflow .Inputs , append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "inputs" }), arazzo , yield ) {
177177 return false
178178 }
179179
180180 // Walk through steps
181- if ! walkSteps (ctx , workflow .Steps , append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "steps" }), arazzo , yield ) {
181+ if ! walkSteps (ctx , workflow .Steps , append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "steps" }), arazzo , yield ) {
182182 return false
183183 }
184184
185185 // Walk through success actions
186- if ! walkReusableSuccessActions (ctx , workflow .SuccessActions , append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "successActions" }), arazzo , yield ) {
186+ if ! walkReusableSuccessActions (ctx , workflow .SuccessActions , append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "successActions" }), arazzo , yield ) {
187187 return false
188188 }
189189
190190 // Walk through failure actions
191- if ! walkReusableFailureActions (ctx , workflow .FailureActions , append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "failureActions" }), arazzo , yield ) {
191+ if ! walkReusableFailureActions (ctx , workflow .FailureActions , append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "failureActions" }), arazzo , yield ) {
192192 return false
193193 }
194194
195195 // Visit Workflow Extensions
196- return yield (WalkItem {Match : getMatchFunc (workflow .Extensions ), Location : append (loc , LocationContext {Parent : workflowMatchFunc , ParentField : "" }), Arazzo : arazzo })
196+ return yield (WalkItem {Match : getMatchFunc (workflow .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : workflowMatchFunc , ParentField : "" }), Arazzo : arazzo })
197197}
198198
199199func walkReusableParameters (ctx context.Context , parameters []* ReusableParameter , loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -273,10 +273,10 @@ func convertSchemaLocation(schemaLoc walkpkg.Locations[oas3.SchemaMatchFunc], ba
273273 // Convert each oas3 location context to arazzo location context
274274 for _ , schemaLocCtx := range schemaLoc {
275275 result = append (result , LocationContext {
276- Parent : convertSchemaMatchFunc (schemaLocCtx .Parent ),
277- ParentField : schemaLocCtx .ParentField ,
278- ParentKey : schemaLocCtx .ParentKey ,
279- ParentIndex : schemaLocCtx .ParentIndex ,
276+ ParentMatchFunc : convertSchemaMatchFunc (schemaLocCtx .ParentMatchFunc ),
277+ ParentField : schemaLocCtx .ParentField ,
278+ ParentKey : schemaLocCtx .ParentKey ,
279+ ParentIndex : schemaLocCtx .ParentIndex ,
280280 })
281281 }
282282
@@ -314,22 +314,22 @@ func walkStep(ctx context.Context, step *Step, loc Locations, arazzo *Arazzo, yi
314314 }
315315
316316 // Walk through parameters
317- if ! walkReusableParameters (ctx , step .Parameters , append (loc , LocationContext {Parent : stepMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
317+ if ! walkReusableParameters (ctx , step .Parameters , append (loc , LocationContext {ParentMatchFunc : stepMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
318318 return false
319319 }
320320
321321 // Walk through success actions
322- if ! walkReusableSuccessActions (ctx , step .OnSuccess , append (loc , LocationContext {Parent : stepMatchFunc , ParentField : "onSuccess" }), arazzo , yield ) {
322+ if ! walkReusableSuccessActions (ctx , step .OnSuccess , append (loc , LocationContext {ParentMatchFunc : stepMatchFunc , ParentField : "onSuccess" }), arazzo , yield ) {
323323 return false
324324 }
325325
326326 // Walk through failure actions
327- if ! walkReusableFailureActions (ctx , step .OnFailure , append (loc , LocationContext {Parent : stepMatchFunc , ParentField : "onFailure" }), arazzo , yield ) {
327+ if ! walkReusableFailureActions (ctx , step .OnFailure , append (loc , LocationContext {ParentMatchFunc : stepMatchFunc , ParentField : "onFailure" }), arazzo , yield ) {
328328 return false
329329 }
330330
331331 // Visit Step Extensions
332- return yield (WalkItem {Match : getMatchFunc (step .Extensions ), Location : append (loc , LocationContext {Parent : stepMatchFunc , ParentField : "" }), Arazzo : arazzo })
332+ return yield (WalkItem {Match : getMatchFunc (step .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : stepMatchFunc , ParentField : "" }), Arazzo : arazzo })
333333}
334334
335335func walkReusableSuccessActions (ctx context.Context , actions []* ReusableSuccessAction , loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -414,27 +414,27 @@ func walkComponents(ctx context.Context, components *Components, loc Locations,
414414 }
415415
416416 // Walk through inputs
417- if ! walkComponentInputs (ctx , components .Inputs , append (loc , LocationContext {Parent : componentsMatchFunc , ParentField : "inputs" }), arazzo , yield ) {
417+ if ! walkComponentInputs (ctx , components .Inputs , append (loc , LocationContext {ParentMatchFunc : componentsMatchFunc , ParentField : "inputs" }), arazzo , yield ) {
418418 return false
419419 }
420420
421421 // Walk through parameters
422- if ! walkComponentParameters (ctx , components .Parameters , append (loc , LocationContext {Parent : componentsMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
422+ if ! walkComponentParameters (ctx , components .Parameters , append (loc , LocationContext {ParentMatchFunc : componentsMatchFunc , ParentField : "parameters" }), arazzo , yield ) {
423423 return false
424424 }
425425
426426 // Walk through success actions
427- if ! walkComponentSuccessActions (ctx , components .SuccessActions , append (loc , LocationContext {Parent : componentsMatchFunc , ParentField : "successActions" }), arazzo , yield ) {
427+ if ! walkComponentSuccessActions (ctx , components .SuccessActions , append (loc , LocationContext {ParentMatchFunc : componentsMatchFunc , ParentField : "successActions" }), arazzo , yield ) {
428428 return false
429429 }
430430
431431 // Walk through failure actions
432- if ! walkComponentFailureActions (ctx , components .FailureActions , append (loc , LocationContext {Parent : componentsMatchFunc , ParentField : "failureActions" }), arazzo , yield ) {
432+ if ! walkComponentFailureActions (ctx , components .FailureActions , append (loc , LocationContext {ParentMatchFunc : componentsMatchFunc , ParentField : "failureActions" }), arazzo , yield ) {
433433 return false
434434 }
435435
436436 // Visit Components Extensions
437- return yield (WalkItem {Match : getMatchFunc (components .Extensions ), Location : append (loc , LocationContext {Parent : componentsMatchFunc , ParentField : "" }), Arazzo : arazzo })
437+ return yield (WalkItem {Match : getMatchFunc (components .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : componentsMatchFunc , ParentField : "" }), Arazzo : arazzo })
438438}
439439
440440func walkComponentInputs (ctx context.Context , inputs * sequencedmap.Map [string , * oas3.JSONSchema [oas3.Referenceable ]], loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -487,7 +487,7 @@ func walkParameter(_ context.Context, parameter *Parameter, loc Locations, arazz
487487 }
488488
489489 // Visit Parameter Extensions
490- return yield (WalkItem {Match : getMatchFunc (parameter .Extensions ), Location : append (loc , LocationContext {Parent : parameterMatchFunc , ParentField : "" }), Arazzo : arazzo })
490+ return yield (WalkItem {Match : getMatchFunc (parameter .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : parameterMatchFunc , ParentField : "" }), Arazzo : arazzo })
491491}
492492
493493func walkComponentSuccessActions (ctx context.Context , actions * sequencedmap.Map [string , * SuccessAction ], loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -521,7 +521,7 @@ func walkSuccessAction(_ context.Context, action *SuccessAction, loc Locations,
521521 }
522522
523523 // Visit SuccessAction Extensions
524- return yield (WalkItem {Match : getMatchFunc (action .Extensions ), Location : append (loc , LocationContext {Parent : actionMatchFunc , ParentField : "" }), Arazzo : arazzo })
524+ return yield (WalkItem {Match : getMatchFunc (action .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : actionMatchFunc , ParentField : "" }), Arazzo : arazzo })
525525}
526526
527527func walkComponentFailureActions (ctx context.Context , actions * sequencedmap.Map [string , * FailureAction ], loc Locations , arazzo * Arazzo , yield func (WalkItem ) bool ) bool {
@@ -555,7 +555,7 @@ func walkFailureAction(_ context.Context, action *FailureAction, loc Locations,
555555 }
556556
557557 // Visit FailureAction Extensions
558- return yield (WalkItem {Match : getMatchFunc (action .Extensions ), Location : append (loc , LocationContext {Parent : actionMatchFunc , ParentField : "" }), Arazzo : arazzo })
558+ return yield (WalkItem {Match : getMatchFunc (action .Extensions ), Location : append (loc , LocationContext {ParentMatchFunc : actionMatchFunc , ParentField : "" }), Arazzo : arazzo })
559559}
560560
561561type matchHandler [T any ] struct {
0 commit comments