FasterXML / FasterXML/jackson-databind

Allow for multiple `@JsonAnySetter` when `@JsonUnwrapped` is supplied

Aperta
#2,877 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
3.7k
Fork
1.5k
Merge medio
3g 6h
PR unite (30g)
28

Descrizione

I am dealing with JSON where properties for certain areas are prefixed with given values. For example,

```json
{
"key" : "val1",
"@key" : "val2",
"$key" : "val3"
}
```

should be represented as a bean of three categories of property:

```java
class Bean {
@JsonAnySetter
Map normal;
@JsonAnySetter
@JsonUnwrapped(prefix = "@")
Map ats;
@JsonAnySetter
@JsonUnwrapped(prefix = "$")
Map dollars;
}
```

I understand that this is rather comples but the serialization works just fine. It would be brilliant being able to deserialize a JSON property if any property would only match one of the unwrapped specifications whereas any other property would end up in the non-unwrapped target.

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.