Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
/ yasson-jaxrs Public archive

Binds the reference implementation of JSON-B to JAX-RS

License

Notifications You must be signed in to change notification settings

t1/yasson-jaxrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yasson JAX-RS

Yasson is the reference implementation of JSON-B, the new standardized API for binding Java to JSON, i.e. to serialize/deserialize Java objects to/from JSON.

This minimalistic library allows you to use the new annotations in your CDI based application, even before you have a Java EE 8 container, by providing a JAX-RS MessageBodyReader and MessageBodyWriter for application/json.

Simply add this to your pom.xml:

<dependencies>
    <dependency>
        <groupId>javax.json.bind</groupId>
        <artifactId>javax.json.bind-api</artifactId>
        <version>1.0.0-M2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.github.t1</groupId>
        <artifactId>yasson-jaxrs</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <scope>runtime</scope>
    </dependency>
</dependencies>

Note that the home page of JAX-RS used to be on java.net, but that site was shut down. Jerseys new home is https://jersey.github.io, but I didn't find the JAX-RS spec there, yet.

Configuration

You can configure JSON-B by CDI-producing an instance of JsonbConfig, e.g.:

@Produces JsonbConfig config = new JsonbConfig().withFormatting(true);

JsonbAdapters, JsonbSerializer, and JsonbDeserializers are automatically discovered (via CDI) and registered.

About

Binds the reference implementation of JSON-B to JAX-RS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages