...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package openapi
16
17 import (
18 "cuelang.org/go/cue"
19 "cuelang.org/go/cue/errors"
20 "cuelang.org/go/cue/token"
21 )
22
23 var _ errors.Error = &openapiError{}
24
25
26 type openapiError struct {
27 errors.Message
28 path cue.Path
29 pos token.Pos
30 }
31
32 func (e *openapiError) Position() token.Pos {
33 return e.pos
34 }
35
36 func (e *openapiError) InputPositions() []token.Pos {
37 return nil
38 }
39
40 func (e *openapiError) Path() []string {
41 return pathToStrings(e.path)
42 }
43
44
45 func pathToStrings(p cue.Path) (a []string) {
46 for _, sel := range p.Selectors() {
47 a = append(a, sel.String())
48 }
49 return a
50 }
51
View as plain text