@scalar/api-client
Version:
the open source API testing client
16 lines (15 loc) • 443 B
JavaScript
import { getResolvedRef as n } from "@scalar/workspace-store/helpers/get-resolved-ref";
import { getExampleFromSchema as s } from "../../operation-code-sample/helpers/get-example-from-schema.js";
const u = (m, l, c) => {
const e = m.content?.[l], t = n(e?.examples?.[c]);
if (t)
return t;
const o = n(e?.schema);
if (!o)
return null;
const r = s(o);
return r ? { value: r } : null;
};
export {
u as getExampleFromBody
};