dmsolr opened a new pull request, #7813:
URL: https://github.com/apache/shenyu/pull/7813

   ## Why
   
   Both native Spring MVC and ShenYu annotation path arrays were collapsed to 
their first element during registration, so alias paths were never registered 
and stayed unreachable through the gateway even though the application serves 
them.
   
   The truncation happened in the two components that actually emit 
`MetaDataRegisterDTO`:
   
   - `SpringMvcApiMetaRegister.parse()` / `preParseList()` used 
`annotation.path()[0]` and produced one effective path per namespace.
   - `SpringMvcClientEventListener` only supported the first method-level path 
(`getPathByAnnotation` / `buildApiPath`).
   
   ## What
   
   - **`SpringMvcApiMetaRegister`**: resolve the *full* class-level and 
method-level path lists from the annotations retained on 
`ApiBean`/`ApiDefinition` (explicit `@ShenyuSpringMvcClient` override first, 
native `@RequestMapping` array as fallback), then register **every class × 
method × namespace combination**, deduplicating overlapping aliases. Wildcard 
(`/**`) beans now register every class-level alias instead of only the first.
   - **`SpringMvcClientEventListener`**: expand method-level aliases 
(previously "only the first path is supported temporarily") and publish each 
combination; class-level multi-path was already handled.
   - The extraction processors keep a single primary path on the model, but no 
alias information is lost: `ApiDefinition`/`ApiBean` retain the `Method`/bean 
`Class`, so the registrar reads the complete arrays directly from the 
annotations.
   
   Behavior for existing single-path mappings is unchanged; context-path 
joining, explicit ShenYu overrides and wildcard semantics are preserved.
   
   ## Tests
   
   - `SpringMvcApiMetaRegisterTest`: native multi-path and ShenYu multi-path 
cartesian product (4 combinations each), duplicate-alias deduplication, 
wildcard multi-path expansion.
   - `SpringMvcClientEventListenerTest`: method-level multi-path publishes 
every alias.
   - Full `shenyu-client-springmvc` module suite (39) and the springmvc starter 
suite pass; checkstyle clean.
   
   Fixes #7737
   


-- 
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]

Reply via email to