Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 2.64 KB

README.md

File metadata and controls

74 lines (54 loc) · 2.64 KB

License

All Contributors

Quarkus - Jackson Jq

jq is a very popular JSON processor. Jackson JQ is an implementation of this processor in Java, and now you can integrate it in your Quarkus application!

Getting Started

Simply add the dependency to your Quarkus project:

<dependency>
  <groupId>io.quarkiverse.jackson-jq</groupId>
  <artifactId>quarkus-jackson-jq</artifactId>
</dependency>

Then you can simply use the jackson-jq's Scope bean in your services. For example:

@Path("/jackson-jq")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public class JacksonJqResource {

    @Inject
    Scope scope;

    @POST
    public List<JsonNode> parse(Document document) throws JsonQueryException {
        final JsonQuery query = JsonQuery.compile(document.expression, Versions.JQ_1_6);
        List<JsonNode> out = new ArrayList<>();
        query.apply(this.scope, document.document, out::add);
        return out;
    }
}

Considerations

Underneath, this extension uses jackson-jq, so the same limitations and capabilities of that library also applies here.

If you encounter any bugs or have any questions, please feel free to open an issue.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Ricardo Zanini

💻 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!