private OperationObject addCorsHeadersToResponses(
            Context<? extends Trait> context,
            OperationShape shape,
            OperationObject operationObject,
            String method,
            CorsTrait trait
    ) {
        OperationObject.Builder builder = operationObject.toBuilder();

        for (Map.Entry<String, ResponseObject> entry : operationObject.getResponses().entrySet()) {
            ResponseObject updated = createUpdatedResponseWithCorsHeaders(
                    context,
                    shape,
                    operationObject,
                    method,
                    trait,
                    entry.getValue());
            builder.putResponse(entry.getKey(), updated);
        }

        return builder.build();
    }
Adds CORS-specific headers to every response in the API.

<p>Values will be provided for the headers added to each operation by updating
the API Gateway integration of each operation to provide a static value for
each CORS header. This mapping is performed in {@link AddIntegrations}.

<p>This extension only takes effect if the service being converted to
OpenAPI has the CORS trait.
smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsResponseHeaders.java