Skip to content

Commit

Permalink
Revert "strict objectmapper to detect misspelled fields"
Browse files Browse the repository at this point in the history
This reverts commit 3094f8a32aa5ef8be8a816ef6fe42bc5ea8513c.

The backend needs to allow sending config to workers with new features it doesn't know about.
  • Loading branch information
abyrd committed Oct 3, 2024
1 parent e3094f8 commit ecc8002
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ecc8002

Please sign in to comment.