@@ -85,11 +85,11 @@ func identifyHeuristicTarget(method *Method, binding *PathBinding, vocabulary ma
8585 // Iterate backwards over segments
8686 for i := len (tmpl .Segments ) - 1 ; i >= 0 ; i -- {
8787 seg := tmpl .Segments [i ]
88- if seg .Variable == nil || i == 0 || tmpl .Segments [i - 1 ].Literal == nil {
88+ if seg .Variable == nil || i == 0 || tmpl .Segments [i - 1 ].Literal == "" {
8989 continue
9090 }
9191
92- token := * tmpl .Segments [i - 1 ].Literal
92+ token := tmpl .Segments [i - 1 ].Literal
9393 if ! vocabulary [token ] && ! isVersionString (token ) {
9494 continue // continue scanning backward if not in vocabulary
9595 }
@@ -105,8 +105,8 @@ func identifyHeuristicTarget(method *Method, binding *PathBinding, vocabulary ma
105105 prevSeg := tmpl .Segments [firstIndex - 1 ]
106106
107107 // Case 1: The preceding segment is a standalone literal (e.g., "global")
108- if prevSeg .Literal != nil {
109- if isVersionString (* prevSeg .Literal ) {
108+ if prevSeg .Literal != "" {
109+ if isVersionString (prevSeg .Literal ) {
110110 break // Stop at version strings (e.g., "v1")
111111 }
112112 firstIndex --
@@ -115,11 +115,11 @@ func identifyHeuristicTarget(method *Method, binding *PathBinding, vocabulary ma
115115
116116 // Case 2: The preceding segment is a variable. It must be paired with a literal.
117117 if prevSeg .Variable != nil {
118- if firstIndex < 2 || tmpl .Segments [firstIndex - 2 ].Literal == nil {
118+ if firstIndex < 2 || tmpl .Segments [firstIndex - 2 ].Literal == "" {
119119 break // Variable near the beginning, cannot form a pair
120120 }
121121
122- prevLiteralVal := * tmpl .Segments [firstIndex - 2 ].Literal
122+ prevLiteralVal := tmpl .Segments [firstIndex - 2 ].Literal
123123
124124 // If the literal is a known collection, include the pair and continue
125125 if vocabulary [prevLiteralVal ] {
@@ -257,15 +257,15 @@ func constructTemplate(method *Method, segments []PathSegment) ([]PathSegment, e
257257
258258 var result []PathSegment
259259 h := "//" + host
260- result = append (result , PathSegment {Literal : & h })
260+ result = append (result , PathSegment {Literal : h })
261261
262262 for _ , seg := range segments {
263- if seg .Literal != nil {
264- l := * seg .Literal
263+ if seg .Literal != "" {
264+ l := seg .Literal
265265 if isVersionString (l ) {
266266 continue
267267 }
268- result = append (result , PathSegment {Literal : & l })
268+ result = append (result , PathSegment {Literal : l })
269269 } else if seg .Variable != nil {
270270 result = append (result , PathSegment {Variable : & PathVariable {
271271 FieldPath : seg .Variable .FieldPath ,
0 commit comments