Skip to content

Commit 91fb01b

Browse files
committed
Add JsonIgnorePropreties annotation to fix deserialization (fix #85)
Use JsonIgnoreProperties on all models consumed by the RemoteResourceService implementation. The 1.3 series does not use spring-provided ObjectMapper, so setting the property in application.properties does not fix the underlying issue.
1 parent 6025800 commit 91fb01b

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/main/java/ubc/pavlab/rdp/model/User.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ubc.pavlab.rdp.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
45
import com.fasterxml.jackson.annotation.JsonUnwrapped;
56
import lombok.*;
67
import org.hibernate.annotations.CacheConcurrencyStrategy;
@@ -26,6 +27,7 @@
2627
@NoArgsConstructor
2728
@EqualsAndHashCode(of = {"id"})
2829
@ToString( of = {"id", "email", "enabled"})
30+
@JsonIgnoreProperties(ignoreUnknown = true)
2931
public class User{
3032

3133
@Id

src/main/java/ubc/pavlab/rdp/model/UserGene.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ubc.pavlab.rdp.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
45
import lombok.Getter;
56
import lombok.NoArgsConstructor;
67
import lombok.Setter;
@@ -25,6 +26,7 @@
2526
@Setter
2627
@NoArgsConstructor
2728
@ToString(callSuper = true)
29+
@JsonIgnoreProperties(ignoreUnknown = true)
2830
public class UserGene extends Gene {
2931

3032
@Id

src/main/java/ubc/pavlab/rdp/model/UserTerm.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ubc.pavlab.rdp.model;
22

33
import com.fasterxml.jackson.annotation.JsonIgnore;
4+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
45
import lombok.Getter;
56
import lombok.NoArgsConstructor;
67
import lombok.Setter;
@@ -23,6 +24,7 @@
2324
@Getter
2425
@Setter
2526
@NoArgsConstructor
27+
@JsonIgnoreProperties(ignoreUnknown = true)
2628
public class UserTerm extends GeneOntologyTerm {
2729

2830
@Id

0 commit comments

Comments
 (0)