Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved extensibility: add an official JqFunction annotation #214

Open
lburgazzoli opened this issue Jul 19, 2022 · 0 comments
Open

Improved extensibility: add an official JqFunction annotation #214

lburgazzoli opened this issue Jul 19, 2022 · 0 comments

Comments

@lburgazzoli
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant