I\'m building a MongoDb rest application with spring boot 1.1.5. I have created a repository:
@RepositoryRestResource(collectionResourceRel = \"SourceProduct
After many try, i've found this solution
@PostConstruct
public void init(){
GenericConversionService conversionService = (GenericConversionService) DefaultConversionService.getSharedInstance();
conversionService.addConverter(new JPAConverter());
}
Converter and GenericConvert are supported.
I fixed creating the bean in the following way:
@Configuration
public class MongoConvertersConfiguration {
@Resource(name = "defaultConversionService")
private GenericConversionService genericConversionService;
@Bean
public String2MongoUserConverter string2MongoUserConverter(){
String2MongoUserConverter string2MongoUserConverter = new String2MongoUserConverter();
genericConversionService.addConverter(string2MongoUserConverter);
return string2MongoUserConverter;
}
}