UNPKG

@scalar/api-client

Version:

the open source API testing client

17 lines (16 loc) 533 B
import { getResolvedRef as a } from "@scalar/workspace-store/helpers/get-resolved-ref"; import { getExample as c } from "../../operation-block/helpers/get-example.js"; import { getExampleFromSchema as p } from "../../operation-code-sample/helpers/get-example-from-schema.js"; const u = (e, t, n) => { const l = e.content?.[t], m = c(e, n, t); if (m) return m; const o = a(l?.schema); if (!o) return null; const r = p(o, { mode: "write" }); return r ? { value: r } : null; }; export { u as getExampleFromBody };