jsonb-api icon indicating copy to clipboard operation
jsonb-api copied to clipboard

Support getter-only list.

Open onacit opened this issue 3 years ago • 1 comments

Apologies whenever this issue is not appropriate.

May I have a chance of deserializing a collection field using a getter only?


public List<Some> getSome() { // JAXB used to work with this.
    if (some == null) {
        some = new ArrayList<>();
    }
    return some;
}

//public void setSome(List<Some> some) {
//    this.some = some;
//}

private List<Some> some;

Thank you.

onacit avatar Aug 20 '22 06:08 onacit

+1, we have a flag in johnzon for that (feature is named "use getter as writer" for collections). There are a few cases it makes sense - often when reusing jaxb model as mentionned.

rmannibucau avatar Aug 20 '22 06:08 rmannibucau