-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
OpenAPI spec allows to define different types for different content types.
It would be nice to generate something like that for this case:
type SomeMethodBodyInput =
| SomeMethodBodyJson of SomeMethodJsonBodyInput
| SomeMethodBodyFormUrlEncoded of SomeMethodFormUrlEncodedBodyInput
//...
match ctx.Request.Headers.ContentType with
| "text/json" ->
let! json = ctx.bindJsonAsync<SomeMethodJsonBodyInput>()
json
//...
|> SomeMethodBodyJson
|> Ok
//...
| unsupported -> UnsupportedBodyContentType unsupported |> BodyBindingError |> Error
Metadata
Metadata
Assignees
Labels
No labels