Adding a form of validation to component controller which extends BaseHstDynamicComponent

I am attempting to limit the number of characters for specific fields on a Carousel component but cannot seem to find an example where a form of validation is applied to limit input to specific fields. Any help on how to implement this would be greatly appreciated.

Sample of our current implementation for reference:

@ParametersInfo(
    type = DynamicComponentInfo.class
)
public class BaseClientComponent extends BaseHstDynamicComponent {

    @Override
    public void doBeforeRender(final HstRequest request, final HstResponse response) {     
        super.doBeforeRender(request, response);
    
        DynamicComponentInfo componentParametersInfo = (DynamicComponentInfo)this.getComponentParametersInfo(request);
        Iterator var3 = componentParametersInfo.getDynamicComponentParameters().iterator();

        while(var3.hasNext()) {
            DynamicParameter param = (DynamicParameter)var3.next();
            DynamicParameterConfig componentParameterConfig = param.getComponentParameterConfig();

            if (! (componentParameterConfig instanceof JcrPathParameterConfig)) {
                Object value = componentParametersInfo.getResidualParameterValues().get(param.getName());
                request.setAttribute(param.getName(), value);
            }
        }

        request.setAttribute("baseparams", componentParametersInfo);
        request.setAttribute("componentUUID", UUID.randomUUID());
    }
}

If I understand correctly you want validation on component parameters? AFAIK there is no way to add validation to this.

Yes, that is preciously what I was hoping to figure out. Currently, we warn the user that the value will be truncated in the FTL for that component but I was really hoping there was a way to enforce a field limit since that would provide a better user experience but I do appreciate your feedback :slightly_smiling_face: