jakartaee / jakartaee/jsonb-api
include @JsonbGraph to (de)serialize subset of Json-B entity
- Dominant language
- Java
- Stars
- 95
- Forks
- 41
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 35
Description
Would be nice to have filter/query cabapilities to (de)serialize only a subset of the Json-B entity per config.
**For example:**
```
// (de)serialize only "id", tasks and their name
@JsonbGraph(name= "ItemWithTasks" value = {"id", "tasks", "tasks.name"})
public class Item {
private int id;
private String description;
private Set tasks;
}
```
and use it like:
```
var item = new Item(..);
var toJson = JsonbBuilder.create().withGraph("ItemWithTasks").toJson(item);
var fromJson = JsonbBuilder.create().withGraph("ItemWithTasks").fromJson(toJson)
```
The `@JsonbGraph` can provide capabilities like **GraphQL** or **JPA FetchGraph**.
Contributor guide
Research direction
No file, test, or entry point is named. Start by reading the existing Json-B API around JsonbBuilder and compare the requested graph behavior with the cited GraphQL and JPA FetchGraph concepts. Done would require an agreed scope and acceptance criteria for @JsonbGraph, including both serialization and deserialization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100