Skip to content

Give warning when using capturing patterns with the AntPathMatcher #27688

@dsyer

Description

@dsyer

This fails:

@GetMapping("/resource/{*tail}")
public Object statics(@PathVariable String tail) {...}

with

Required URI template variable 'tail' for method parameter type String is not present

In fact what you need is

@GetMapping("/resource/{*tail}")
public Object statics(@PathVariable("*tail") String tail) {...}

This isn't really obvious from either the error message or the docs. Maybe we should support the first variant anyway?

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions