eiiches/jackson-jq

Improved extensibility: add an official JqFunction annotation

lburgazzoli opened this issue · 0 comments

The discovery of functions is now based on:

  • jq.json which is shipped as part of the jar
  • functions discovered with the service loader mechanism and annotated with the @BuiltinFunction annotation

In order to make it easy to add new function (as example, this is what I've done in the Apache Camel project, it would be nice to have an official annotation, as example:

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface JqFunction {
    String[] value();
    String version() default "";
}

This way, the process of discovering function would be:

  1. from the jq.json
  2. look-up @BuiltinFunction
  3. look-up @JqFunction

Where @JqFunction are custom provided functions