jakartaee / jakartaee/jsonb-api

@JsonbPropertyOrder in relation to inherited properties clarification

Open
#119 0 comments 0 reactions 0 assignees View on GitHub
documentation enhancement
Dominant language
Java
Stars
95
Forks
41
Avg merge
1d 6h
Merged PRs (30d)
35

Description

in [JSONB specification document](https://jcp.org/en/jsr/detail?id=367) 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:
```java
@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](https://github.com/eclipse-ee4j/yasson/issues/228)

Contributor guide

Open the contributing guide

Research direction

Start with section 3.13 of the JSON-B specification and compare it with the @JsonbPropertyOrder example in this issue. Review the related yasson issue 228, then document the expected serialization order and clarify whether inherited properties are included or overridden; no implementation file or test is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.