referenceContains returns the schema and attribute to which the attribute path applies.
(attrPath filter.AttributePath)
| 297 | |
| 298 | // referenceContains returns the schema and attribute to which the attribute path applies. |
| 299 | func (v Validator) referenceContains(attrPath filter.AttributePath) (schema.Schema, schema.CoreAttribute, bool) { |
| 300 | for _, s := range append([]schema.Schema{v.schema}, v.extensions...) { |
| 301 | if uri := attrPath.URI(); uri != "" && s.ID != uri { |
| 302 | continue |
| 303 | } |
| 304 | if attr, ok := s.Attributes.ContainsAttribute(attrPath.AttributeName); ok { |
| 305 | return s, attr, true |
| 306 | } |
| 307 | } |
| 308 | return schema.Schema{}, schema.CoreAttribute{}, false |
| 309 | } |
no test coverage detected