Elytrium / Elytrium/java-serializer

Invalid serialization if single double quotation mark is present

Aperta
#2 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
27
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

If you insert only one double quotation mark in the field like this:
```yaml
test-section:
# Some description for this test value1
value-test: "
# Some description for this test value2
value-test-2: "test2"
```

The result of the serialization will be as follows:
```yaml
test-section:
# Some description for this test value1
value-test: " # Some description for this test value2 value-test-2: "
# Some description for this test value2
value-test-2: "test2"
```

It looks like reader keeps looking for the next double quote even when the next field starts.

Configuration used:
```java
public class TestSettings extends YamlSerializable {

@Transient
private static final SerializerConfig CONFIG = new SerializerConfig.Builder()
.setCommentValueIndent(1)
.build();
@Transient
public static final TestSettings IMP = new TestSettings();

public TestSettings() {
super(CONFIG);
}

public TEST_SECTION TEST_SECTION = new TEST_SECTION();

public static class TEST_SECTION {

@Comment(value = {
@CommentValue("Some description for this test value1"),
}, at = Comment.At.PREPEND)
public String VALUE_TEST = "test1";

@Comment(value = {
@CommentValue("Some description for this test value2"),
}, at = Comment.At.PREPEND)
public String VALUE_TEST2 = "test2";

}
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo la serializzazione YAML mostrata nell'issue con la configurazione Java TestSettings fornita, concentrandoti su come una singola virgoletta doppia viene letta attraverso il campo successivo. Il lavoro è completato quando il campo seguente rimane separato e l'output serializzato preserva entrambi i valori e i commenti invece di consumare la chiave successiva.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.