mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-01 02:56:10 +00:00
fix: Handle NullPointerException when adding custom properties to ensure loop continues for other schemas of the same type for addToRegistry (#18088)
This commit is contained in:
parent
1886132f41
commit
b003e1d600
@ -69,10 +69,16 @@ public class TypeRegistry {
|
||||
String customPropertyFQN = getCustomPropertyFQN(entityType, propertyName);
|
||||
CUSTOM_PROPERTIES.put(customPropertyFQN, customProperty);
|
||||
|
||||
JsonSchema jsonSchema =
|
||||
JsonUtils.getJsonSchema(TYPES.get(customProperty.getPropertyType().getName()).getSchema());
|
||||
CUSTOM_PROPERTY_SCHEMAS.put(customPropertyFQN, jsonSchema);
|
||||
LOG.info("Adding custom property {} with JSON schema {}", customPropertyFQN, jsonSchema);
|
||||
try {
|
||||
JsonSchema jsonSchema =
|
||||
JsonUtils.getJsonSchema(
|
||||
TYPES.get(customProperty.getPropertyType().getName()).getSchema());
|
||||
CUSTOM_PROPERTY_SCHEMAS.put(customPropertyFQN, jsonSchema);
|
||||
LOG.info("Adding custom property {} with JSON schema {}", customPropertyFQN, jsonSchema);
|
||||
} catch (Exception e) {
|
||||
CUSTOM_PROPERTIES.remove(customPropertyFQN);
|
||||
LOG.info("Failed to add custom property {}: {}", customPropertyFQN, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSchema getSchema(String entityType, String propertyName) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user