UNPKG

@visulima/api-platform

Version:

Visulima API platform is a set of tools to build and consume web APIs

2 lines 900 B
import {c}from'../../chunk-LTU4LAD7.mjs';export{a as getSwaggerStaticProps}from'../../chunk-5DME62EW.mjs';import'../../chunk-HZWWJL43.mjs';import w from'fs';import {SwaggerCompilerPlugin}from'@visulima/jsdoc-open-api';import {join}from'@visulima/path';var l=(i={})=>c(i),d=l;var x=({definition:i,output:r="swagger/swagger.json",sources:g,verbose:f})=>o=>({...o,webpack:(e,t)=>{if(!t.isServer)return e;if(r.startsWith("/")&&(r=r.slice(1)),!r.endsWith(".json"))throw new Error("The output path must end with .json");return e={...e,plugins:[...e.plugins,new SwaggerCompilerPlugin(`${t.dir}/${r}`,g.map(m=>{let n=join(t.dir,m.replace("./",""));return w.lstatSync(n).isDirectory(),n}),{openapi:"3.0.0",...i},{verbose:f})]},typeof o.webpack=="function"?o.webpack(e,t):e}}),C=x;export{d as swaggerApiRoute,C as withOpenApi};//# sourceMappingURL=index-server.mjs.map //# sourceMappingURL=index-server.mjs.map