eclipse-ee4j / eclipse-ee4j/yasson
Support package-private classes/accessors
- Dominant language
- Java
- Stars
- 218
- Forks
- 109
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 9
Description
**Is your feature request related to a problem? Please describe.**
Assuming all classes responsible communication with some external resource or a JAX-RS endpoint, there is no need to make the DTOs public. Once they are public, misuse can easily happen.
**Describe the solution you'd like**
The reflection api has the capabilities to make fields accessible which are not public. JSONB/Yasson should make use of this and dont force public accessors onto its users.
**Describe alternatives you've considered**
Jackson does support package-private visibility, but some apis are hardwired to json-b.
**Additional context**
The Java bean-convention, despite its success, has polluted the java ecosystem with its overuse of public. Most developers just dont think about accessibility anymore. They just create a class and make everything public because that was the way it was necessary for instance to work with Hibernate.
The Java community should leave those days behind.
Contributor guide
Research direction
Start by tracing Yasson's reflection and visibility handling for JSONB serialization and deserialization, using Java reflection APIs as the relevant entry point. Verify behavior with package-private DTO classes and accessors; done means these work without requiring public access.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100