From ecc8002021ce86927b19c6a0240a468680513af4 Mon Sep 17 00:00:00 2001 From: Andrew Byrd Date: Thu, 3 Oct 2024 12:16:08 -0400 Subject: [PATCH] Revert "strict objectmapper to detect misspelled fields" This reverts commit 3094f8a32aa5ef8be8a816ef6fe42bc5ea8513c. The backend needs to allow sending config to workers with new features it doesn't know about. --- .../com/conveyal/analysis/controllers/BundleController.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/com/conveyal/analysis/controllers/BundleController.java b/src/main/java/com/conveyal/analysis/controllers/BundleController.java index 4f26d0aed..dc3034583 100644 --- a/src/main/java/com/conveyal/analysis/controllers/BundleController.java +++ b/src/main/java/com/conveyal/analysis/controllers/BundleController.java @@ -21,7 +21,6 @@ import com.conveyal.r5.analyst.progress.ProgressInputStream; import com.conveyal.r5.analyst.cluster.TransportNetworkConfig; import com.conveyal.r5.analyst.progress.Task; -import com.conveyal.r5.common.JsonUtilities; import com.conveyal.r5.streets.OSMCache; import com.conveyal.r5.util.ExceptionUtils; import com.mongodb.QueryBuilder; @@ -137,9 +136,8 @@ private Bundle create (Request req, Response res) { if (files.get("config") != null) { // For validation, rather than reading as freeform JSON, deserialize into a model class instance. // However, only the instance fields specifying things other than OSM and GTFS IDs will be retained. - // Use strict object mapper (from the strict/lenient pair) to fail on misspelled field names. String configString = files.get("config").get(0).getString(); - bundle.config = JsonUtilities.objectMapper.readValue(configString, TransportNetworkConfig.class); + bundle.config = JsonUtil.objectMapper.readValue(configString, TransportNetworkConfig.class); } UserPermissions userPermissions = UserPermissions.from(req); bundle.accessGroup = userPermissions.accessGroup;