[{"data":1,"prerenderedAt":913,"buildId":914},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintegrations\u002Fopenapi-import":3},{"id":4,"title":5,"body":6,"description":894,"extension":895,"frontmatter":896,"heading":903,"meta":904,"navigation":906,"order":900,"path":907,"seo":908,"sitemap":909,"source":910,"stem":911,"__hash__":912},"docs\u002Fdocs\u002F5.x\u002Fintegrations\u002Fopenapi-import.md","openapi-import - Import OpenAPI specs in TypeScript",{"type":7,"value":8,"toc":884},"minimark",[9,25,71,83,87,99,365,375,379,389,407,507,538,542,567,633,636,828,845,849,867],[10,11,12,20,21,24],"p",{},[13,14,16],"a",{"href":15},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fopenapi-import",[17,18,19],"code",{},"openapi-import"," lets you import a spec like a TypeScript module and get the output of every plugin in your ",[17,22,23],{},"kubb.config.ts",", without generated files:",[26,27,31],"pre",{"language":28,"code":29,"class":30},"ts","import { type Pet, petStatusEnum } from '.\u002FpetStore.openapi.yaml'","highlights",[17,32,34],{"class":33},"language-ts",[35,36,39,43,47,50,54,57,61,64,67],"span",{"class":37,"style":38},"line","display: inline",[35,40,42],{"style":41},"color:#d73a49;--hls-dark:#f97583","import ",[35,44,46],{"style":45},"color:#005cc5;--hls-dark:#79b8ff","{ ",[35,48,49],{"style":41},"type ",[35,51,53],{"style":52},"color:#6f42c1;--hls-dark:#b392f0","Pet",[35,55,56],{"style":41},", ",[35,58,60],{"style":59},"color:#24292e;--hls-dark:#e1e4e8","petStatusEnum ",[35,62,63],{"style":45},"} ",[35,65,66],{"style":41},"from ",[35,68,70],{"style":69},"color:#032f62;--hls-dark:#9ecbff","'.\u002FpetStore.openapi.yaml'",[10,72,73,74,78,79,82],{},"It is a ",[13,75,77],{"href":76},"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Ftypescript-go\u002Fpull\u002F4712","TypeScript content mapper",". ",[17,80,81],{},"tsc"," and your editor type-check the plugin output in place of the spec. Go to definition, hover, and rename jump between the types and the spec keys. Your bundler supplies the values at run time:",[84,85],"mermaid",{"svg":86},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" class=\"pele pele-flowchart\" viewBox=\"0 0 648 152\" width=\"648\" height=\"152\" style=\"--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,monospace);font:16px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,sans-serif)\" fill=\"var(--_fg)\" role=\"graphics-document document\" aria-roledescription=\"flowchart\">\u003Cg class=\"pele-edges\" fill=\"none\" stroke=\"var(--_l)\" stroke-linecap=\"round\">\u003Cg class=\"pele-edge\" data-id=\"L_spec_mapper_0\">\u003Cpath d=\"M204.08,24L245.08,24\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M252.08,24L244.08,27.36L244.08,20.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_spec_plugin_0\">\u003Cpath d=\"M204.08,40C223.13,40 223.13,112 242.18,112L248.18,112\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M255.18,112L247.18,115.36L247.18,108.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_config_mapper_0\">\u003Cpath d=\"M204.08,112C221.58,112 221.58,40 239.08,40L245.08,40\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M252.08,40L244.08,43.36L244.08,36.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_config_plugin_0\">\u003Cpath d=\"M204.08,128L248.18,128\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M255.18,128L247.18,131.36L247.18,124.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_mapper_types_0\">\u003Cpath d=\"M394.78,32L435.78,32\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M442.78,32L434.78,35.36L434.78,28.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_plugin_values_0\">\u003Cpath d=\"M391.68,120L435.78,120\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M442.78,120L434.78,123.36L434.78,116.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-nodes\">\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"spec\" transform=\"translate(106.04,32)\">\u003Crect x=\"-98.04\" y=\"-24\" width=\"196.08\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">petStore.openapi.yaml\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"mapper\" transform=\"translate(323.43,32)\">\u003Crect x=\"-71.35\" y=\"-24\" width=\"142.7\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">openapi-import\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"plugin\" transform=\"translate(323.43,120)\">\u003Crect x=\"-68.25\" y=\"-24\" width=\"136.5\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">unplugin-kubb\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect core\" data-id=\"config\" transform=\"translate(136.72,120)\">\u003Crect x=\"-67.36\" y=\"-24\" width=\"134.72\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">kubb.config.ts\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"types\" transform=\"translate(541.26,32)\">\u003Crect x=\"-98.48\" y=\"-24\" width=\"196.96\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Types in tsc and editor\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"values\" transform=\"translate(525.26,120)\">\u003Crect x=\"-82.47\" y=\"-24\" width=\"164.94\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Values at run time\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>",[88,89,91,92,94,95,98],"blockquote",{"as":90},"warning","",[17,93,19],{}," is experimental. It needs TypeScript 7.1.0-beta or later with ",[17,96,97],{},"--runExternalCode",".",[100,101,103,108,152,156,167,321,325,352],"steps",{"level":102},"2",[104,105,107],"h2",{"id":106},"install-openapi-import","Install openapi-import",[109,110,112,134],"code-group",{"sync":111},"package-manager",[26,113,117],{"language":114,"filename":115,"code":116,"class":30},"shell","pnpm","pnpm add -D kubb openapi-import typescript@beta",[17,118,120],{"class":119},"language-shell",[35,121,122,125,128,131],{"class":37,"style":38},[35,123,124],{"style":52},"pnpm ",[35,126,127],{"style":59},"add -D kubb openapi-import typescript",[35,129,130],{"style":59},"@",[35,132,133],{"style":59},"beta",[26,135,138],{"language":114,"filename":136,"code":137,"class":30},"npm","npm install -D kubb openapi-import typescript@beta",[17,139,140],{"class":119},[35,141,142,145,148,150],{"class":37,"style":38},[35,143,144],{"style":52},"npm ",[35,146,147],{"style":59},"install -D kubb openapi-import typescript",[35,149,130],{"style":59},[35,151,133],{"style":59},[104,153,155],{"id":154},"register-the-extension","Register the content mapper",[10,157,158,159,162,163,166],{},"Add the mapper to ",[17,160,161],{},"tsconfig.json",", and name the spec ",[17,164,165],{},"\u003Cname>.openapi.yaml",":",[26,168,171],{"language":169,"filename":161,"code":170,"class":30},"json","{\n \"compilerOptions\": {\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Bundler\",\n \"strict\": true,\n \"noEmit\": true\n },\n \"contentMappers\": [{ \"package\": \"openapi-import\", \"extensions\": [\".openapi.yaml\", \".openapi.yml\"] }],\n \"include\": [\".\u002Fsrc\u002F**\u002F*\"]\n}",[17,172,174,179,180,179,193,179,209,179,223,179,237,179,248,179,257,179,300,179,317],{"class":173},"language-json",[35,175,176],{"class":37,"style":38},[35,177,178],{"style":45},"{","\n",[35,181,182,185,188,191],{"class":37,"style":38},[35,183,184],{"style":45}," ",[35,186,187],{"style":45},"\"compilerOptions\"",[35,189,190],{"style":41},": ",[35,192,178],{"style":45},[35,194,195,198,201,203,206],{"class":37,"style":38},[35,196,197],{"style":45}," ",[35,199,200],{"style":45},"\"module\"",[35,202,190],{"style":41},[35,204,205],{"style":69},"\"ESNext\"",[35,207,208],{"style":41},",",[35,210,211,213,216,218,221],{"class":37,"style":38},[35,212,197],{"style":41},[35,214,215],{"style":45},"\"moduleResolution\"",[35,217,190],{"style":41},[35,219,220],{"style":69},"\"Bundler\"",[35,222,208],{"style":41},[35,224,225,227,230,232,235],{"class":37,"style":38},[35,226,197],{"style":41},[35,228,229],{"style":45},"\"strict\"",[35,231,190],{"style":41},[35,233,234],{"style":45},"true",[35,236,208],{"style":41},[35,238,239,241,244,246],{"class":37,"style":38},[35,240,197],{"style":41},[35,242,243],{"style":45},"\"noEmit\"",[35,245,190],{"style":41},[35,247,234],{"style":45},[35,249,250,252,255],{"class":37,"style":38},[35,251,184],{"style":45},[35,253,254],{"style":45},"}",[35,256,208],{"style":41},[35,258,259,261,264,266,269,272,274,277,279,282,284,287,290,292,295,298],{"class":37,"style":38},[35,260,184],{"style":41},[35,262,263],{"style":45},"\"contentMappers\"",[35,265,190],{"style":41},[35,267,268],{"style":45},"[{ ",[35,270,271],{"style":45},"\"package\"",[35,273,190],{"style":41},[35,275,276],{"style":69},"\"openapi-import\"",[35,278,56],{"style":41},[35,280,281],{"style":45},"\"extensions\"",[35,283,190],{"style":41},[35,285,286],{"style":45},"[",[35,288,289],{"style":69},"\".openapi.yaml\"",[35,291,56],{"style":41},[35,293,294],{"style":69},"\".openapi.yml\"",[35,296,297],{"style":45},"] }]",[35,299,208],{"style":41},[35,301,302,304,307,309,311,314],{"class":37,"style":38},[35,303,184],{"style":41},[35,305,306],{"style":45},"\"include\"",[35,308,190],{"style":41},[35,310,286],{"style":45},[35,312,313],{"style":69},"\".\u002Fsrc\u002F**\u002F*\"",[35,315,316],{"style":45},"]",[35,318,319],{"class":37,"style":38},[35,320,254],{"style":45},[104,322,324],{"id":323},"run-the-type-check","Run the type check",[109,326,327,339],{"sync":111},[26,328,330],{"language":114,"filename":115,"code":329,"class":30},"pnpm tsc --noEmit --runExternalCode",[17,331,332],{"class":119},[35,333,334,336],{"class":37,"style":38},[35,335,124],{"style":52},[35,337,338],{"style":59},"tsc --noEmit --runExternalCode",[26,340,342],{"language":114,"filename":136,"code":341,"class":30},"node node_modules\u002Ftypescript\u002Fbin\u002Ftsc --noEmit --runExternalCode",[17,343,344],{"class":119},[35,345,346,349],{"class":37,"style":38},[35,347,348],{"style":52},"node ",[35,350,351],{"style":59},"node_modules\u002Ftypescript\u002Fbin\u002Ftsc --noEmit --runExternalCode",[10,353,354,355,357,358,361,362,364],{},"With npm, a bare ",[17,356,81],{}," runs TypeScript 6, so call the binary from ",[17,359,360],{},"typescript",". VS Code passes ",[17,363,97],{}," only in trusted workspaces.",[10,366,367,368,374],{},"The ",[13,369,371,373],{"href":370},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fopenapi-import#what-you-can-import",[17,372,19],{}," README"," lists which type each schema and operation becomes.",[104,376,378],{"id":377},"choose-the-plugins","Choose the plugins",[10,380,381,382,384,385,388],{},"Without a ",[17,383,23],{},", only ",[17,386,387],{},"@kubb\u002Fplugin-ts"," runs. To set plugin options or run other plugins, add a config and install each plugin it imports:",[26,390,393],{"language":114,"filename":391,"code":392,"class":30},"Terminal","pnpm add -D @kubb\u002Fplugin-ts",[17,394,395],{"class":119},[35,396,397,399,402,404],{"class":37,"style":38},[35,398,124],{"style":52},[35,400,401],{"style":59},"add -D ",[35,403,130],{"style":59},[35,405,406],{"style":59},"kubb\u002Fplugin-ts",[26,408,410],{"language":28,"filename":23,"code":409,"class":30},"import { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { defineConfig } from 'kubb\u002Fconfig'\n\nexport default defineConfig({\n output: { path: '.\u002Fsrc\u002Fgen' },\n plugins: [pluginTs()],\n})",[17,411,412,179,428,179,444,179,446,179,460,179,483,179,502],{"class":33},[35,413,414,416,418,421,423,425],{"class":37,"style":38},[35,415,42],{"style":41},[35,417,46],{"style":45},[35,419,420],{"style":59},"pluginTs ",[35,422,63],{"style":45},[35,424,66],{"style":41},[35,426,427],{"style":69},"'@kubb\u002Fplugin-ts'",[35,429,430,432,434,437,439,441],{"class":37,"style":38},[35,431,42],{"style":41},[35,433,46],{"style":45},[35,435,436],{"style":59},"defineConfig ",[35,438,63],{"style":45},[35,440,66],{"style":41},[35,442,443],{"style":69},"'kubb\u002Fconfig'",[35,445],{"class":37,"style":38},[35,447,448,451,454,457],{"class":37,"style":38},[35,449,450],{"style":41},"export ",[35,452,453],{"style":41},"default ",[35,455,456],{"style":52},"defineConfig",[35,458,459],{"style":45},"({",[35,461,462,464,467,469,471,474,476,479,481],{"class":37,"style":38},[35,463,184],{"style":45},[35,465,466],{"style":45},"output",[35,468,190],{"style":41},[35,470,46],{"style":45},[35,472,473],{"style":45},"path",[35,475,190],{"style":41},[35,477,478],{"style":69},"'.\u002Fsrc\u002Fgen' ",[35,480,254],{"style":45},[35,482,208],{"style":41},[35,484,485,487,490,492,494,497,500],{"class":37,"style":38},[35,486,184],{"style":41},[35,488,489],{"style":45},"plugins",[35,491,190],{"style":41},[35,493,286],{"style":45},[35,495,496],{"style":52},"pluginTs",[35,498,499],{"style":45},"()]",[35,501,208],{"style":41},[35,503,504],{"class":37,"style":38},[35,505,506],{"style":45},"})",[508,509,510,529],"ul",{},[511,512,513,514,516,517,520,521,524,525,528],"li",{},"Put the config next to ",[17,515,161],{}," or in a parent folder, and add its relative path to ",[17,518,519],{},"include",", such as ",[17,522,523],{},".\u002Fkubb.config.ts"," or ",[17,526,527],{},"..\u002Fkubb.config.ts",". The mapper reloads the config when it changes.",[511,530,531,532,535,536,98],{},"With several configs, a spec uses the one whose ",[17,533,534],{},"input"," is that spec, or else the first config without an ",[17,537,534],{},[104,539,541],{"id":540},"load-the-spec-at-run-time","Load the spec at run time",[10,543,544,545,548,549,552,553,557,558,561,562,564,565,166],{},"TypeScript does not emit the spec as JavaScript, so values such as ",[17,546,547],{},"petStatusEnum"," need a bundler. Add ",[17,550,551],{},"kubb()"," from any ",[13,554,556],{"href":555},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools","build tool"," without a ",[17,559,560],{},"config"," option, so it reads the same ",[17,563,23],{}," as ",[17,566,81],{},[26,568,571],{"language":28,"filename":569,"code":570,"class":30},"vite.config.ts","import kubb from 'kubb\u002Fvite'\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n plugins: [kubb()],\n})",[17,572,573,179,585,179,600,179,602,179,612,179,629],{"class":33},[35,574,575,577,580,582],{"class":37,"style":38},[35,576,42],{"style":41},[35,578,579],{"style":59},"kubb ",[35,581,66],{"style":41},[35,583,584],{"style":69},"'kubb\u002Fvite'",[35,586,587,589,591,593,595,597],{"class":37,"style":38},[35,588,42],{"style":41},[35,590,46],{"style":45},[35,592,436],{"style":59},[35,594,63],{"style":45},[35,596,66],{"style":41},[35,598,599],{"style":69},"'vite'",[35,601],{"class":37,"style":38},[35,603,604,606,608,610],{"class":37,"style":38},[35,605,450],{"style":41},[35,607,453],{"style":41},[35,609,456],{"style":52},[35,611,459],{"style":45},[35,613,614,616,618,620,622,625,627],{"class":37,"style":38},[35,615,184],{"style":45},[35,617,489],{"style":45},[35,619,190],{"style":41},[35,621,286],{"style":45},[35,623,624],{"style":52},"kubb",[35,626,499],{"style":45},[35,628,208],{"style":41},[35,630,631],{"class":37,"style":38},[35,632,506],{"style":45},[10,634,635],{},"The types and the values then come from the same import:",[26,637,640],{"language":28,"filename":638,"code":639,"class":30},"src\u002Fpets.ts","import { type GetPetByIdPath, type GetPetByIdResponse, petStatusEnum } from '..\u002FpetStore.openapi.yaml'\n\nexport async function getAvailablePet({ petId }: GetPetByIdPath): Promise\u003CGetPetByIdResponse | undefined> {\n const response = await fetch(`https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3\u002Fpet\u002F${petId}`)\n const pet: GetPetByIdResponse = await response.json()\n\n return pet.status === petStatusEnum.available ? pet : undefined\n}",[17,641,642,179,671,179,673,179,723,179,761,179,788,179,790,179,824],{"class":33},[35,643,644,646,648,650,653,655,657,660,662,664,666,668],{"class":37,"style":38},[35,645,42],{"style":41},[35,647,46],{"style":45},[35,649,49],{"style":41},[35,651,652],{"style":52},"GetPetByIdPath",[35,654,56],{"style":41},[35,656,49],{"style":41},[35,658,659],{"style":52},"GetPetByIdResponse",[35,661,56],{"style":41},[35,663,60],{"style":59},[35,665,63],{"style":45},[35,667,66],{"style":41},[35,669,670],{"style":69},"'..\u002FpetStore.openapi.yaml'",[35,672],{"class":37,"style":38},[35,674,675,677,680,683,686,689,692,694,696,698,701,703,706,709,712,715,718,721],{"class":37,"style":38},[35,676,450],{"style":41},[35,678,679],{"style":41},"async ",[35,681,682],{"style":41},"function ",[35,684,685],{"style":52},"getAvailablePet",[35,687,688],{"style":45},"({ ",[35,690,691],{"style":59},"petId ",[35,693,254],{"style":45},[35,695,190],{"style":59},[35,697,652],{"style":52},[35,699,700],{"style":45},")",[35,702,190],{"style":59},[35,704,705],{"style":52},"Promise",[35,707,708],{"style":41},"\u003C",[35,710,711],{"style":52},"GetPetByIdResponse ",[35,713,714],{"style":41},"| ",[35,716,717],{"style":45},"undefined",[35,719,720],{"style":41},"> ",[35,722,178],{"style":45},[35,724,725,727,730,733,736,739,742,745,748,751,754,756,759],{"class":37,"style":38},[35,726,184],{"style":45},[35,728,729],{"style":41},"const ",[35,731,732],{"style":59},"response ",[35,734,735],{"style":41},"= ",[35,737,738],{"style":41},"await ",[35,740,741],{"style":52},"fetch",[35,743,744],{"style":45},"(",[35,746,747],{"style":69},"`https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3\u002Fpet\u002F",[35,749,750],{"style":59},"${",[35,752,753],{"style":59},"petId",[35,755,254],{"style":59},[35,757,758],{"style":69},"`",[35,760,700],{"style":45},[35,762,763,765,767,770,772,774,776,778,781,783,785],{"class":37,"style":38},[35,764,184],{"style":45},[35,766,729],{"style":41},[35,768,769],{"style":59},"pet",[35,771,190],{"style":59},[35,773,711],{"style":52},[35,775,735],{"style":41},[35,777,738],{"style":41},[35,779,780],{"style":59},"response",[35,782,98],{"style":41},[35,784,169],{"style":52},[35,786,787],{"style":45},"()",[35,789],{"class":37,"style":38},[35,791,792,794,797,799,801,804,807,809,811,814,817,820,822],{"class":37,"style":38},[35,793,184],{"style":45},[35,795,796],{"style":41},"return ",[35,798,769],{"style":59},[35,800,98],{"style":41},[35,802,803],{"style":45},"status ",[35,805,806],{"style":41},"=== ",[35,808,547],{"style":59},[35,810,98],{"style":41},[35,812,813],{"style":45},"available ",[35,815,816],{"style":41},"? ",[35,818,819],{"style":59},"pet ",[35,821,190],{"style":41},[35,823,717],{"style":45},[35,825,826],{"class":37,"style":38},[35,827,254],{"style":45},[508,829,830,839],{},[511,831,832,833,835,836,838],{},"A config with an ",[17,834,534],{}," also writes the generated files at build time. Leave ",[17,837,534],{}," out to import specs only.",[511,840,841,842,844],{},"The bundler reads ",[17,843,23],{}," once, so restart it after you change the config.",[104,846,848],{"id":847},"limits","Limits",[508,850,851,858,864],{},[511,852,853,854,857],{},"Code a plugin writes to a separate file, such as a bundled client runtime, is not included. Point imports like the client's ",[17,855,856],{},"importPath"," at a package.",[511,859,860,861,863],{},"Files that ",[17,862,23],{}," imports are not watched. Restart the TypeScript server after you change them.",[511,865,866],{},"A changed spec runs a full Kubb build: about 0.4 s for a 10 KB spec and 2.6 s for a 1.4 MB spec.",[10,868,367,869,873,874,877,878,98],{},[13,870,872],{"href":871},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fopenapi-import#limits","README"," lists the editor and ",[17,875,876],{},"$ref"," limits. For a working setup, see ",[13,879,881],{"href":880},"https:\u002F\u002Fgithub.com\u002Fkubb-labs\u002Fopenapi-import\u002Ftree\u002Fmain\u002Fexamples\u002Fpet-store",[17,882,883],{},"examples\u002Fpet-store",{"title":91,"searchDepth":885,"depth":885,"links":886},5,[887,889,890,891,892,893],{"id":106,"depth":888,"text":107},2,{"id":154,"depth":888,"text":155},{"id":323,"depth":888,"text":324},{"id":377,"depth":888,"text":378},{"id":540,"depth":888,"text":541},{"id":847,"depth":888,"text":848},"Import a .openapi.yaml spec in TypeScript with openapi-import and get the types and enums your kubb.config.ts plugins generate, without generated files.","md",{"layout":897,"title":5,"description":894,"outline":898,"order":900,"navigation":901},"doc",[888,899],3,15,{"title":19,"icon":902},"i-simple-icons-typescript","Import an OpenAPI spec in TypeScript with openapi-import",{"layout":897,"outline":905},[888,899],{"title":19,"icon":902},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fopenapi-import",{"title":5,"description":894},{"loc":907},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintegrations\u002Fopenapi-import.md","docs\u002F5.x\u002Fintegrations\u002Fopenapi-import","sJUsltOnNaRQp-T-3y5xaB2XGlCQY8-7kVULRWdVaA4",1795727673703,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]