private boolean matchesPath(String[] path) {
            Iterator<String> iterator = stack.iterator();
            for (String segment : path) {
                if (!iterator.hasNext()) {
                    return false;
                }
                String current = iterator.next();
                if (!segment.equals(current) && !segment.equals("*")) {
                    return false;
                }
            }

            return true;
        }
This is a hardcoded list of paths that are known to contain ARNs or identifiers
commonly extracted out of CloudFormation. This list may need to be updated over
time as new features are added. Note that this list only expands to simple
Fn::Sub. Anything more complex needs to be handled through JSON substitutions
via {@link OpenApiConfig#setSubstitutions} as can anything that does not appear
in this list.
smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/CloudFormationSubstitution.java