From c5dfaead5a10f4bb37c26b1412100be77dda231c Mon Sep 17 00:00:00 2001 From: binh-dam-ibigroup <56846598+binh-dam-ibigroup@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:24:48 -0500 Subject: [PATCH] fix(AbstractUser): Ignore unknown fields passed in OtpUser and other users payload. --- .../org/opentripplanner/middleware/models/AbstractUser.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/opentripplanner/middleware/models/AbstractUser.java b/src/main/java/org/opentripplanner/middleware/models/AbstractUser.java index 7164e3491..16ea0ab6f 100644 --- a/src/main/java/org/opentripplanner/middleware/models/AbstractUser.java +++ b/src/main/java/org/opentripplanner/middleware/models/AbstractUser.java @@ -1,6 +1,7 @@ package org.opentripplanner.middleware.models; import com.auth0.exception.Auth0Exception; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import org.opentripplanner.middleware.auth.Auth0Connection; import org.opentripplanner.middleware.auth.RequestingUser; import org.opentripplanner.middleware.auth.Permission; @@ -19,6 +20,7 @@ * It provides a place to centralize common fields that all users share (e.g., email) and common methods (such as the * authorization check {@link #canBeManagedBy}. */ +@JsonIgnoreProperties(ignoreUnknown = true) public abstract class AbstractUser extends Model { private static final Logger LOG = LoggerFactory.getLogger(AbstractUser.class); private static final long serialVersionUID = 1L;