(ref *openapi3.SchemaRef, walked, seg string)
| 422 | } |
| 423 | |
| 424 | func missingChild(ref *openapi3.SchemaRef, walked, seg string) error { |
| 425 | place := where(walked) |
| 426 | if ref.Value != nil && ref.Value.Items != nil { |
| 427 | return fmt.Errorf("%s is a list; put an index first, such as %s.0.%s", place, place, seg) |
| 428 | } |
| 429 | names := propertyNames(ref.Value) |
| 430 | if len(names) == 0 { |
| 431 | return fmt.Errorf("%s (%s) has nothing inside it", place, describeSchemaType(ref)) |
| 432 | } |
| 433 | return notFound(fmt.Sprintf("%s has no property named %s", place, seg), seg, names) |
| 434 | } |
| 435 | |
| 436 | // describeSchemaType names the JSON a schema allows, such as "string or null" |
| 437 | // or "object (simple-user)". |
no test coverage detected