日常安利toml。yaml太反人类了,可读性极差,夸张点要拿尺子来量缩进。改成toml的话是这样子的:
[server]
port=8090 # 注释
[spring.datasource]
type="com.zaxxer.hikari.HikariDataSource"
driver-class-name="org.h2.Driver"
url="jdbc:h2:file=/.halo/db/halo"
username="admin"
password="123456"
[spring.h2.console]
settings = { web-allow-others=false}
path="/h2-console"
enabled=false"
在toml中,a={b1={c=[1,2,3]}, b2="emm"}等效于
[a]
b2="emm"
[a.b1]
c=[1,2,3]
个人觉得toml可读性比yaml和json强太多了。