def body.arg

ezmcp@0.1.0.0 · src/openapi.bend:1235

import ezmcp@0.1.0.0/src/openapi.bend as Openapi
import Base
import emerging-ezjson@1.2.0.0/src/value.bend as Value

1235# a request's body: the `requestBody` argument, when the operation has a
1236# body and the argument is there and not null, as JSON for
1237# application/json, else a string as itself and anything else as its JSON
1238def body.arg(none: Bool, +mt: String, +args: Value.Json) -> Maybe<&2, String>:
1239  match none:
1240    case True{}:
1241      None{}
1242    case False{}:
1243      body.of(mt, arg(args, "requestBody"))

Uses (6)

Used by (1)