class GatewayTopologyV4RequestValidator implements Validator<GatewayTopologyV4Request> {

    @Override
    public ValidationResult validate(GatewayTopologyV4Request subject) {
        ValidationResult topologyNameResult = ValidationResult.builder()
                .ifError(() -> StringUtils.isBlank(subject.getTopologyName()), "topologyName must be set in gateway topology.")
                .build();

        return Optional.ofNullable(subject.getExposedServices())
                .map(exposedServiceListValidator::validate)
                .map(vr -> vr.merge(topologyNameResult))
                .orElse(topologyNameResult);
    }

    public  GatewayTopologyV4RequestValidator(ExposedServiceListValidator exposedServiceListValidator);

}