We recently began converting our controllers over to spring-data-rest repositories but in our system we must encode UUIDs in base-32.
We were able to solve this for the response content and the urls using the RepositoryRestConfigurer but the UUIDs still show in the standard format in the _links.
Current jackson mapper config:
@Override
public void configureConversionService(ConfigurableConversionService conversionService)
{
conversionService.addConverter(String.class, UUID.class, new StringUuidConverter());
}
@Override public void configureJacksonObjectMapper(ObjectMapper objectMapper)
{
SimpleModule module = new SimpleModule();
module.addSerializer(UUID.class, new UUIDSerialiser());
module.addDeserializer(UUID.class, new UUIDDeserialiser());
objectMapper.registerModule(module);
}
Is there a similar way to change the _links?
Edit: We have decided to enable support for dash separated uuids along with base32 in incoming requests. This is not a great solution however as it is confusing for clients that our _links are not base32 so we are still looking for a proper solution