Path Variable

We can define the path variable in springboot, for example:


@PostMapping(value = "/v{version}/meow", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Callable<ResponseEntity<MeowRequest>> greet(@PathVariable String version,
												   @RequestBody @Valid MeowRequest request) {
	return () -> ResponseEntity.ok(request);
}

Which then we can get the parameter version in the method.