Skip to content

feat(client):add many path register for spring mvc client.#6348

Open
wy471x wants to merge 12 commits into
apache:masterfrom
wy471x:feat_addMultiPathController#6327
Open

feat(client):add many path register for spring mvc client.#6348
wy471x wants to merge 12 commits into
apache:masterfrom
wy471x:feat_addMultiPathController#6327

Conversation

@wy471x

@wy471x wy471x commented May 22, 2026

Copy link
Copy Markdown
Contributor

Feat(#6327): Support many path register into same controller.

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

All changes:

  1. SpringMvcClientEventListener

Unit Tests:
1.testBuildApiDocSextetDefaultProducesConsumes
2.testBuildApiDocSextetExplicitProducesConsumesAndMethod
3.testBuildApiDocSextetMultipleMethodsProducesConsumes

close #6327

@wy471x

wy471x commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

Hi, @Aias00, when you have time, could you please help review this PR? Thank you.

@Aias00 Aias00 requested a review from Copilot May 24, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment on lines +47 to +48
}
}
Comment on lines +254 to +257
final String annotationPath = methodShenyuClient.path()[0];
boolean alreadyInSuperPath = Arrays.stream(methodShenyuClient.path())
.filter(StringUtils::isNotBlank)
.anyMatch(p -> superPath.endsWith(formatPath(p)));
Comment on lines 188 to +192
@Override
protected String buildApiSuperPath(final Class<?> clazz, @Nullable final ShenyuSpringMvcClient beanShenyuClient) {
final String servletPath = StringUtils.defaultString(this.env.getProperty("spring.mvc.servlet.path"), "");
final String servletContextPath = StringUtils.defaultString(this.env.getProperty("server.servlet.context-path"), "");
final String rootPath = String.format("/%s/%s/", servletContextPath, servletPath);
if (Objects.nonNull(beanShenyuClient) && StringUtils.isNotBlank(beanShenyuClient.path()[0])) {
return formatPath(String.format("%s/%s", rootPath, beanShenyuClient.path()[0]));
List<String> paths = buildApiSuperPaths(clazz, beanShenyuClient);
return paths.isEmpty() ? formatPath(buildRootPath()) : paths.get(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Question] 是否支持多前缀注册到同一个controller

3 participants