My costum code in the initBinder method doesn't work in the RestController

I'm trying to remove whitespace using stringTrimmerEditor when a user enters a title in a text field, I used an initBinder to preprocess all the requests coming to my RestController, but the whitespace is not removed.

ProjectController

@RestController
@RequestMapping("/api")
public class ProjectController {

    @Autowired
    ProjetRepository projetRepository;

    @Autowired
    EnseignantRepository enseignantRepository;


    @InitBinder
    public  void initBinder(WebDataBinder webDataBinder){

        StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
        webDataBinder.registerCustomEditor(String.class,stringTrimmerEditor);

    }

@PostMapping("/{idEnseignant}/projects")
    public Projet addProject(@PathVariable int idEnseignant, @Valid @RequestBody Projet projet){

        projet.setId(0);

        projet.setEnseignant(enseignantRepository.findById(idEnseignant));
        projet.setDateProposition(new Date());
        projetRepository.save(projet);



        return projet;
    }

I tried to test my API using postman. I entered some whitespace and when I run my request the intitule attribute is stored with whitespace despite my preprocess method initBinder.

{
    "intitule" : "    eAlerte  ",
    "resume" : "test"
}