def check

ezmcp@0.1.0.0 · src/openapi.bend:1492

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

1492# what is wrong with a call's arguments, when anything is: a required name
1493# they do not have (`missing`), else a property they have whose value does
1494# not fit its schema (`bad`); none when neither
1495def check(oper: Op, +args: Value.Json) -> Maybe<&2, String>:
1496  match oper:
1497    case Op{name, description, +input, method, path, params, media}:
1498      check.of(name, first(missing(Json.items(Json.get(input, "required")),
1499        args), bad(members(Json.get(input, "properties")), args)))

Uses (11)

Used by (1)