private boolean isValidUrl(String endpointPattern) {
        String url = endpointPattern
                .replace("{", "")
                .replace("}", "");
        try {
            new URL(url).toURI();
            return true;
        } catch (MalformedURLException | URISyntaxException e) {
            return false;
        }
    }
Validate special case endpoints from endpoint traits that are applied on a service.
smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/AwsSpecialCaseEndpointValidator.java