How to ignore unexpected fields in a 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, you can use the @JsonIgnoreProperties annotation, but I prefer to follow the standards.

Is it possible to do this using JAX-RS 2.0?

+5
source share
1 answer

Using Jackson, you can use the @JsonIgnoreProperties annotation, but I prefer to follow the standards.

Java EE 7 ( JSR-342 )

Java EE 7 does not have a standard JSON-Binding API. However, you can use JAX-RS with the Java API to handle JSON (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 use JSR-367.

+4
source

Source: https://habr.com/ru/post/1203090/


All Articles