def media

ezmcp@0.1.0.0 · src/openapi.bend:893

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

893# a request body's media type: application/json when its content has a
894# schema for it, else the first media type of its content, else none ("")
895def media(+content: Value.Json) -> String:
896  media.at(schema.ok(Json.get(Json.get(content, "application/json"), "schema")),
897    content)

Uses (5)

Used by (1)