That would work for some of the cases but all of them. For example (given above), where a default value is not determined by equality:

```
if (includeDefaults || (!indexAnalyzer.name().startsWith("_") && !indexAnalyzer.name().equals("default"))) {
   builder.field("index_analyzer", indexAnalyzer.name());
}
```

Another example:
```
        if (includeInAll != null) {
            builder.field("include_in_all", includeInAll);
        } else if (includeDefaults) {
            builder.field("include_in_all", false);
        }
```

Where a non-null value of a `Boolean` is always rendered (whether it's false or not). Potentially that doesn't matter but so are other edge cases to check. This is all solvable of course (see for example, the suggestion I made above to @javanna ) but I'm not sure we gain much from this all. If you guys feel it's needed I can do another iteration and how much things get cleaned up...