Giter VIP home page Giter VIP logo

jackson-jakarta-rs-providers's Introduction

Overview

This is a multi-module project that contains Jackson-based Jakarta-RS (*) providers for following data formats:

Providers implement Jakarta-RS MessageBodyReader and MessageBodyWriter handlers for specific data formats. They also contain SPI settings for auto-registration.

Build Status Maven Central Javadoc

(*) NOTE: Jakarta-RS is the package under jakarta.ws.rs, replacing older JAX-RS which lived under javax.ws.rs. For JAX-RS variant, see repo jackson-jaxrs-providers

Build

Usual Maven build like other Jackson repos, with one difference: requires JDK 11 to build (as opposed to JDK 8 for most other repos), as of Jackson 2.13

Status

Module is fully functional and considered mature.

Maven dependency

To use Jakarta-RS on Maven-based projects, use dependencies like:

<dependency>
  <groupId>com.fasterxml.jackson.jakarta.rs</groupId>
  <artifactId>jackson-jakarta-rs-json-provider</artifactId>
  <version>2.14.1</version>
</dependency>

(above is for JSON provider; modify appropriately for other providers)

Usage: registering providers

Due to auto-registration, it should be possible to simply add Maven dependency (or include jar if using other build systems) and let Jakarta-RS implementation discover provider. If this does not work you need to consult documentation of the Jakarta-RS implementation for details.

To use Jackson with Jersey see their documentation.

Annotations on resources

In addition to annotation value classes, it is also possible to use a subset of Jackson annotations with provider.

Here is a short list of supported annotations that work with all formats:

  • @JsonView can be used to define active view for specific endpoint
  • @JsonRootName can be used to specify alternate rootname; most often used with XML, but possibly with JSON as well.
  • @JacksonAnnotationsInside meta-annotation may be used as a marker, to create "annotation bundles", similar to how they are used with value type annotations
  • com.fasterxml.jackson.jakarta.rs.annotation.JacksonFeatures can be used with all provid to enable/disable
    • SerializationFeature / DeserializationFeature for data-binding configuration
    • JsonParser.Feature / JsonGenerator.Feature for low(er) level Streaming read/write options

In addition there are format-specific annotations that may be used:

  • JSON has:
    • com.fasterxml.jackson.jakarta.rs.json.annotation.JSONP to define JSONP wrapping for serialized result

Support

Community support

Jackson components are supported by the Jackson community through mailing lists, Gitter forum, Github issues. See Participation, Contributing for full details.

Enterprise support

Support may be added via Tidelift Subscription model, if there is enough interest.


Other

For documentation, downloads links, check out Wiki

jackson-jakarta-rs-providers's People

Contributors

cowtowncoder avatar gedmarc avatar pjfanning avatar stevenschlansker avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.