sttp-openapi-generator icon indicating copy to clipboard operation
sttp-openapi-generator copied to clipboard

Support text/plain content type

Open slivkamiro opened this issue 2 years ago • 1 comments

Hi, would it be possible to add support for text/plain content type?

I have endpoints such as this:

/readiness:
    get:
      operationId: getReadiness
      responses:
        '200':
          description: ''
          content:
            text/plain:
              schema:
                type: string
        '500':
          description: ''

but the generated client is trying to parse the response into json.

def getReadiness(): Request[Either[ResponseException[String, CirceError], Unit], Any] = basicRequest.get(uri"$baseUrl/readiness").response(fromMetadata(asJson[Unit]))

This is problematic if the returned string is empty which is not a valid json.

Thank you!

slivkamiro avatar Nov 10 '22 11:11 slivkamiro