objectSchemaHasSemanticTypes recursively checks if any node in the ObjectSchema has a semantic type set.
(os *storepb.ObjectSchema)
| 1363 | |
| 1364 | // objectSchemaHasSemanticTypes recursively checks if any node in the ObjectSchema has a semantic type set. |
| 1365 | func objectSchemaHasSemanticTypes(os *storepb.ObjectSchema) bool { |
| 1366 | if os == nil { |
| 1367 | return false |
| 1368 | } |
| 1369 | if os.SemanticType != "" { |
| 1370 | return true |
| 1371 | } |
| 1372 | if sk := os.GetStructKind(); sk != nil { |
| 1373 | for _, prop := range sk.GetProperties() { |
| 1374 | if objectSchemaHasSemanticTypes(prop) { |
| 1375 | return true |
| 1376 | } |
| 1377 | } |
| 1378 | } |
| 1379 | if ak := os.GetArrayKind(); ak != nil { |
| 1380 | if objectSchemaHasSemanticTypes(ak.GetKind()) { |
| 1381 | return true |
| 1382 | } |
| 1383 | } |
| 1384 | return false |
| 1385 | } |
no test coverage detected