- this.nullableDefault = leaf.getDefault();
- this.nullableDefaultWrappedForCode = leaf.getDefault() == null ? null : typeProviderWrapper.getDefault(leaf);
- this.nullableDescription = leaf.getDescription();
+
+ final Optional<? extends Object> typeDefault = leaf.getType().getDefaultValue();
+ if (typeDefault.isPresent()) {
+ nullableDefault = (String) typeDefault.get();
+ nullableDefaultWrappedForCode = typeProviderWrapper.getDefault(leaf);
+ } else {
+ nullableDefault = null;
+ nullableDefaultWrappedForCode = null;
+ }
+
+ this.nullableDescription = leaf.getDescription().orElse(null);