class TransformApiDocService {

    public String transformApiDoc(String serviceId, ApiDocInfo apiDocInfo) {
        //maybe null check of apidocinfo
        AbstractApiDocService abstractApiDocService = beanApiDocFactory.apply(apiDocInfo.getApiDocContent());
        if (abstractApiDocService == null) {
            throw new UnexpectedTypeException("Response is not a Swagger or OpenAPI type object.");
        }

        return abstractApiDocService.transformApiDoc(serviceId, apiDocInfo);
    }

}