Skip to content

Docs: Add note about YAML reserved words in ConfigurationProperties#12427

Merged
graemerocher merged 2 commits into
micronaut-projects:5.0.xfrom
nikitanagar08:fix-12409-yaml-reserved-words-docs
Mar 5, 2026
Merged

Docs: Add note about YAML reserved words in ConfigurationProperties#12427
graemerocher merged 2 commits into
micronaut-projects:5.0.xfrom
nikitanagar08:fix-12409-yaml-reserved-words-docs

Conversation

@nikitanagar08

Copy link
Copy Markdown
Contributor

Summary

Added documentation explaining YAML reserved boolean words (yes/no, true/false, on/off) and how they are automatically converted to boolean values when used as unquoted keys in YAML configuration.

Problem

When property names like yes or no are used in YAML configuration without quotes, SnakeYAML parses them as boolean values (true/false) instead of strings. This causes the property binding to fail.

Solution

Added a comprehensive note in the configurationProperties.adoc documentation that:

  1. Lists all YAML reserved boolean words
  2. Explains the parsing behavior
  3. Shows the incorrect and correct YAML syntax
  4. Provides a workaround using quoted keys
  5. References the YAML 1.2 specification

Changes

Modified:

  • src/main/docs/guide/config/configurationProperties.adoc

Test Plan

  • Documentation built successfully
  • Checked for correct AsciiDoc syntax
  • Verified code examples are clear

Fixes #12409

Added documentation explaining that YAML has reserved boolean words
(yes/no, true/false, on/off) that are automatically converted to boolean
values when used as unquoted keys in YAML configuration.

This clarifies the behavior described in issue micronaut-projects#12409 where property names
like 'yes' and 'no' fail to bind because SnakeYAML parses them as booleans.

The note includes:
- List of affected reserved words
- Explanation of the issue
- Workaround example using quoted keys
- Reference to YAML 1.2 specification

Fixes micronaut-projects#12409

Signed-off-by: Nikita Nagar <permanayan84@gmail.com>
@cla-assistant

cla-assistant Bot commented Mar 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread src/main/docs/guide/config/configurationProperties.adoc Outdated
Changed 'This includes:' to 'These includes:' since 'words' is plural.
This addresses the review comment from @graemerocher.

Signed-off-by: Nikita Nagar <permanayan84@gmail.com>
@graemerocher graemerocher merged commit 141801d into micronaut-projects:5.0.x Mar 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ConfigurationProperties fails to bind properties named yes or no

2 participants