FasterXML / FasterXML/jackson-dataformats-text

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

Abierto
#506 39 comentarios 0 reacciones 0 asignados Ver en GitHub
yaml
Lenguaje dominante
Java
Estrellas
455
Forks
164
Merge medio
6 d 10 h
PR fusionados (30 d)
2

Descripción

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/

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.