eclipse-ee4j / eclipse-ee4j/jersey
Jsonb still not injectable
- Dominant language
- Java
- Stars
- 730
- Forks
- 382
- PR merge metrics
- No merged PRs in 30d
Description
The example project: https://github.com/hantsy/jakartaee11-sandbox/tree/master/rest
* Java: 21
* Glassfish v8.0.0-M6 built-in Jersey
I have created a `@Provider` described like this:
```java
@Provider
public class JsonbContextResolver implements ContextResolver {
@Override
public Jsonb getContext(Class type) {
JsonbConfig config = new JsonbConfig()
.withPropertyNamingStrategy(PropertyNamingStrategy.LOWER_CASE_WITH_UNDERSCORES)
.withFormatting(true)
.withNullValues(false);
return JsonbBuilder.newBuilder().withConfig(config).build();
}
}
```
As discussed in here, https://github.com/jakartaee/rest/issues/742, a `Jsonb` instance should be available in the context.
```java
@Inject Jsonb jsonb;
```
I tried to inject `Jsonb`, failed.
Contributor guide
Assessment
This issue has not been assessed yet.