Sean-Walker0 opened a new pull request, #7491: URL: https://github.com/apache/shenyu/pull/7491
Fixes #7465 ## Modifications The SDK parameter processors read only `annotation.value()` for `@RequestParam`, `@RequestHeader`, `@PathVariable` and `@CookieValue`. Spring treats `value` and `name` as aliases on these annotations, so a valid client declaration such as `@RequestParam(name = "id")` resolved to an empty name and either failed the processor's non-empty check (`IllegalStateException`) or omitted the intended data. Each processor now falls back to `annotation.name()` when `value` is blank: ```java String name = StringUtils.defaultIfBlank(requestParam.value(), requestParam.name()); ``` ## Verifying this change - [x] New `processArgumentNameOnlyTest` in all four processor test classes — name-only declarations must resolve the parameter/header/cookie correctly. Red on the pre-fix code (`IllegalStateException` from the empty-value check in three processors; empty name in the fourth), green after. - [x] All pre-existing value-only and empty-value cases unchanged (the empty/empty case still throws `IllegalStateException` in `CookieValueParameterProcessor`). - [x] `./mvnw -pl shenyu-sdk/shenyu-sdk-spring -am test -B` — 39/39 module tests green (4 pre-existing JRE-conditional skips), checkstyle clean. ## Notes - Behavior change: `name`-only annotations now work exactly like `value`-only ones; `value` keeps precedence when both are set (consistent with Spring's alias semantics). - Orthogonality: no open PR modifies `shenyu-sdk-spring` (verified against the file lists of all 99 open PRs; #7445 touches only `shenyu-sdk-httpclient`). Make sure that: - [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide). - [x] You submit test cases (unit or integration tests) that back your changes. - [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true` (module-scoped: `shenyu-sdk/shenyu-sdk-spring` with `-am`, tests + checkstyle green). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
