Skip to content

Conversation

@philwebb
Copy link
Member

Whilst looking into spring-projects/spring-boot#48920 I realized we don't currently have a good way to flatten a YAML map and retain null values. Whilst we could do this in Spring Boot, it would mean duplicating code so I wonder if we can add a new method here instead.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 23, 2026
Add an additional `getFlattenedMap` method to `YamlProcessor` to allow
the resulting flattened map to include nulls.

This update will allow processor subclasses to tell the difference
between YAML that is defined with an empty object vs missing the key
entirely:

e.g.:

  application:
    name: test
    optional: {}

vs

  application:
    name: test
    optional: {}

Closes spring-projectsgh-36197

Signed-off-by: Phillip Webb <phil.webb@broadcom.com>
@jhoeller jhoeller self-assigned this Jan 23, 2026
@jhoeller jhoeller added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 23, 2026
@jhoeller jhoeller added this to the 7.0.4 milestone Jan 23, 2026
@jhoeller jhoeller merged commit 0c9f40b into spring-projects:main Jan 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants