Skip to content

Commit 7728591

Browse files
committed
Assume value is quoted
1 parent 0fd8080 commit 7728591

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/main/java/org/primeframework/mvc/content/json/BaseJacksonContentHandler.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* @author Brian Pontarelli
5656
*/
5757
public abstract class BaseJacksonContentHandler implements ContentHandler {
58-
private static final Pattern invalidEnumerationValue = Pattern.compile("Cannot deserialize value of type `\\S+` from \\S+ (\\S+): not one of the values accepted for Enum class: \\[(.*)]$.*",
58+
private static final Pattern invalidEnumerationValue = Pattern.compile("Cannot deserialize value of type `\\S+` from \\S+ \"(\\S+)\": not one of the values accepted for Enum class: \\[(.*)]$.*",
5959
Pattern.DOTALL | Pattern.MULTILINE);
6060

6161
private static final Logger logger = LoggerFactory.getLogger(BaseJacksonContentHandler.class);
@@ -216,9 +216,6 @@ private void addFieldError(InvalidFormatException e) {
216216
// if we have an invalid enum value, provide a better message
217217
String possibleValues = matchesEnumNotValidValue.group(2);
218218
String valueUsed = matchesEnumNotValidValue.group(1);
219-
if (valueUsed.startsWith("\"") && valueUsed.endsWith("\"")) {
220-
valueUsed = valueUsed.substring(1, valueUsed.length() - 1);
221-
}
222219
message = messageProvider.getMessage(code,
223220
valueUsed,
224221
possibleValues);

0 commit comments

Comments
 (0)