Annotation Type CustomSerialization


  • @Experimental("Remains to be determined if this is the best possible API for users to configure per Resource Method Serialization")
    @Retention(RUNTIME)
    @Target(METHOD)
    public @interface CustomSerialization
    Annotation that can be used on RESTEasy Reactive Resource method to allow users to configure Jackson serialization for that method only, without affecting the global Jackson configuration.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends BiFunction<com.fasterxml.jackson.databind.ObjectMapper,​Type,​com.fasterxml.jackson.databind.ObjectWriter>> value
      A BiFunction that converts the global ObjectMapper and type for which a custom ObjectWriter is needed (this type will be a generic type if the method returns such a generic type) and returns the instance of the custom ObjectWriter.
    • Element Detail

      • value

        Class<? extends BiFunction<com.fasterxml.jackson.databind.ObjectMapper,​Type,​com.fasterxml.jackson.databind.ObjectWriter>> value
        A BiFunction that converts the global ObjectMapper and type for which a custom ObjectWriter is needed (this type will be a generic type if the method returns such a generic type) and returns the instance of the custom ObjectWriter. Quarkus will construct one instance of this BiFunction for each JAX-RS resource method that is annotated with CustomSerialization and once an instance is created it will be cached for subsequent usage by that resource method. The class MUST contain a no-args constructor and it is advisable that it contains no state that is updated outside its constructor. Furthermore, the ObjectMapper should NEVER be changed any way as it is the global ObjectMapper that is accessible to the entire Quarkus application.