MCPcopy Index your code
hub / github.com/bytebase/bytebase / objectSchemaHasSemanticTypes

Function objectSchemaHasSemanticTypes

backend/api/v1/document_masking.go:1365–1385  ·  view source on GitHub ↗

objectSchemaHasSemanticTypes recursively checks if any node in the ObjectSchema has a semantic type set.

(os *storepb.ObjectSchema)

Source from the content-addressed store, hash-verified

1363
1364// objectSchemaHasSemanticTypes recursively checks if any node in the ObjectSchema has a semantic type set.
1365func 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}

Callers 2

maskResultsMethod · 0.85

Calls 4

GetStructKindMethod · 0.45
GetPropertiesMethod · 0.45
GetArrayKindMethod · 0.45
GetKindMethod · 0.45

Tested by

no test coverage detected