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

@JsonbPropertyOrder in relation to inherited properties clarification

Open bravehorsie opened this issue 6 years ago • 0 comments

in JSONB specification document section 3.13, it is required that properties from parent classes are serialized first.

@JsonbPropertyOrder annotation is declared on a TYPE. Should it include properties from parent class and override statement from 3.13?

Given example:

@JsonbPropertyOrder("b","a")
class A {
  public String a;
  public String b;
}

@JsonbPropertyOrder("c","d","a","b")
class B extends A {
  public String c;
  public String d;
}

What should be result of serialization instance of type B? Can the spec be clear on this behavior?

Related to https://github.com/eclipse-ee4j/yasson/issues/228

bravehorsie avatar Feb 13 '19 08:02 bravehorsie