From 6b50b7b72a69a4df66579c129679ee0146f5d042 Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Tue, 13 Jun 2023 10:27:18 +0100 Subject: [PATCH] Initialize propertyName in TypeMismatchException See gh-26219 --- .../method/annotation/AbstractNamedValueArgumentResolver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractNamedValueArgumentResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractNamedValueArgumentResolver.java index 254f9a4e489..d36496e8ff6 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractNamedValueArgumentResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractNamedValueArgumentResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -196,6 +196,7 @@ public abstract class AbstractNamedValueArgumentResolver extends HandlerMethodAr throw new ServerErrorException("Conversion not supported.", parameter, ex); } catch (TypeMismatchException ex) { + ex.initPropertyName(namedValueInfo.name); throw new ServerWebInputException("Type mismatch.", parameter, ex); } return value;