Created
June 16, 2019 16:18
-
-
Save sirech/9160dea80b1a555446e27b51f70e9660 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
class ConverterConfiguration : WebMvcConfigurer { | |
override fun addFormatters(registry: FormatterRegistry) { | |
registry.addConverter(userId()) | |
} | |
private fun userId(): Converter<String, UserId> { | |
return Converter<String, UserId> { source -> UserId.create(source) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment