Open
Description
I'd like to customize HalFormsConfiguration
in order to be able to produce HAL-Forms options for some template payload properties via a home made annotation based engine.
My goal is to have something like this:
record Payload(@HalFormsPropertyMetadata(optionsFactory = MyOptionsFactory.class) String foo) {
}
class MyOptionsFactory implements OptionsFactory {
@Override
Optional<HalFormsOptions> createOptions(AffordanceModel.PropertyMetadata property) {
return Optional.empty();
}
}
public interface OptionsFactory {
Optional<HalFormsOptions> createOptions(AffordanceModel.PropertyMetadata property);
}
To do that, I need to invoke
The property
argument should be the name of the property for which we try to provide options. But this value is computed like this:
Since this computation is private, I have no other way than copying the Spring HATEOAS name computation code in my project to make sure to match my annotated property with the name expected by Spring HATEOAS.