function c(p,n){const t=["string","integer","boolean"];if(!n||!p[n])return[];const r=[],a=p[n];return Object.entries(a.properties).forEach(s=>{const o=s[1].type||s[1].$ref&&s[1].$ref.split("/").pop()||s[1].items&&s[1].items.$ref.split("/").pop()||"",e={paramsName:s[0],paramsType:o,desc:s[1].description||""};t.includes(o)||(e.children=c(p,o)),r.push(e)}),r}function f(p,n,t){const r={};return n.forEach(a=>{switch(a.paramsType){case"string":r[a.paramsName]="";break;case"integer":r[a.paramsName]=0;break;case"boolean":r[a.paramsName]=!0;break;case"array":r[a.paramsName]=[];break;case"object":r[a.paramsName]="";break;default:{const s=p[a.paramsType].properties,o=Object.entries(s).map(e=>({paramsName:e[0],paramsType:t?e[1].$ref&&e[1].$ref.split("/").pop()||e[1].items&&e[1].items.$ref.split("/").pop()||e[1].type||"":e[1].type}));r[a.paramsName]=f(p,o,t-1)}}}),r}export{c as f,f as g};
