For each of the four schemas, the first column shows to which type the input YAML should resolve. The second column shows how the output YAML should look like.
YAML 1.2 | YAML 1.1 | |||||||
---|---|---|---|---|---|---|---|---|
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
Type | Output | Type | Output | Type | Output | Type | Output | |
null | str | null | null | null | null | null | null | null |
#empty | str | '' | str | '' | null | null | null | null |
NULL | str | NULL | str | NULL | null | null | null | null |
Null | str | Null | str | Null | null | null | null | null |
~ | str | ~ | str | ~ | null | null | null | null |
false | str | false | bool | false | bool | false | bool | false |
true | str | true | bool | true | bool | true | bool | true |
FALSE | str | FALSE | str | FALSE | bool | false | bool | false |
False | str | False | str | False | bool | false | bool | false |
TRUE | str | TRUE | str | TRUE | bool | true | bool | true |
True | str | True | str | True | bool | true | bool | true |
N | str | N | str | N | str | N | bool | false |
n | str | n | str | n | str | n | bool | false |
NO | str | NO | str | NO | str | NO | bool | false |
No | str | No | str | No | str | No | bool | false |
no | str | no | str | no | str | no | bool | false |
OFF | str | OFF | str | OFF | str | OFF | bool | false |
Off | str | Off | str | Off | str | Off | bool | false |
off | str | off | str | off | str | off | bool | false |
ON | str | ON | str | ON | str | ON | bool | true |
On | str | On | str | On | str | On | bool | true |
on | str | on | str | on | str | on | bool | true |
Y | str | Y | str | Y | str | Y | bool | true |
y | str | y | str | y | str | y | bool | true |
YES | str | YES | str | YES | str | YES | bool | true |
Yes | str | Yes | str | Yes | str | Yes | bool | true |
yes | str | yes | str | yes | str | yes | bool | true |
-3.14 | str | -3.14 | float | -3.14 | float | -3.14 | float | -3.14 |
0.0 | str | 0.0 | float | 0.0 | float | 0.0 | float | 0.0 |
3. | str | 3. | float | 3.0 | float | 3.0 | float | 3.0 |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
3.14 | str | 3.14 | float | 3.14 | float | 3.14 | float | 3.14 |
3.140 | str | 3.140 | float | 3.14 | float | 3.14 | float | 3.14 |
3.3e+3 | str | 3.3e+3 | float | 3300.0 | float | 3300.0 | float | 3300.0 |
+0.3e+3 | str | +0.3e+3 | str | +0.3e+3 | float | 300.0 | float | 300.0 |
+3.14 | str | +3.14 | str | +3.14 | float | 3.14 | float | 3.14 |
.0 | str | .0 | str | .0 | float | 0.0 | float | 0.0 |
.14 | str | .14 | str | .14 | float | 0.14 | float | 0.14 |
.3e+3 | str | .3e+3 | str | .3e+3 | float | 300.0 | float | 300.0 |
.3E-1 | str | .3E-1 | str | .3E-1 | float | 0.03 | float | 0.03 |
001.23 | str | 001.23 | str | 001.23 | float | 1.23 | float | 1.23 |
03.14 | str | 03.14 | str | 03.14 | float | 3.14 | float | 3.14 |
.1_4 | str | .1_4 | str | .1_4 | str | .1_4 | float | 0.14 |
190:20:30.15 | str | 190:20:30.15 | str | 190:20:30.15 | str | 190:20:30.15 | float | 685230.15 |
85.230_15e+03 | str | 85.230_15e+03 | str | 85.230_15e+03 | str | 85.230_15e+03 | float | 85230.15 |
85_230.15 | str | 85_230.15 | str | 85_230.15 | str | 85_230.15 | float | 85230.15 |
+.INF | str | +.INF | str | +.INF | inf | .inf | inf | .inf |
+.Inf | str | +.Inf | str | +.Inf | inf | .inf | inf | .inf |
+.inf | str | +.inf | str | +.inf | inf | .inf | inf | .inf |
-.INF | str | -.INF | str | -.INF | inf | -.inf | inf | -.inf |
-.Inf | str | -.Inf | str | -.Inf | inf | -.inf | inf | -.inf |
-.inf | str | -.inf | str | -.inf | inf | -.inf | inf | -.inf |
.INF | str | .INF | str | .INF | inf | .inf | inf | .inf |
.Inf | str | .Inf | str | .Inf | inf | .inf | inf | .inf |
.inf | str | .inf | str | .inf | inf | .inf | inf | .inf |
.NAN | str | .NAN | str | .NAN | nan | .nan | nan | .nan |
.NaN | str | .NaN | str | .NaN | nan | .nan | nan | .nan |
.nan | str | .nan | str | .nan | nan | .nan | nan | .nan |
-0 | str | -0 | int | 0 | int | 0 | int | 0 |
-23 | str | -23 | int | -23 | int | -23 | int | -23 |
0 | str | 0 | int | 0 | int | 0 | int | 0 |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
23 | str | 23 | int | 23 | int | 23 | int | 23 |
+0 | str | +0 | str | +0 | int | 0 | int | 0 |
+23 | str | +23 | str | +23 | int | 23 | int | 23 |
00 | str | 00 | str | 00 | int | 0 | int | 0 |
0011 | str | 0011 | str | 0011 | int | 11 | int | 9 |
010 | str | 010 | str | 010 | int | 10 | int | 8 |
07 | str | 07 | str | 07 | int | 7 | int | 7 |
0x0 | str | 0x0 | str | 0x0 | int | 0 | int | 0 |
0x10 | str | 0x10 | str | 0x10 | int | 16 | int | 16 |
0x42 | str | 0x42 | str | 0x42 | int | 66 | int | 66 |
0xa | str | 0xa | str | 0xa | int | 10 | int | 10 |
+0100_200 | str | +0100_200 | str | +0100_200 | str | +0100_200 | int | 32896 |
+0b100 | str | +0b100 | str | +0b100 | str | +0b100 | int | 4 |
+190:20:30 | str | +190:20:30 | str | +190:20:30 | str | +190:20:30 | int | 685230 |
-0100_200 | str | -0100_200 | str | -0100_200 | str | -0100_200 | int | -32896 |
-0b101 | str | -0b101 | str | -0b101 | str | -0b101 | int | -5 |
-0x30 | str | -0x30 | str | -0x30 | str | -0x30 | int | -48 |
-190:20:30 | str | -190:20:30 | str | -190:20:30 | str | -190:20:30 | int | -685230 |
02_0 | str | 02_0 | str | 02_0 | str | 02_0 | int | 16 |
0b0 | str | 0b0 | str | 0b0 | str | 0b0 | int | 0 |
0b100_101 | str | 0b100_101 | str | 0b100_101 | str | 0b100_101 | int | 37 |
0x2_0 | str | 0x2_0 | str | 0x2_0 | str | 0x2_0 | int | 32 |
100_000 | str | 100_000 | str | 100_000 | str | 100_000 | int | 100000 |
190:20:30 | str | 190:20:30 | str | 190:20:30 | str | 190:20:30 | int | 685230 |
0.3e3 | str | 0.3e3 | float | 300.0 | float | 300.0 | str | 0.3e3 |
3e3 | str | 3e3 | float | 3000.0 | float | 3000.0 | str | 3e3 |
+0.3e3 | str | +0.3e3 | str | +0.3e3 | float | 300.0 | str | +0.3e3 |
.3e3 | str | .3e3 | str | .3e3 | float | 300.0 | str | .3e3 |
08 | str | 08 | str | 08 | int | 8 | str | 08 |
0o0 | str | 0o0 | str | 0o0 | int | 0 | str | 0o0 |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
0o10 | str | 0o10 | str | 0o10 | int | 8 | str | 0o10 |
0o7 | str | 0o7 | str | 0o7 | int | 7 | str | 0o7 |
. | str | . | str | . | str | . | str | . |
._ | str | ._ | str | ._ | str | ._ | str | ._ |
._14 | str | ._14 | str | ._14 | str | ._14 | str | ._14 |
.inF | str | .inF | str | .inF | str | .inF | str | .inF |
_._ | str | _._ | str | _._ | str | _._ | str | _._ |
fAlse | str | fAlse | str | fAlse | str | fAlse | str | fAlse |
inf | str | inf | str | inf | str | inf | str | inf |
nO | str | nO | str | nO | str | nO | str | nO |
nuLL | str | nuLL | str | nuLL | str | nuLL | str | nuLL |
TrUE | str | TrUE | str | TrUE | str | TrUE | str | TrUE |
!!null null | error | null | null | null | null | null | null | |
!!null #empty | error | error | null | null | null | null | ||
!!null NULL | error | error | null | null | null | null | ||
!!null Null | error | error | null | null | null | null | ||
!!null ~ | error | error | null | null | null | null | ||
!!bool false | error | bool | false | bool | false | bool | false | |
!!bool true | error | bool | true | bool | true | bool | true | |
!!bool FALSE | error | error | bool | false | bool | false | ||
!!bool False | error | error | bool | false | bool | false | ||
!!bool TRUE | error | error | bool | true | bool | true | ||
!!bool True | error | error | bool | true | bool | true | ||
!!bool N | error | error | error | bool | false | |||
!!bool n | error | error | error | bool | false | |||
!!bool NO | error | error | error | bool | false | |||
!!bool No | error | error | error | bool | false | |||
!!bool no | error | error | error | bool | false | |||
!!bool OFF | error | error | error | bool | false | |||
!!bool Off | error | error | error | bool | false | |||
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!bool off | error | error | error | bool | false | |||
!!bool ON | error | error | error | bool | true | |||
!!bool On | error | error | error | bool | true | |||
!!bool on | error | error | error | bool | true | |||
!!bool Y | error | error | error | bool | true | |||
!!bool y | error | error | error | bool | true | |||
!!bool YES | error | error | error | bool | true | |||
!!bool Yes | error | error | error | bool | true | |||
!!bool yes | error | error | error | bool | true | |||
!!float -3.14 | error | float | -3.14 | float | -3.14 | float | -3.14 | |
!!float 0.0 | error | float | 0.0 | float | 0.0 | float | 0.0 | |
!!float 3. | error | float | 3.0 | float | 3.0 | float | 3.0 | |
!!float 3.14 | error | float | 3.14 | float | 3.14 | float | 3.14 | |
!!float +0.3e+3 | error | error | float | 300.0 | float | 300.0 | ||
!!float .0 | error | error | float | 0.0 | float | 0.0 | ||
!!float .14 | error | error | float | 0.14 | float | 0.14 | ||
!!float .3e+3 | error | error | float | 300.0 | float | 300.0 | ||
!!float .3E-1 | error | error | float | 0.03 | float | 0.03 | ||
!!float 001.23 | error | error | float | 1.23 | float | 1.23 | ||
!!float 3.3e+3 | error | error | float | 3300.0 | float | 3300.0 | ||
!!float .1_4 | error | error | error | float | 0.14 | |||
!!float 190:20:30.15 | error | error | error | float | 685230.15 | |||
!!float 85.230_15e+03 | error | error | error | float | 85230.15 | |||
!!float 85_230.15 | error | error | error | float | 85230.15 | |||
!!float +.INF | error | error | inf | .inf | inf | .inf | ||
!!float +.Inf | error | error | inf | .inf | inf | .inf | ||
!!float +.inf | error | error | inf | .inf | inf | .inf | ||
!!float -.INF | error | error | inf | -.inf | inf | -.inf | ||
!!float -.Inf | error | error | inf | -.inf | inf | -.inf | ||
!!float -.inf | error | error | inf | -.inf | inf | -.inf | ||
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!float .INF | error | error | inf | .inf | inf | .inf | ||
!!float .Inf | error | error | inf | .inf | inf | .inf | ||
!!float .inf | error | error | inf | .inf | inf | .inf | ||
!!float .NAN | error | error | nan | .nan | nan | .nan | ||
!!float .NaN | error | error | nan | .nan | nan | .nan | ||
!!float .nan | error | error | nan | .nan | nan | .nan | ||
!!int -0 | error | int | 0 | int | 0 | int | 0 | |
!!int -23 | error | int | -23 | int | -23 | int | -23 | |
!!int 0 | error | int | 0 | int | 0 | int | 0 | |
!!int 23 | error | int | 23 | int | 23 | int | 23 | |
!!int +0 | error | error | int | 0 | int | 0 | ||
!!int +23 | error | error | int | 23 | int | 23 | ||
!!int 0011 | error | error | int | 11 | int | 9 | ||
!!int 07 | error | error | int | 7 | int | 7 | ||
!!int 0x0 | error | error | int | 0 | int | 0 | ||
!!int 0x10 | error | error | int | 16 | int | 16 | ||
!!int 0x42 | error | error | int | 66 | int | 66 | ||
!!int 0xa | error | error | int | 10 | int | 10 | ||
!!int +0100_200 | error | error | error | int | 32896 | |||
!!int +0b100 | error | error | error | int | 4 | |||
!!int +190:20:30 | error | error | error | int | 685230 | |||
!!int -0100_200 | error | error | error | int | -32896 | |||
!!int -0b101 | error | error | error | int | -5 | |||
!!int -0x30 | error | error | error | int | -48 | |||
!!int -190:20:30 | error | error | error | int | -685230 | |||
!!int 00 | error | error | error | int | 0 | |||
!!int 010 | error | error | error | int | 8 | |||
!!int 02_0 | error | error | error | int | 16 | |||
!!int 0b0 | error | error | error | int | 0 | |||
!!int 0b100_101 | error | error | error | int | 37 | |||
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!int 0x2_0 | error | error | error | int | 32 | |||
!!int 100_000 | error | error | error | int | 100000 | |||
!!int 190:20:30 | error | error | error | int | 685230 | |||
!!str #empty | str | '' | str | '' | str | '' | str | '' |
!!str +.INF | str | +.INF | str | +.INF | str | '+.INF' | str | '+.INF' |
!!str +.Inf | str | +.Inf | str | +.Inf | str | '+.Inf' | str | '+.Inf' |
!!str +.inf | str | +.inf | str | +.inf | str | '+.inf' | str | '+.inf' |
!!str +0 | str | +0 | str | +0 | str | '+0' | str | '+0' |
!!str +0.3e+3 | str | +0.3e+3 | str | +0.3e+3 | str | '+0.3e+3' | str | '+0.3e+3' |
!!str +0.3e3 | str | +0.3e3 | str | +0.3e3 | str | '+0.3e3' | str | +0.3e3 |
!!str +0100_200 | str | +0100_200 | str | +0100_200 | str | +0100_200 | str | '+0100_200' |
!!str +0b100 | str | +0b100 | str | +0b100 | str | +0b100 | str | '+0b100' |
!!str +190:20:30 | str | +190:20:30 | str | +190:20:30 | str | +190:20:30 | str | '+190:20:30' |
!!str +23 | str | +23 | str | +23 | str | '+23' | str | '+23' |
!!str -.INF | str | -.INF | str | -.INF | str | '-.INF' | str | '-.INF' |
!!str -.Inf | str | -.Inf | str | -.Inf | str | '-.Inf' | str | '-.Inf' |
!!str -.inf | str | -.inf | str | -.inf | str | '-.inf' | str | '-.inf' |
!!str -0 | str | -0 | str | '-0' | str | '-0' | str | '-0' |
!!str -0100_200 | str | -0100_200 | str | -0100_200 | str | -0100_200 | str | '-0100_200' |
!!str -0b101 | str | -0b101 | str | -0b101 | str | -0b101 | str | '-0b101' |
!!str -0x30 | str | -0x30 | str | -0x30 | str | -0x30 | str | '-0x30' |
!!str -190:20:30 | str | -190:20:30 | str | -190:20:30 | str | -190:20:30 | str | '-190:20:30' |
!!str -23 | str | -23 | str | '-23' | str | '-23' | str | '-23' |
!!str -3.14 | str | -3.14 | str | '-3.14' | str | '-3.14' | str | '-3.14' |
!!str . | str | . | str | . | str | . | str | . |
!!str .0 | str | .0 | str | .0 | str | '.0' | str | '.0' |
!!str .14 | str | .14 | str | .14 | str | '.14' | str | '.14' |
!!str .1_4 | str | .1_4 | str | .1_4 | str | .1_4 | str | '.1_4' |
!!str .3e+3 | str | .3e+3 | str | .3e+3 | str | '.3e+3' | str | '.3e+3' |
!!str .3E-1 | str | .3E-1 | str | .3E-1 | str | '.3E-1' | str | '.3E-1' |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!str .3e3 | str | .3e3 | str | .3e3 | str | '.3e3' | str | .3e3 |
!!str ._ | str | ._ | str | ._ | str | ._ | str | ._ |
!!str ._14 | str | ._14 | str | ._14 | str | ._14 | str | ._14 |
!!str .INF | str | .INF | str | .INF | str | '.INF' | str | '.INF' |
!!str .Inf | str | .Inf | str | .Inf | str | '.Inf' | str | '.Inf' |
!!str .inf | str | .inf | str | .inf | str | '.inf' | str | '.inf' |
!!str .NAN | str | .NAN | str | .NAN | str | '.NAN' | str | '.NAN' |
!!str .NaN | str | .NaN | str | .NaN | str | '.NaN' | str | '.NaN' |
!!str .nan | str | .nan | str | .nan | str | '.nan' | str | '.nan' |
!!str 0 | str | 0 | str | '0' | str | '0' | str | '0' |
!!str 0.0 | str | 0.0 | str | '0.0' | str | '0.0' | str | '0.0' |
!!str 0.3e3 | str | 0.3e3 | str | '0.3e3' | str | '0.3e3' | str | 0.3e3 |
!!str 00 | str | 00 | str | 00 | str | '00' | str | '00' |
!!str 001.23 | str | 001.23 | str | 001.23 | str | '001.23' | str | '001.23' |
!!str 0011 | str | 0011 | str | 0011 | str | '0011' | str | '0011' |
!!str 010 | str | 010 | str | 010 | str | '010' | str | '010' |
!!str 02_0 | str | 02_0 | str | 02_0 | str | 02_0 | str | '02_0' |
!!str 07 | str | 07 | str | 07 | str | '07' | str | '07' |
!!str 0b0 | str | 0b0 | str | 0b0 | str | 0b0 | str | '0b0' |
!!str 0b100_101 | str | 0b100_101 | str | 0b100_101 | str | 0b100_101 | str | '0b100_101' |
!!str 0o0 | str | 0o0 | str | 0o0 | str | '0o0' | str | 0o0 |
!!str 0o10 | str | 0o10 | str | 0o10 | str | '0o10' | str | 0o10 |
!!str 0o7 | str | 0o7 | str | 0o7 | str | '0o7' | str | 0o7 |
!!str 0x0 | str | 0x0 | str | 0x0 | str | '0x0' | str | '0x0' |
!!str 0x2_0 | str | 0x2_0 | str | 0x2_0 | str | 0x2_0 | str | '0x2_0' |
!!str 0xa | str | 0xa | str | 0xa | str | '0xa' | str | '0xa' |
!!str 100_000 | str | 100_000 | str | 100_000 | str | 100_000 | str | '100_000' |
!!str 190:20:30 | str | 190:20:30 | str | 190:20:30 | str | 190:20:30 | str | '190:20:30' |
!!str 190:20:30.15 | str | 190:20:30.15 | str | 190:20:30.15 | str | 190:20:30.15 | str | '190:20:30.15' |
!!str 23 | str | 23 | str | '23' | str | '23' | str | '23' |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!str 3. | str | '3.' | str | '3.' | str | '3.' | str | '3.' |
!!str 3.14 | str | 3.14 | str | '3.14' | str | '3.14' | str | '3.14' |
!!str 3.3e+3 | str | 3.3e+3 | str | '3.3e+3' | str | '3.3e+3' | str | '3.3e+3' |
!!str 85.230_15e+03 | str | 85.230_15e+03 | str | 85.230_15e+03 | str | 85.230_15e+03 | str | '85.230_15e+03' |
!!str 85_230.15 | str | 85_230.15 | str | 85_230.15 | str | 85_230.15 | str | '85_230.15' |
!!str _._ | str | _._ | str | _._ | str | _._ | str | _._ |
!!str FALSE | str | FALSE | str | FALSE | str | 'FALSE' | str | 'FALSE' |
!!str False | str | False | str | False | str | 'False' | str | 'False' |
!!str false | str | false | str | 'false' | str | 'false' | str | 'false' |
!!str N | str | N | str | N | str | N | str | 'N' |
!!str n | str | n | str | n | str | n | str | 'n' |
!!str NO | str | NO | str | NO | str | NO | str | 'NO' |
!!str No | str | No | str | No | str | No | str | 'No' |
!!str no | str | no | str | no | str | no | str | 'no' |
!!str NULL | str | NULL | str | NULL | str | 'NULL' | str | 'NULL' |
!!str Null | str | Null | str | Null | str | 'Null' | str | 'Null' |
!!str null | str | null | str | 'null' | str | 'null' | str | 'null' |
!!str OFF | str | OFF | str | OFF | str | OFF | str | 'OFF' |
!!str Off | str | Off | str | Off | str | Off | str | 'Off' |
!!str off | str | off | str | off | str | off | str | 'off' |
!!str ON | str | ON | str | ON | str | ON | str | 'ON' |
!!str On | str | On | str | On | str | On | str | 'On' |
!!str on | str | on | str | on | str | on | str | 'on' |
!!str TRUE | str | TRUE | str | TRUE | str | 'TRUE' | str | 'TRUE' |
!!str True | str | True | str | True | str | 'True' | str | 'True' |
!!str true | str | true | str | 'true' | str | 'true' | str | 'true' |
!!str Y | str | Y | str | Y | str | Y | str | 'Y' |
!!str y | str | y | str | y | str | y | str | 'y' |
!!str YES | str | YES | str | YES | str | YES | str | 'YES' |
!!str Yes | str | Yes | str | Yes | str | Yes | str | 'Yes' |
Input YAML | Failsafe | JSON | Core | YAML 1.1 | ||||
!!str yes | str | yes | str | yes | str | yes | str | 'yes' |
!!str ~ | str | ~ | str | ~ | str | '~' | str | '~' |
!!float 0.3e3 | error | float | 300.0 | float | 300.0 | error | ||
!!float +0.3e3 | error | error | float | 300.0 | error | |||
!!float .3e3 | error | error | float | 300.0 | error | |||
!!int 0o0 | error | error | int | 0 | error | |||
!!int 0o10 | error | error | int | 8 | error | |||
!!int 0o7 | error | error | int | 7 | error | |||
!!bool FaLSE | error | error | error | error | ||||
!!bool nO | error | error | error | error | ||||
!!bool TrUE | error | error | error | error | ||||
!!bool yEs | error | error | error | error | ||||
!!float .inF | error | error | error | error | ||||
!!float .nAn | error | error | error | error | ||||
!!float inf | error | error | error | error | ||||
!!float nan | error | error | error | error | ||||
!!null NuLL | error | error | error | error |