Skip to content

Commit

Permalink
Add JsonIgnorePropreties annotation to fix deserialization (fix #85)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arteymix committed Jun 7, 2021
1 parent 6025800 commit 91fb01b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/ubc/pavlab/rdp/model/User.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ubc.pavlab.rdp.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import lombok.*;
import org.hibernate.annotations.CacheConcurrencyStrategy;
Expand All @@ -26,6 +27,7 @@
@NoArgsConstructor
@EqualsAndHashCode(of = {"id"})
@ToString( of = {"id", "email", "enabled"})
@JsonIgnoreProperties(ignoreUnknown = true)
public class User{

@Id
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ubc/pavlab/rdp/model/UserGene.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ubc.pavlab.rdp.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -25,6 +26,7 @@
@Setter
@NoArgsConstructor
@ToString(callSuper = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserGene extends Gene {

@Id
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ubc/pavlab/rdp/model/UserTerm.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ubc.pavlab.rdp.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -23,6 +24,7 @@
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserTerm extends GeneOntologyTerm {

@Id
Expand Down

0 comments on commit 91fb01b

Please sign in to comment.