Spring Boot application.yml to JSON — Convert and Debug Online
- Spring Boot's application.yml is standard YAML — converts directly to JSON without preprocessing.
- JSON output shows flattened property paths — exactly how Spring binds them to @ConfigurationProperties.
- Type coercion errors (port as string vs. int) become obvious in JSON output.
- Profile-specific YAML sections (spring.profiles) also convert cleanly for inspection.
Table of Contents
Spring Boot's application.yml is standard YAML, which means it converts to JSON directly — paste it into a browser-based converter and get JSON output in under a second. Converting to JSON helps debug property binding issues, verify data types before runtime, and understand how Spring Boot flattens nested YAML keys into dot-notation property paths.
This guide covers why engineers convert Spring Boot YAML to JSON, how to interpret the output, and what to watch for with specific Spring Boot config structures.
Why Convert application.yml to JSON for Debugging
Spring Boot reads application.yml and binds it to beans using @ConfigurationProperties or @Value annotations. When a property doesn't bind as expected, the YAML is usually the cause — but YAML's flexible type inference can mask the issue.
Converting to JSON exposes:
- Type coercion: YAML parses
port: 8080as integer,port: "8080"as string. The JSON output makes the type explicit — integers are unquoted, strings are quoted. If Spring is rejecting a value as the wrong type, the JSON view shows whether the YAML parsed it as you intended. - Nesting depth: Spring uses dot-notation for nested properties (
spring.datasource.url). The JSON tree shows exactly what nested structure your YAML produces. - Missing keys: if a property path doesn't appear in the JSON output, it didn't parse — usually an indentation error in the YAML.
- Unexpected nulls: a key with an empty value in YAML becomes
nullin JSON. If Spring is getting null for a required property, converting the YAML shows whether the value was present.
How to Convert application.yml to JSON
Open the YAML to JSON converter in any browser. Copy the contents of your application.yml file and paste it into the input panel. Click Convert.
Example Spring Boot config:
server:
port: 8080
servlet:
context-path: /api
spring:
datasource:
url: jdbc:postgresql://localhost:5432/mydb
username: appuser
password: secret
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: false
logging:
level:
root: INFO
com.example: DEBUG
JSON output:
{
"server": {
"port": 8080,
"servlet": {
"context-path": "/api"
}
},
"spring": {
"datasource": {
"url": "jdbc:postgresql://localhost:5432/mydb",
"username": "appuser",
"password": "secret",
"driver-class-name": "org.postgresql.Driver"
},
"jpa": {
"hibernate": {
"ddl-auto": "update"
},
"show-sql": false
}
},
"logging": {
"level": {
"root": "INFO",
"com.example": "DEBUG"
}
}
}
Note that server.port is 8080 as an integer — no quotes. That is correct for Spring Boot. If it appeared as "8080", Spring would try to bind a string to an integer field and throw a configuration error.
Spring Boot Profile-Specific YAML Sections
Spring Boot supports multiple profiles in a single application.yml using YAML document separators (---) and spring.config.activate.on-profile:
spring:
application:
name: myapp
---
spring:
config:
activate:
on-profile: dev
datasource:
url: jdbc:h2:mem:devdb
---
spring:
config:
activate:
on-profile: prod
datasource:
url: jdbc:postgresql://prod-db/mydb
YAML document separators create multiple YAML documents in one file. A standard YAML-to-JSON converter will parse only the first document (before the first ---), or may error on the multi-document format.
To convert profile-specific sections: copy each section between --- separators separately and convert them individually. Each section is valid standalone YAML.
Common Type Issues Revealed by JSON Conversion
These are the most common Spring Boot YAML type problems that JSON conversion exposes:
Port as string:
# YAML server: port: "8080" # quoted — becomes string in JSON
Spring Boot expects an integer for server.port. Quoting it causes a binding failure. Remove the quotes.
Boolean as YAML 1.1:
# YAML 1.1 — 'yes' and 'no' are booleans feature: enabled: yes # becomes true in JSON
If your YAML parser uses 1.1 spec, yes and no become true/false. Use explicit true/false for clarity.
Empty value becomes null:
spring:
datasource:
password: # empty — becomes null in JSON
If a required @Value field gets null, this is likely why. Either provide a value or configure a default: @Value("${spring.datasource.password:}").
Debug Your application.yml Right Now
Paste your Spring Boot YAML config, click Convert. Inspect types, nesting, and missing keys in the JSON output instantly.
Open Free YAML to JSON ConverterFrequently Asked Questions
Can I convert Spring Boot application.yml to JSON online?
Yes. Spring Boot's application.yml is standard YAML and converts directly to JSON in a browser-based converter. Paste the file contents (or the relevant section), click Convert, and inspect the JSON output. Note: multi-profile YAML files using --- separators must be split into individual sections before converting.
Why is my Spring Boot property not binding correctly?
Convert your application.yml to JSON and inspect the output. Check: (1) is the property present in the JSON at all? If not, there's an indentation error in the YAML. (2) is the value the right type? Integers should be unquoted, strings quoted. (3) is the nesting correct? Spring uses the nested JSON path to build the dot-notation property name.
Does Spring Boot use YAML 1.1 or YAML 1.2?
Spring Boot historically used SnakeYAML for parsing, which implements YAML 1.1. This means yes/no/on/off are treated as booleans in YAML 1.1. In newer Spring Boot versions (3.x), SnakeYAML may behave differently. Use explicit true/false for booleans in application.yml to avoid version-specific differences.
How do I handle Spring Boot multi-profile YAML files when converting?
Multi-document YAML (sections separated by ---) contains multiple YAML documents. Copy each section between separators individually and convert them separately. Each section between --- markers is a standalone YAML document.

