function i({
  schema: { required: e, properties: t },
  level: r,
  prefix: n
}) {
  const a = t;
  return t ? Object.entries(a).flatMap(
    ([o, c], f) => l({
      schema: { ...c, name: o, optional: e && !e.includes(o) },
      level: r + 1,
      prefix: `${n}`
    })
  ) : [];
}
function u({
  schema: { name: e, items: t, required: r, allOf: n, properties: a },
  level: o,
  prefix: c
}) {
  return t ? l({
    schema: { ...t, name: e, optional: r && !r.includes(e) },
    level: o + 1,
    prefix: c
  }) : [];
}
function l({
  schema: e,
  level: t,
  prefix: r
}) {
  return e.type === "object" ? i({ schema: e, level: t, prefix: r }) : e.type === "array" ? u({ schema: e, level: t, prefix: r }) : `${r}.${e.name}`;
}
function p(e, t) {
  return l({ schema: e, level: 0, prefix: t }).toSorted((r, n) => r.localeCompare(n));
}
export {
  p as getJSONSchemaFieldsList
};
//# sourceMappingURL=json-field-list.js.map
