Skip to content

Commit

Permalink
Merge pull request usdot-jpo-ode#37 from CDOT-CV/bug/tim-conversion
Browse files Browse the repository at this point in the history
Allow unknown properties when converting from JSON
  • Loading branch information
payneBrandon authored Mar 27, 2023
2 parents a40416b + 5b8ae69 commit c2f1ccb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public synchronized ResponseEntity<String> depositTim(String jsonString, Request
ServiceRequest request;
try {
// Convert JSON to POJO
odeTID = (OdeTravelerInputData) JsonUtils.fromJson(jsonString, OdeTravelerInputData.class);
odeTID = (OdeTravelerInputData) JsonUtils.jacksonFromJson(jsonString, OdeTravelerInputData.class, true);
if (odeTID == null) {
String errMsg = "Malformed or non-compliant JSON syntax.";
logger.error(errMsg);
Expand All @@ -142,6 +142,10 @@ public synchronized ResponseEntity<String> depositTim(String jsonString, Request
String errMsg = "Missing or invalid argument: " + e.getMessage();
logger.error(errMsg, e);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(JsonUtils.jsonKeyValue(ERRSTR, errMsg));
} catch (JsonUtilsException e) {
String errMsg = "Malformed or non-compliant JSON syntax.";
logger.error(errMsg, e);
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(JsonUtils.jsonKeyValue(ERRSTR, errMsg));
}

// Add metadata to message and publish to kafka
Expand Down

0 comments on commit c2f1ccb

Please sign in to comment.