Ward Clark
Ward Clark

Reputation: 163

jackson and jax-rs annotations

I am using Jackson to implement a simple REST API. Because it is the first time, I would like to be sure that I am following the correct practice.

Looking various examples, I found annotations implemented in the Jackson library such as @JsonProperty. I found also other annotations that are defined in jax-rs.

It is not clear to me when Jackson ends and jax-rs starts and viceversa. Is it ok to implement the API using both the annotations ? Is there an overlapping or are always used to define different characteristics of the API?

Upvotes: 1

Views: 6058

Answers (1)

cassiomolin
cassiomolin

Reputation: 131117

JAX-RS is a specification for creating REST web services in Java. JAX-RS requires an implementation such as Jersey, RESTEasy or Apache CXF.


Jackson is a popular JSON parser for Java and can be integrated with JAX-RS using the jackson-jaxrs-providers multi-module project.


While JAX-RS annotations allows you to map classes and methods to handle HTTP requests, Jackson annotations allows you to map Java classes to JSON objects and vice versa.

Upvotes: 6

Related Questions