Fix code example for validation on functional endpoints
Fix code example for validation on functional endpoints

Closes gh-23020
spring-projects/spring-framework,spring-projects/spring-framework,spring-projects/spring-framework,spring-projects/spring-framework,spring-projects/spring-framework,spring-projects/spring-framework,spring-projects/spring-framework