angelcervera
angelcervera

Reputation: 4179

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

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?

Upvotes: 6

Views: 4347

Answers (1)

bdoughan
bdoughan

Reputation: 149027

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)

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.

Upvotes: 5

Related Questions