Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore unexpected fields in JAX-RS 2.0 client?

Tags:

java

jaxb

jax-rs

I am developing a REST client that requests data from third party APIs. These APIs change and sometimes add new fields.

Using Jackson, it is possible to use the @JsonIgnoreProperties annotation, but I prefer to follow standards.

Is it possible do the same using JAX-RS 2.0?

like image 631
angelcervera Avatar asked Sep 21 '14 18:09

angelcervera


Video Answer


1 Answers

Using Jackson, it is possible to use @JsonIgnoreProperties annotation, but I prefer to follow standards.

Java EE 7 (JSR-342)

As of Java EE 7 there isn't a standard JSON-Binding API. However you can use JAX-RS with the Java API for JSON Processing (see: JSR-353)

  • https://blogs.oracle.com/arungupta/entry/consuming_and_producing_json_using

Java EE 8 (JSR-366)

A standard JSON-binding API will be developed as part of Java EE 8 (see: JSR-367). Java EE 8 will also include an updated JAX-RS specification (see: JSR-370) that will leverage JSR-367.

like image 183
bdoughan Avatar answered Oct 24 '22 01:10

bdoughan