0

I use the RestEasy client. In the processed json object there is a base64 encoded byte array. However, the Yasson library assumes an int-coded array in the unconfigured case. How I tell the JsonConfig the BinaryDataStrategy.BASE_64?

I have tried with no luck with

@Provider
@Priority(99)
@Produces({MediaType.APPLICATION_JSON})
public class JSONConfigurator implements ContextResolver<Jsonb> {

    @Override
    public Jsonb getContext(Class type) {
        JsonbConfig config = new JsonbConfig()
                .withBinaryDataStrategy(BinaryDataStrategy.BASE_64);
        return JsonbBuilder.newBuilder()
                .withConfig(config)
                .build();
    }
}

How does this work? How to configure Json-B in RestEasy Client?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Superhugo
  • 1
  • 1

1 Answers1

0

I need to register my CustomResolver<Jsonb> on my ReastEasy-Client as follows:

ResteasyClient client = clientBuilder.build();
client.register(JSONConfigurator.class);
Superhugo
  • 1
  • 1