Skip to content

Commit

Permalink
Merge pull request #36 from crowdin/fix-deserializing
Browse files Browse the repository at this point in the history
Fix deserializing enums for Project model
  • Loading branch information
frombetelgeuse authored Jun 3, 2020
2 parents 7f400ce + 718f8f8 commit 4cbaf34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public class JacksonJsonTransformer implements JsonTransformer {

public JacksonJsonTransformer() {
ObjectMapper cleanObjectMapper = new ObjectMapper();
SimpleModule enumModule = new SimpleModule();
enumModule.addDeserializer(Enum.class, new EnumDeserializer());
ObjectMapper skipUnknownPropertiesObjectMapper = new ObjectMapper()
.registerModule(enumModule)
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
SimpleModule module = new SimpleModule();
module.addSerializer(Enum.class, new EnumSerializer());
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/api/projectsgroups/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"externalType": "proofread",
"workflowId": 3,
"hasCrowdsourcing": false,
"languageAccessPolicy": "open",
"createdAt": "2019-09-20T11:34:40+00:00",
"updatedAt": "2019-09-20T11:34:40+00:00"
}
Expand Down

0 comments on commit 4cbaf34

Please sign in to comment.