Inspectopedia Help

Mismatch in @PathVariable declarations and usages

Reports @PathVariable parameters that are declared in the method signature but are absent in the URL path or vice versa. The quick-fix adds the missing parameter.

Example:

@RequestMapping("/path/{myVariable}/") public String handler(@PathVariable String name_is_not_equal_to_myVariable) { return "..."; }
@RequestMapping("/path/{myVariable}/") public String handler(@PathVariable String myVariable) { return "..."; }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Spring Web, 241.14841

Last modified: 12 March 2024