def paths

ezmcp@0.1.0.0 · src/openapi.bend:1030

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

1030# the operations of the Path Items `ps`, in order, each one's in the order
1031# of `methods`, after its parameters with their references followed
1032def paths(ps: List<&2, Mem()>, +doc: Value.Json) -> List<&2, Op>:
1033  match ps:
1034    case []:
1035      []
1036    case (+path, +it) <> rest:
1037      List.append(&2, Op, item(methods(), doc, path, it,
1038        Json.items(dereferenced(doc, Json.get(it, "parameters")))),
1039        paths(rest, doc))

Uses (11)

Used by (1)