guardrail icon indicating copy to clipboard operation
guardrail copied to clipboard

Cannot define a non-JSON-decoded requestBody

Open TJC opened this issue 6 years ago • 0 comments

Version tested: sbt-guardrail 0.52.1

Using the OpenAPI 3 specification, I cannot define a requestBody which is interpreted as a plain string, or binary octet-stream. (Using the akka-http generator)

Using an example from the OpenAPI 3 docs, I should be able to do:

requestBody:
    required: true
    content:
        "text/plain":

However that generates an exception.

I can do this and guardrail compiles:

requestBody:
    required: true
    content:
        "text/plain":
            schema:
                type: string
                format: string

But then in the generated Routes.scala, I still see json unmarshalling via Circe being attempted.

TJC avatar Aug 14 '19 07:08 TJC