Skip to content

Commit 951588a

Browse files
committed
Merge remote-tracking branch 'origin/4.2.x'
# Conflicts: # pom.xml
1 parent 6351b64 commit 951588a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SpringMvcContract.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2024 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -369,7 +369,10 @@ private void parseParams(MethodMetadata data, Method method, RequestMapping meth
369369
data.template().query(resolve(nameValueResolver.getName()), resolve(nameValueResolver.getValue()));
370370
}
371371
else {
372-
throw new IllegalArgumentException("Negated params are not supported: " + param);
372+
if (LOG.isDebugEnabled()) {
373+
LOG.debug("Negated params are not supported by Feign and ignored during parameter processing: "
374+
+ param);
375+
}
373376
}
374377
}
375378
}

spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/support/SpringMvcContractTests.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2024 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,6 +68,7 @@
6868
import static feign.CollectionFormat.CSV;
6969
import static feign.CollectionFormat.SSV;
7070
import static org.assertj.core.api.Assertions.assertThat;
71+
import static org.assertj.core.api.Assertions.assertThatCode;
7172
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
7273
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
7374
import static org.junit.jupiter.api.Assumptions.assumeTrue;
@@ -509,11 +510,11 @@ void testProcessAnnotations_ParseParams_MultipleParamsWithoutValue() throws Exce
509510
}
510511

511512
@Test
512-
void testProcessAnnotations_ParseParams_NotEqualParams() throws Exception {
513-
assertThatIllegalArgumentException().isThrownBy(() -> {
514-
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("notEqualParams");
513+
void testProcessAnnotations_ParseParams_NegatedParams() {
514+
assertThatCode(() -> {
515+
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("negatedParams");
515516
contract.parseAndValidateMetadata(method.getDeclaringClass(), method);
516-
});
517+
}).doesNotThrowAnyException();
517518
}
518519

519520
@Test
@@ -831,7 +832,7 @@ public interface TestTemplate_ParseParams {
831832
ResponseEntity<TestObject> mixParams();
832833

833834
@GetMapping(value = "test", params = { "p1!=1" })
834-
ResponseEntity<TestObject> notEqualParams();
835+
ResponseEntity<TestObject> negatedParams();
835836

836837
@GetMapping(value = "test", params = { "p1=1" })
837838
ResponseEntity<TestObject> paramsAndRequestParam(@RequestParam("p2") String p2);

0 commit comments

Comments
 (0)