Create an in-between representation of the rule, so we can eventually convert it to OpenAPIPathItem with OpenAPIOperation(s)

def dumpRule(serviceCls, rule, prefix):
    """
    Create an in-between representation of the rule, so we can eventually convert it to OpenAPIPathItem with OpenAPIOperation(s)
    """
    rulePath = prefix + rule.rule
    rulePath = re.sub('/{2,}', '/', rulePath)

    cor = ConvertedRule(
            rulePath=rulePath,
            operationId=rule.endpoint
            )

    # look for methods
    for meth in sorted(rule.methods or []):
        cor.methods.append(meth)

    # edit _branch operationId to provide the true method name
    origEP = cor.operationId
    if origEP.endswith('_branch'):
        origEP = origEP[:-7]
        cor.branch = True
    cor.operationId = '%s.%s' % (serviceCls.__name__, origEP)
    # get the actual method so we can inspect it for extension attributes
    meth = getattr(serviceCls, origEP)

    if hasattr(meth, '_subKleinQname'):
        cor.subKlein = meth._subKleinQname

    cor.doco = OpenAPIExtendedDocumentation.fromObject(meth, decode=True)
    return cor