(definition string)
| 123 | } |
| 124 | |
| 125 | func humanReadableType(definition string) string { |
| 126 | if definition[0:1] == "[" { |
| 127 | allTypes := strings.Split(definition[1:len(definition)-1], ",") |
| 128 | for i, t := range allTypes { |
| 129 | allTypes[i] = humanReadableType(t) |
| 130 | } |
| 131 | return fmt.Sprintf( |
| 132 | "%s or %s", |
| 133 | strings.Join(allTypes[0:len(allTypes)-1], ", "), |
| 134 | allTypes[len(allTypes)-1], |
| 135 | ) |
| 136 | } |
| 137 | if definition == "object" { |
| 138 | return "mapping" |
| 139 | } |
| 140 | if definition == "array" { |
| 141 | return "list" |
| 142 | } |
| 143 | return definition |
| 144 | } |
| 145 | |
| 146 | type validationError struct { |
| 147 | parent gojsonschema.ResultError |
no outgoing calls
no test coverage detected
searching dependent graphs…