module:"openapi-transformers/clear-html-response-schema.js"()
Transformer to remove response content for the text/html media type.
Autorest does not provide a good way to consume text/html:
- If the schema has type: string (with or without format: binary), the
generated method attempts to JSON-decode the HTML, which fails.
- If the schema has type: file, Autorest calls HttpContent.ReadAsStreamAsync
and returns the Stream, which complicates conversion to string, since the
caller can't call HttpContent.ReadAsStringAsync (which would cause
"InvalidOperationException: The stream was already consumed. It cannot be
read again.") and must reimplement charset detection to use on Stream.