jsonType = STRING_TYPE;
}
if (!(leafTypeDef instanceof IdentityrefTypeDefinition)) {
- putIfNonNull(property, TYPE_KEY, jsonType);
+ if (TYPE_KEY != null && jsonType != null) {
+ property.put(TYPE_KEY, jsonType);
+ }
if (leafTypeDef.getDefaultValue().isPresent()) {
final Object defaultValue = leafTypeDef.getDefaultValue().orElseThrow();
if (defaultValue instanceof String stringDefaultValue) {
}
}
- private static void putIfNonNull(final ObjectNode property, final String key, final String value) {
- if (key != null && value != null) {
- property.put(key, value);
- }
- }
-
private static void setExampleValue(final ObjectNode property, final String value) {
property.put(EXAMPLE_KEY, value);
}