static Optional<ExternalDocumentation> getResolvedExternalDocs(Shape shape, JsonSchemaConfig config) {
        Optional<ExternalDocumentationTrait> traitOptional = shape.getTrait(ExternalDocumentationTrait.class);

        if (!traitOptional.isPresent() || !(config instanceof OpenApiConfig)) {
            return Optional.empty();
        }

        OpenApiConfig openApiConfig = (OpenApiConfig) config;

        // Get the valid list of lower case names to look for when converting.
        List<String> externalDocKeys = new ArrayList<>(openApiConfig.getExternalDocs().size());
        for (String key : openApiConfig.getExternalDocs()) {
            externalDocKeys.add(key.toLowerCase(Locale.ENGLISH));
        }

        // Get lower case keys to check for when converting.
        Map<String, String> traitUrls = traitOptional.get().getUrls();
        Map<String, String> lowercaseKeyMap = traitUrls.keySet()
                .stream()
                .collect(MapUtils.toUnmodifiableMap(i -> i.toLowerCase(Locale.US), identity()));

        for (String externalDocKey : externalDocKeys) {
            // Compare the lower case name, but use the specified name.
            if (lowercaseKeyMap.containsKey(externalDocKey)) {
                String traitKey = lowercaseKeyMap.get(externalDocKey);
                // Return an ExternalDocumentation object assembled from the trait.
                return Optional.of(ExternalDocumentation.builder()
                        .description(traitKey)
                        .url(traitUrls.get(traitKey))
                        .build());
            }
        }

        // We didn't find any external docs with the a name in the specified set.
        return Optional.empty();
    }
Applies OpenAPI extensions to a {@link Schema} using configuration settings
found in {@link OpenApiConfig}.

<p>Note: the properties and features added by this mapper can be removed using
{@link OpenApiConfig#setDisableFeatures}.
smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiJsonSchemaMapper.java