def plain

ezmcp@0.1.0.0 · src/openapi.bend:1105

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

1105# a value as the text of a parameter: a string as itself, a number as its
1106# text, a boolean as `true` or `false`, an array as its items' texts joined
1107# by `,` (style simple), anything else as its JSON
1108def plain(val: Value.Json) -> String:
1109  match val:
1110    case Value.JArr{+cs}:
1111      String.join(plain.items(Json.items(Value.JArr{cs})), ",")
1112    case other:
1113      plain.scalar(other)

Uses (6)

Used by (3)