FasterXML / FasterXML/jackson-dataformats-text

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

Aperta
#506 39 commenti 0 reazioni 0 assegnatari Vedi su GitHub
yaml
Lingua principale
Java
Stelle
455
Fork
164
Merge medio
6g 10h
PR unite (30g)
2

Descrizione

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/

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.