AI REVIEWED
Module: codec
File: codec/yaml/snakeyaml/SnakeYamlOps.java (~line 873)
Severity: High
Summary
SnakeYamlOps.getMapEntries() returns Pair.of(String, Object) with raw string keys, while all Jackson-based implementations return keys wrapped as TextNode.valueOf(key). This inconsistency causes problems during cross-format conversion — consumer code expecting wrapped objects receives raw strings.
Expected Behavior
Map entry keys should be consistently wrapped as the format's native string type, matching the pattern used by Jackson implementations.
Actual Behavior
// Jackson implementations:
Pair.of(TextNode.valueOf(entry.getKey()), entry.getValue()) // wrapped
// SnakeYamlOps:
Pair.of(entry.getKey(), entry.getValue()) // raw String
Suggested Fix
Wrap keys consistently:
Pair.of((Object) entry.getKey(), entry.getValue())
Or if SnakeYAML has a canonical string wrapper, use that. The key point is that the return type should match what createString() produces.
AI REVIEWED
Module: codec
File:
codec/yaml/snakeyaml/SnakeYamlOps.java(~line 873)Severity: High
Summary
SnakeYamlOps.getMapEntries()returnsPair.of(String, Object)with raw string keys, while all Jackson-based implementations return keys wrapped asTextNode.valueOf(key). This inconsistency causes problems during cross-format conversion — consumer code expecting wrapped objects receives raw strings.Expected Behavior
Map entry keys should be consistently wrapped as the format's native string type, matching the pattern used by Jackson implementations.
Actual Behavior
Suggested Fix
Wrap keys consistently:
Or if SnakeYAML has a canonical string wrapper, use that. The key point is that the return type should match what
createString()produces.