private void createResponseDocumentIfNeeded(
            String mediaType,
            Context<T> context,
            HttpBindingIndex bindingIndex,
            ResponseObject.Builder responseBuilder,
            Shape operationOrError,
            OperationShape operation
    ) {
        List<HttpBinding> bindings = bindingIndex.getResponseBindings(
                operationOrError,
                HttpBinding.Location.DOCUMENT);

        // If the operation doesn't have any document bindings, then do nothing.
        if (bindings.isEmpty()) {
            return;
        }

        // Document bindings needs to be synthesized into a new schema that contains
        // just the document bindings separate from other parameters.
        MessageType messageType = operationOrError instanceof OperationShape
                ? MessageType.RESPONSE
                : MessageType.ERROR;

        // This "synthesizes" a new schema that just contains the document bindings.
        // While we *could* just use the referenced output/error shape as-is, that
        // would be a bad idea; traits applied to shapes in Smithy can contextually
        // influence what the resulting JSON schema or OpenAPI. Consider the
        // following examples:
        //
        // 1. If the same shape is reused as input and output, then some members
        //    might be bound to query string parameters, and query string params
        //    aren't relevant on output. Trying to use the same schema derived
        //    from the reused input/output shape would result in a broken API.
        // 2. What if the input/output shape doesn't bind anything to the query
        //    string, headers, path, etc? Couldn't it then be used as-is with
        //    the name given in the Smithy model? Yes, technically it could, but
        //    that's also a bad idea. If/when you want to add a header or query
        //    string parameter, then you now need to break your generated OpenAPI
        //    schema, particularly if the shapes was reused throughout your model
        //    outside of top-level inputs, outputs, and errors.
        //
        // The safest thing to do here is to always synthesize a new schema that
        // just includes the document bindings.
        //
        // **NOTE: this same blurb applies to why we do this on input.**
        Schema schema = createDocumentSchema(context, operationOrError, bindings, messageType);
        String contextName = context.getService().getContextualName(operationOrError);
        String synthesizedName = stripNonAlphaNumericCharsIfNecessary(context, contextName)
                + "ResponseContent";
        String pointer = context.putSynthesizedSchema(synthesizedName, schema);
        MediaTypeObject mediaTypeObject = MediaTypeObject.builder()
                .schema(Schema.builder().ref(pointer).build())
                .examples(createBodyExamples(operationOrError, bindings, messageType, operation))
                .build();

        responseBuilder.putContent(mediaType, mediaTypeObject);
    }
Gets the media type of an event stream for the protocol.

<p>By default, this method returns the binary AWS event stream
media type, {@code application/vnd.amazon.eventstream}.

@param context Conversion context.
@param info Event stream info to provide the media type for.
@return Returns the media type of the event stream.
smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AbstractRestProtocol.java