Yaml encoder/decoder for OCaml jsont codecs

Fix quoted empty strings being parsed as null in YAML

In decode_any_scalar, quoted scalars that look like null (e.g., "" or
"null") were incorrectly being treated as null values. Only plain
(unquoted) scalars should be resolved as null according to YAML spec.

This fix adds a style check before the is_null_scalar check, ensuring
that quoted empty strings like `default: ""` are correctly parsed as
empty strings rather than null.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

+5 -2
+5 -2
lib/yamlt.ml
··· 303 303 check_nodes d; 304 304 let meta = meta_of_span d ev.span in 305 305 let type_err fnd = Jsont.Repr.type_error meta t ~fnd in 306 - (* Determine which decoder to use based on scalar content *) 307 - if is_null_scalar value then 306 + (* Determine which decoder to use based on scalar content. 307 + IMPORTANT: Quoted scalars that look like null (e.g., "" or "null") 308 + should be treated as strings, not null. Only plain scalars 309 + should be resolved as null. *) 310 + if style = `Plain && is_null_scalar value then 308 311 match map.dec_null with 309 312 | Some t' -> decode_scalar_as d ev value style t' 310 313 | None -> type_err Jsont.Sort.Null