FasterXML / FasterXML/jackson-dataformats-text

in yaml, a ~ key should allow to assing a value to the parent key

Open
#506 39 comments 0 reactions 0 assignees View on GitHub
yaml
Dominant language
Java
Stars
455
Forks
164
Avg merge
6d 10h
Merged PRs (30d)
2

Description

In Yaml spec, if one property is the prefix of another, a value can be attributed to the parent one using ~ as a null key to represent any YAML property that is a prefix of another one.

The following test is failing:

```
public void testTildeIsDeserializedAsNullKey() throws Exception
{
final String YAML =
"quarkus:\n" +
" log:\n" +
" sentry:\n" +
" ~: true\n" +
" dsn: 'some string'";

JsonNode node = MAPPER.readValue(YAML, JsonNode.class);
assertTrue(node.get("quarkus").get("log").get("sentry").booleanValue());
}
```

instead, the following statement is true:

`assertTrue(node.get("quarkus").get("log").get("sentry").get("~").booleanValue())`

quarkus.log.sentry."~" is true instead of quarkus.log.sentry

Relevant conversation:

https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/yaml.20property.20conflict

Relevant spec:

https://quarkus.io/guides/config-yaml#configuration-property-conflicts

https://yaml.org/spec/1.2.2/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.