getYamlGenerator method
Returns the active YamlGenerator, creating one if needed.
If no generator has been created yet, a StringYamlGenerator is instantiated using environment-based configuration:
indentSize: pulled fromObjectMapper.INDENT_SIZE, defaulting to2.
The created generator is cached and reused for all subsequent YAML serialization operations.
Implementation
YamlGenerator getYamlGenerator() => _yamlGenerator ??= StringYamlGenerator(
indentSize: getEnvironment().getPropertyAs(ObjectMapper.INDENT_SIZE, Class<int>(), 2) ?? 2
);