# Conversions in spring

DevFeed: [Conversions in spring](<https://devfeed.tech/articles/conversions-in-spring-27286.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/201711/conversions-in-spring/>)

Published: 2017-11-10T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [implementation](<https://devfeed.tech/topics/implementation.md>), [test](<https://devfeed.tech/topics/test.md>), [Web](<https://devfeed.tech/topics/web.md>)

Tags: [controllers](<https://devfeed.tech/tags/controllers.md>), [conversion](<https://devfeed.tech/tags/conversion.md>), [converter](<https://devfeed.tech/tags/converter.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [interface](<https://devfeed.tech/tags/interface.md>), [stateless](<https://devfeed.tech/tags/stateless.md>), [tests](<https://devfeed.tech/tags/tests.md>)

## AI overview

A tutorial on converting raw string request parameters into custom classes in Spring REST controllers. It compares a Converter implementation, PropertyEditor with @InitBinder, and @ControllerAdvice, while explaining why a Converter may not be discovered by @WebMvcTest.

## Source excerpt

The story is really simple. I wanted to accept my class as rest controller method param. I decided that I don't want to convert a simple string to object every time and it would be faster if I do the conversion in the single place. After a quick research I've found Converter interface which looked like perfect for the job. After some digging and investigation it turns out that there is a lot of automagic in the Spring conversion service. Read more