[{"data":1,"prerenderedAt":2113,"buildId":2114},["ShallowReactive",2],{"page:\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Foptions":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":2112,"source":4},"extensions\u002Fkubb-labs\u002Fplugin-axios\u002Foptions.md",{},"Options",{"type":8,"value":9,"toc":2095},"minimark",[10,25,30,357,361,365,372,403,410,445,458,461,475,503,506,531,556,573,1012,1039,1051,1054,1070,1107,1201,1203,1231,1268,1309,1498,1509,1511,1517,1546,1577,1583,1640,1643,1650,1687,1703,1758,1767,1769,1772,1801,1843,1849,1971,1981,1983,1997,2026],[11,12,13,14,18,19,24],"p",{},"Pass these options to ",[15,16,17],"code",{},"pluginAxios()",". Shared options link to ",[20,21,23],"a",{"href":22},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options","Shared plugin options",".",[26,27,29],"h2",{"id":28},"options-overview","Options overview",[31,32,33,49],"table",{},[34,35,36],"thead",{},[37,38,39,43,46],"tr",{},[40,41,42],"th",{},"Option",[40,44,45],{},"Purpose",[40,47,48],{},"Default",[50,51,52,71,87,102,120,138,156,173,193,211,226,243,265,280,298,317,339],"tbody",{},[37,53,54,63,66],{},[55,56,57],"td",{},[20,58,60],{"href":59},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#output",[15,61,62],{},"output",[55,64,65],{},"Where files are written.",[55,67,68],{},[15,69,70],{},"{ path: 'clients', barrel: { type: 'named' } }",[37,72,73,81,84],{},[55,74,75],{},[20,76,78],{"href":77},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#group",[15,79,80],{},"group",[55,82,83],{},"Split output by tag or path.",[55,85,86],{},"None",[37,88,89,97,100],{},[55,90,91],{},[20,92,94],{"href":93},"#baseurl",[15,95,96],{},"baseURL",[55,98,99],{},"Base URL the client starts with.",[55,101,86],{},[37,103,104,112,115],{},[55,105,106],{},[20,107,109],{"href":108},"#importpath",[15,110,111],{},"importPath",[55,113,114],{},"Module the operations import the client from.",[55,116,117],{},[15,118,119],{},".kubb\u002Fclient.ts",[37,121,122,130,133],{},[55,123,124],{},[20,125,127],{"href":126},"#throwonerrordefault",[15,128,129],{},"throwOnErrorDefault",[55,131,132],{},"Throw on a non-2xx response unless a call says otherwise.",[55,134,135],{},[15,136,137],{},"true",[37,139,140,148,151],{},[55,141,142],{},[20,143,145],{"href":144},"#validator",[15,146,147],{},"validator",[55,149,150],{},"Validate requests and responses with Zod or Valibot.",[55,152,153],{},[15,154,155],{},"false",[37,157,158,166,171],{},[55,159,160],{},[20,161,163],{"href":162},"#auth",[15,164,165],{},"auth",[55,167,168,169,24],{},"How generated functions take ",[15,170,165],{},[55,172,86],{},[37,174,175,182,188],{},[55,176,177],{},[20,178,179],{"href":162},[15,180,181],{},"auth.mode",[55,183,184,185,187],{},"Optional ",[15,186,165],{},", or required when a token is needed.",[55,189,190],{},[15,191,192],{},"'optional'",[37,194,195,203,206],{},[55,196,197],{},[20,198,200],{"href":199},"#returntype",[15,201,202],{},"returnType",[55,204,205],{},"What a call resolves to.",[55,207,208],{},[15,209,210],{},"'full'",[37,212,213,221,224],{},[55,214,215],{},[20,216,218],{"href":217},"#sdk",[15,219,220],{},"sdk",[55,222,223],{},"Generate classes instead of standalone functions.",[55,225,86],{},[37,227,228,235,238],{},[55,229,230],{},[20,231,232],{"href":217},[15,233,234],{},"sdk.mode",[55,236,237],{},"One class per tag, or one class with every operation.",[55,239,240],{},[15,241,242],{},"'tag'",[37,244,245,252,255],{},[55,246,247],{},[20,248,249],{"href":217},[15,250,251],{},"sdk.name",[55,253,254],{},"Name and file of the root or flat class.",[55,256,257,258,261,262],{},"None, or ",[15,259,260],{},"'sdk'"," with ",[15,263,264],{},"mode: 'flat'",[37,266,267,275,278],{},[55,268,269],{},[20,270,272],{"href":271},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#include",[15,273,274],{},"include",[55,276,277],{},"Keep only operations that match.",[55,279,86],{},[37,281,282,290,293],{},[55,283,284],{},[20,285,287],{"href":286},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#exclude",[15,288,289],{},"exclude",[55,291,292],{},"Skip operations that match.",[55,294,295],{},[15,296,297],{},"[]",[37,299,300,308,313],{},[55,301,302],{},[20,303,305],{"href":304},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#override",[15,306,307],{},"override",[55,309,310,311,24],{},"Options per pattern, except ",[15,312,129],{},[55,314,315],{},[15,316,297],{},[37,318,319,327,334],{},[55,320,321],{},[20,322,324],{"href":323},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#resolver",[15,325,326],{},"resolver",[55,328,329,330,24],{},"Generated names and paths, plus the ",[20,331,333],{"href":332},"#resolver","SDK names",[55,335,336],{},[15,337,338],{},"resolverClient",[37,340,341,349,352],{},[55,342,343],{},[20,344,346],{"href":345},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#macros",[15,347,348],{},"macros",[55,350,351],{},"Rewrite AST nodes before printing.",[55,353,354,356],{},[15,355,297],{},", run after the built-in client macros",[26,358,360],{"id":359},"option-details","Option details",[362,363,96],"h3",{"id":364},"baseurl",[11,366,367,368,371],{},"The base URL the client starts with. ",[15,369,370],{},"client.setConfig({ baseURL })"," replaces it at runtime.",[31,373,374,382],{},[34,375,376],{},[37,377,378,380],{},[40,379],{},[40,381],{},[50,383,384,394],{},[37,385,386,389],{},[55,387,388],{},"Type",[55,390,391],{},[15,392,393],{},"string",[37,395,396,399],{},[55,397,398],{},"Required",[55,400,401],{},[15,402,155],{},[11,404,405,406,409],{},"A ",[15,407,408],{},"${...}"," interpolation becomes a template literal, so it reads the environment at runtime:",[411,412,416],"pre",{"language":413,"code":414,"class":415},"typescript","pluginAxios({ baseURL: '${process.env.API_URL}' })","highlights",[15,417,419],{"class":418},"language-typescript",[420,421,424,428,432,434,438,442],"span",{"class":422,"style":423},"line","display: inline",[420,425,427],{"style":426},"color:#6f42c1;--hls-dark:#b392f0","pluginAxios",[420,429,431],{"style":430},"color:#005cc5;--hls-dark:#79b8ff","({ ",[420,433,96],{"style":430},[420,435,437],{"style":436},"color:#d73a49;--hls-dark:#f97583",": ",[420,439,441],{"style":440},"color:#032f62;--hls-dark:#9ecbff","'${process.env.API_URL}' ",[420,443,444],{"style":430},"})",[446,447,449,450,453,454,24],"blockquote",{"as":448},"note","The spec's top-level ",[15,451,452],{},"servers"," URL is never used. See ",[20,455,457],{"href":456},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Fguides\u002Fconfigure-requests#set-the-base-url","Set the base URL",[362,459,111],{"id":460},"importpath",[11,462,463,464,467,468,471,472,24],{},"Module the generated operations import the client from, written exactly as given. Kubb still writes the full ",[15,465,466],{},".kubb\u002F"," runtime, including the ",[15,469,470],{},"config.ts"," your spec needs. Your module re-exports it and replaces only what you need, such as a pre-configured ",[15,473,474],{},"client",[31,476,477,485],{},[34,478,479],{},[37,480,481,483],{},[40,482],{},[40,484],{},[50,486,487,495],{},[37,488,489,491],{},[55,490,388],{},[55,492,493],{},[15,494,393],{},[37,496,497,499],{},[55,498,398],{},[55,500,501],{},[15,502,155],{},[11,504,505],{},"The specifier must resolve from each generated file, so use a relative path, a package name, or an alias:",[411,507,509],{"language":413,"code":508,"class":415},"pluginAxios({ importPath: '..\u002F..\u002Fclient' }) \u002F\u002F from src\u002Fgen\u002Fclients\u002F to src\u002Fclient.ts",[15,510,511],{"class":418},[420,512,513,515,517,519,521,524,527],{"class":422,"style":423},[420,514,427],{"style":426},[420,516,431],{"style":430},[420,518,111],{"style":430},[420,520,437],{"style":436},[420,522,523],{"style":440},"'..\u002F..\u002Fclient' ",[420,525,526],{"style":430},"}) ",[420,528,530],{"style":529},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F from src\u002Fgen\u002Fclients\u002F to src\u002Fclient.ts",[411,532,534],{"language":413,"code":533,"class":415},"\u002F\u002F src\u002Fclient.ts\nexport * from '.\u002Fgen\u002F.kubb\u002Fclient.ts'",[15,535,536,541,542],{"class":418},[420,537,538],{"class":422,"style":423},[420,539,540],{"style":529},"\u002F\u002F src\u002Fclient.ts","\n",[420,543,544,547,550,553],{"class":422,"style":423},[420,545,546],{"style":436},"export ",[420,548,549],{"style":436},"* ",[420,551,552],{"style":436},"from ",[420,554,555],{"style":440},"'.\u002Fgen\u002F.kubb\u002Fclient.ts'",[11,557,558,559,561,562,565,566,569,570,572],{},"The module must export everything ",[15,560,119],{}," exports, so start from ",[15,563,564],{},"export *"," and override from there. This binding sets up the client once, narrows ",[15,567,568],{},"throwOnError"," to ",[15,571,137],{},", and uses its own error type:",[411,574,576],{"language":413,"code":575,"class":415},"\u002F\u002F src\u002Fclient.ts\nimport { createClient as createKubbClient } from '.\u002Fgen\u002F.kubb\u002Fclient.ts'\nimport type { DataShape, NativeRequest, NativeResponse, Options as KubbOptions } from '.\u002Fgen\u002F.kubb\u002Fclient.ts'\n\nexport * from '.\u002Fgen\u002F.kubb\u002Fclient.ts'\n\nexport class MyHttpError\u003CTError = unknown> extends Error {\n constructor(readonly data: TError) {\n super('Request failed')\n }\n}\n\nexport const client = createKubbClient({ baseURL: 'https:\u002F\u002Fapi.example.com' })\nclient.interceptors.error.use((error) => new MyHttpError(error))\n\n\u002F\u002F SDK classes call `createClient`, so start every new client from the configured one.\nexport const createClient: typeof createKubbClient = (config) => client.extend(config)\n\nexport type Options\u003CTData extends DataShape, ThrowOnError extends boolean = true, TRequest = NativeRequest, TResponse = NativeResponse> = Omit\u003C\n KubbOptions\u003CTData, ThrowOnError, TRequest, TResponse>,\n 'throwOnError'\n> & { throwOnError?: ThrowOnError & true }\n\nexport type ResponseErrorConfig\u003CTError = unknown> = MyHttpError\u003CTError>",[15,577,578,541,582,541,607,541,646,541,648,541,658,541,660,541,694,541,719,541,735,541,740,541,745,541,747,541,773,541,815,541,817,541,822,541,862,541,864,541,921,541,954,541,961,541,983,541,985],{"class":418},[420,579,580],{"class":422,"style":423},[420,581,540],{"style":529},[420,583,584,587,590,594,597,600,603,605],{"class":422,"style":423},[420,585,586],{"style":436},"import ",[420,588,589],{"style":430},"{ ",[420,591,593],{"style":592},"color:#24292e;--hls-dark:#e1e4e8","createClient ",[420,595,596],{"style":436},"as ",[420,598,599],{"style":592},"createKubbClient ",[420,601,602],{"style":430},"} ",[420,604,552],{"style":436},[420,606,555],{"style":440},[420,608,609,611,614,616,619,622,625,627,630,632,635,637,640,642,644],{"class":422,"style":423},[420,610,586],{"style":436},[420,612,613],{"style":592},"type ",[420,615,589],{"style":430},[420,617,618],{"style":426},"DataShape",[420,620,621],{"style":436},", ",[420,623,624],{"style":426},"NativeRequest",[420,626,621],{"style":436},[420,628,629],{"style":426},"NativeResponse",[420,631,621],{"style":436},[420,633,634],{"style":426},"Options ",[420,636,596],{"style":436},[420,638,639],{"style":426},"KubbOptions ",[420,641,602],{"style":430},[420,643,552],{"style":436},[420,645,555],{"style":440},[420,647],{"class":422,"style":423},[420,649,650,652,654,656],{"class":422,"style":423},[420,651,546],{"style":436},[420,653,549],{"style":436},[420,655,552],{"style":436},[420,657,555],{"style":440},[420,659],{"class":422,"style":423},[420,661,662,664,667,670,673,676,679,682,685,688,691],{"class":422,"style":423},[420,663,546],{"style":436},[420,665,666],{"style":436},"class ",[420,668,669],{"style":426},"MyHttpError",[420,671,672],{"style":436},"\u003C",[420,674,675],{"style":426},"TError ",[420,677,678],{"style":436},"= ",[420,680,681],{"style":592},"unknown",[420,683,684],{"style":436},"> ",[420,686,687],{"style":436},"extends ",[420,689,690],{"style":426},"Error ",[420,692,693],{"style":430},"{",[420,695,696,699,702,705,708,711,713,716],{"class":422,"style":423},[420,697,698],{"style":430}," ",[420,700,701],{"style":426},"constructor",[420,703,704],{"style":430},"(",[420,706,707],{"style":436},"readonly ",[420,709,710],{"style":592},"data",[420,712,437],{"style":592},[420,714,715],{"style":426},"TError",[420,717,718],{"style":430},") {",[420,720,721,724,727,729,732],{"class":422,"style":423},[420,722,723],{"style":430}," ",[420,725,726],{"style":592},"super",[420,728,704],{"style":430},[420,730,731],{"style":440},"'Request failed'",[420,733,734],{"style":430},")",[420,736,737],{"class":422,"style":423},[420,738,739],{"style":430}," }",[420,741,742],{"class":422,"style":423},[420,743,744],{"style":430},"}",[420,746],{"class":422,"style":423},[420,748,749,751,754,757,759,762,764,766,768,771],{"class":422,"style":423},[420,750,546],{"style":436},[420,752,753],{"style":436},"const ",[420,755,756],{"style":592},"client ",[420,758,678],{"style":436},[420,760,761],{"style":426},"createKubbClient",[420,763,431],{"style":430},[420,765,96],{"style":430},[420,767,437],{"style":436},[420,769,770],{"style":440},"'https:\u002F\u002Fapi.example.com' ",[420,772,444],{"style":430},[420,774,775,777,779,782,784,787,789,792,795,797,800,803,806,808,810,812],{"class":422,"style":423},[420,776,474],{"style":592},[420,778,24],{"style":436},[420,780,781],{"style":430},"interceptors",[420,783,24],{"style":436},[420,785,786],{"style":430},"error",[420,788,24],{"style":436},[420,790,791],{"style":426},"use",[420,793,794],{"style":430},"((",[420,796,786],{"style":592},[420,798,799],{"style":430},") ",[420,801,802],{"style":436},"=> ",[420,804,805],{"style":436},"new ",[420,807,669],{"style":426},[420,809,704],{"style":430},[420,811,786],{"style":592},[420,813,814],{"style":430},"))",[420,816],{"class":422,"style":423},[420,818,819],{"class":422,"style":423},[420,820,821],{"style":529},"\u002F\u002F SDK classes call `createClient`, so start every new client from the configured one.",[420,823,824,826,828,831,833,836,838,840,842,845,847,849,851,853,856,858,860],{"class":422,"style":423},[420,825,546],{"style":436},[420,827,753],{"style":436},[420,829,830],{"style":592},"createClient",[420,832,437],{"style":436},[420,834,835],{"style":436},"typeof ",[420,837,599],{"style":592},[420,839,678],{"style":436},[420,841,704],{"style":430},[420,843,844],{"style":592},"config",[420,846,799],{"style":430},[420,848,802],{"style":436},[420,850,474],{"style":592},[420,852,24],{"style":436},[420,854,855],{"style":426},"extend",[420,857,704],{"style":430},[420,859,844],{"style":592},[420,861,734],{"style":430},[420,863],{"class":422,"style":423},[420,865,866,868,870,872,874,877,879,881,883,886,888,891,893,895,897,900,902,904,906,909,911,913,916,919],{"class":422,"style":423},[420,867,546],{"style":436},[420,869,613],{"style":436},[420,871,6],{"style":426},[420,873,672],{"style":436},[420,875,876],{"style":426},"TData ",[420,878,687],{"style":436},[420,880,618],{"style":426},[420,882,621],{"style":436},[420,884,885],{"style":426},"ThrowOnError ",[420,887,687],{"style":436},[420,889,890],{"style":426},"boolean ",[420,892,678],{"style":436},[420,894,137],{"style":430},[420,896,621],{"style":436},[420,898,899],{"style":426},"TRequest ",[420,901,678],{"style":436},[420,903,624],{"style":426},[420,905,621],{"style":436},[420,907,908],{"style":426},"TResponse ",[420,910,678],{"style":436},[420,912,629],{"style":426},[420,914,915],{"style":436},"> = ",[420,917,918],{"style":426},"Omit",[420,920,672],{"style":436},[420,922,923,925,928,930,933,935,938,940,943,945,948,951],{"class":422,"style":423},[420,924,698],{"style":436},[420,926,927],{"style":426},"KubbOptions",[420,929,672],{"style":436},[420,931,932],{"style":426},"TData",[420,934,621],{"style":436},[420,936,937],{"style":426},"ThrowOnError",[420,939,621],{"style":436},[420,941,942],{"style":426},"TRequest",[420,944,621],{"style":436},[420,946,947],{"style":426},"TResponse",[420,949,950],{"style":436},">",[420,952,953],{"style":436},",",[420,955,956,958],{"class":422,"style":423},[420,957,698],{"style":436},[420,959,960],{"style":440},"'throwOnError'",[420,962,963,966,968,970,973,975,978,981],{"class":422,"style":423},[420,964,965],{"style":436},"> & ",[420,967,589],{"style":430},[420,969,568],{"style":430},[420,971,972],{"style":592},"?: ",[420,974,885],{"style":426},[420,976,977],{"style":436},"& ",[420,979,980],{"style":430},"true ",[420,982,744],{"style":430},[420,984],{"class":422,"style":423},[420,986,987,989,991,994,996,998,1000,1002,1004,1006,1008,1010],{"class":422,"style":423},[420,988,546],{"style":436},[420,990,613],{"style":436},[420,992,993],{"style":426},"ResponseErrorConfig",[420,995,672],{"style":436},[420,997,675],{"style":426},[420,999,678],{"style":436},[420,1001,681],{"style":592},[420,1003,915],{"style":436},[420,1005,669],{"style":426},[420,1007,672],{"style":436},[420,1009,715],{"style":426},[420,1011,950],{"style":436},[1013,1014,1015,1030],"ul",{},[1016,1017,1018,1019,1021,1022,1025,1026,1029],"li",{},"Keep the type parameters of ",[15,1020,6],{},". Write the narrowed field as ",[15,1023,1024],{},"ThrowOnError & true",": a plain ",[15,1027,1028],{},"throwOnError?: true"," does not compile in the generated functions.",[1016,1031,1032,1034,1035,1038],{},[15,1033,993],{}," and ",[15,1036,1037],{},"RequestConfig"," reach the query hooks only. The generated functions take their result type from the runtime, and the error interceptor converts an error only when the call throws.",[11,1040,1041,1042,1044,1045,24],{},"To write the whole client yourself, with no ",[15,1043,466],{}," runtime, use ",[20,1046,1048],{"href":1047},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-client",[15,1049,1050],{},"@kubb\u002Fplugin-client",[362,1052,129],{"id":1053},"throwonerrordefault",[11,1055,1056,1057,1059,1060,1062,1063,1066,1067,24],{},"The ",[15,1058,568],{}," a generated function or SDK method uses when the call leaves it out. Neither ",[15,1061,307],{}," nor ",[15,1064,1065],{},"client.setConfig({ throwOnError })"," changes it. Query hooks always pass ",[15,1068,1069],{},"throwOnError: true",[31,1071,1072,1080],{},[34,1073,1074],{},[37,1075,1076,1078],{},[40,1077],{},[40,1079],{},[50,1081,1082,1091,1099],{},[37,1083,1084,1086],{},[55,1085,388],{},[55,1087,1088],{},[15,1089,1090],{},"boolean",[37,1092,1093,1095],{},[55,1094,398],{},[55,1096,1097],{},[15,1098,155],{},[37,1100,1101,1103],{},[55,1102,48],{},[55,1104,1105],{},[15,1106,137],{},[411,1108,1110],{"language":413,"code":1109,"class":415},"\u002F\u002F with pluginAxios({ throwOnErrorDefault: false })\nconst result = await getPetById({ path: { petId: 1 } })\nif (result.error !== undefined) console.error(result.status, result.error)",[15,1111,1112,541,1117,541,1152],{"class":418},[420,1113,1114],{"class":422,"style":423},[420,1115,1116],{"style":529},"\u002F\u002F with pluginAxios({ throwOnErrorDefault: false })",[420,1118,1119,1121,1124,1126,1129,1132,1134,1137,1139,1141,1144,1146,1149],{"class":422,"style":423},[420,1120,753],{"style":436},[420,1122,1123],{"style":592},"result ",[420,1125,678],{"style":436},[420,1127,1128],{"style":436},"await ",[420,1130,1131],{"style":426},"getPetById",[420,1133,431],{"style":430},[420,1135,1136],{"style":430},"path",[420,1138,437],{"style":436},[420,1140,589],{"style":430},[420,1142,1143],{"style":430},"petId",[420,1145,437],{"style":436},[420,1147,1148],{"style":430},"1 ",[420,1150,1151],{"style":430},"} })",[420,1153,1154,1157,1159,1162,1164,1167,1170,1173,1175,1178,1180,1182,1184,1186,1188,1191,1193,1195,1197,1199],{"class":422,"style":423},[420,1155,1156],{"style":436},"if ",[420,1158,704],{"style":430},[420,1160,1161],{"style":592},"result",[420,1163,24],{"style":436},[420,1165,1166],{"style":430},"error ",[420,1168,1169],{"style":436},"!== ",[420,1171,1172],{"style":430},"undefined",[420,1174,799],{"style":430},[420,1176,1177],{"style":592},"console",[420,1179,24],{"style":436},[420,1181,786],{"style":426},[420,1183,704],{"style":430},[420,1185,1161],{"style":592},[420,1187,24],{"style":436},[420,1189,1190],{"style":430},"status",[420,1192,621],{"style":436},[420,1194,1161],{"style":592},[420,1196,24],{"style":436},[420,1198,786],{"style":430},[420,1200,734],{"style":430},[362,1202,147],{"id":147},[11,1204,1205,1206,1209,1210,1213,1214,1217,1218,1209,1221,1217,1224,1227,1228,24],{},"Checks requests and responses against the schemas of ",[15,1207,1208],{},"@kubb\u002Fplugin-zod"," or ",[15,1211,1212],{},"@kubb\u002Fplugin-valibot",". Add ",[15,1215,1216],{},"pluginZod()"," for ",[15,1219,1220],{},"'zod'",[15,1222,1223],{},"pluginValibot()",[15,1225,1226],{},"'valibot'",". A value that fails its schema throws a ",[15,1229,1230],{},"ValidationError",[31,1232,1233,1241],{},[34,1234,1235],{},[37,1236,1237,1239],{},[40,1238],{},[40,1240],{},[50,1242,1243,1252,1260],{},[37,1244,1245,1247],{},[55,1246,388],{},[55,1248,1249],{},[15,1250,1251],{},"false | 'zod' | 'valibot' | { request?; params?; response? }",[37,1253,1254,1256],{},[55,1255,398],{},[55,1257,1258],{},[15,1259,155],{},[37,1261,1262,1264],{},[55,1263,48],{},[55,1265,1266],{},[15,1267,155],{},[1269,1270,1271,1275,1278,1286],"field-group",{},[1272,1273,1274],"field",{"name":155},"Default value. No validation. The response is cast to the generated type.",[1272,1276,1277],{"name":1220},"Validates the success body, and an error body against the schema of its status.",[1272,1279,1280,1281,1283,1284,24],{"name":1226},"Works as ",[15,1282,1220],{},", with the schemas of ",[15,1285,1212],{},[1272,1287,1289,1290,1209,1292,1294,1295,1298,1299,1302,1303,1306,1307,24],{"name":1288},"{ request?, params?, response? }","Opts in per part, with ",[15,1291,1220],{},[15,1293,1226],{}," as the value. Use one library for every part. ",[15,1296,1297],{},"request"," checks the body and ",[15,1300,1301],{},"params"," the path, query, header, and cookie params before the send. ",[15,1304,1305],{},"response"," works as ",[15,1308,1220],{},[411,1310,1313],{"language":413,"filename":1311,"code":1312,"class":415},"kubb.config.ts","import { defineConfig } from 'kubb\u002Fconfig'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\nimport { pluginAxios } from '@kubb\u002Fplugin-axios'\n\nexport default defineConfig({\n input: '.\u002FpetStore.yaml',\n output: { path: '.\u002Fsrc\u002Fgen' },\n plugins: [pluginTs(), pluginZod(), pluginAxios({ validator: { request: 'zod', params: 'zod', response: 'zod' } })],\n})",[15,1314,1315,541,1331,541,1347,541,1363,541,1379,541,1381,541,1394,541,1408,541,1429,541,1494],{"class":418},[420,1316,1317,1319,1321,1324,1326,1328],{"class":422,"style":423},[420,1318,586],{"style":436},[420,1320,589],{"style":430},[420,1322,1323],{"style":592},"defineConfig ",[420,1325,602],{"style":430},[420,1327,552],{"style":436},[420,1329,1330],{"style":440},"'kubb\u002Fconfig'",[420,1332,1333,1335,1337,1340,1342,1344],{"class":422,"style":423},[420,1334,586],{"style":436},[420,1336,589],{"style":430},[420,1338,1339],{"style":592},"pluginTs ",[420,1341,602],{"style":430},[420,1343,552],{"style":436},[420,1345,1346],{"style":440},"'@kubb\u002Fplugin-ts'",[420,1348,1349,1351,1353,1356,1358,1360],{"class":422,"style":423},[420,1350,586],{"style":436},[420,1352,589],{"style":430},[420,1354,1355],{"style":592},"pluginZod ",[420,1357,602],{"style":430},[420,1359,552],{"style":436},[420,1361,1362],{"style":440},"'@kubb\u002Fplugin-zod'",[420,1364,1365,1367,1369,1372,1374,1376],{"class":422,"style":423},[420,1366,586],{"style":436},[420,1368,589],{"style":430},[420,1370,1371],{"style":592},"pluginAxios ",[420,1373,602],{"style":430},[420,1375,552],{"style":436},[420,1377,1378],{"style":440},"'@kubb\u002Fplugin-axios'",[420,1380],{"class":422,"style":423},[420,1382,1383,1385,1388,1391],{"class":422,"style":423},[420,1384,546],{"style":436},[420,1386,1387],{"style":436},"default ",[420,1389,1390],{"style":426},"defineConfig",[420,1392,1393],{"style":430},"({",[420,1395,1396,1398,1401,1403,1406],{"class":422,"style":423},[420,1397,698],{"style":430},[420,1399,1400],{"style":430},"input",[420,1402,437],{"style":436},[420,1404,1405],{"style":440},"'.\u002FpetStore.yaml'",[420,1407,953],{"style":436},[420,1409,1410,1412,1414,1416,1418,1420,1422,1425,1427],{"class":422,"style":423},[420,1411,698],{"style":436},[420,1413,62],{"style":430},[420,1415,437],{"style":436},[420,1417,589],{"style":430},[420,1419,1136],{"style":430},[420,1421,437],{"style":436},[420,1423,1424],{"style":440},"'.\u002Fsrc\u002Fgen' ",[420,1426,744],{"style":430},[420,1428,953],{"style":436},[420,1430,1431,1433,1436,1438,1441,1444,1447,1449,1452,1454,1456,1458,1460,1462,1464,1466,1468,1470,1472,1474,1476,1478,1480,1482,1484,1486,1489,1492],{"class":422,"style":423},[420,1432,698],{"style":436},[420,1434,1435],{"style":430},"plugins",[420,1437,437],{"style":436},[420,1439,1440],{"style":430},"[",[420,1442,1443],{"style":426},"pluginTs",[420,1445,1446],{"style":430},"()",[420,1448,621],{"style":436},[420,1450,1451],{"style":426},"pluginZod",[420,1453,1446],{"style":430},[420,1455,621],{"style":436},[420,1457,427],{"style":426},[420,1459,431],{"style":430},[420,1461,147],{"style":430},[420,1463,437],{"style":436},[420,1465,589],{"style":430},[420,1467,1297],{"style":430},[420,1469,437],{"style":436},[420,1471,1220],{"style":440},[420,1473,621],{"style":436},[420,1475,1301],{"style":430},[420,1477,437],{"style":436},[420,1479,1220],{"style":440},[420,1481,621],{"style":436},[420,1483,1305],{"style":430},[420,1485,437],{"style":436},[420,1487,1488],{"style":440},"'zod' ",[420,1490,1491],{"style":430},"} })]",[420,1493,953],{"style":436},[420,1495,1496],{"class":422,"style":423},[420,1497,444],{"style":430},[11,1499,1500,1501,1034,1505,24],{},"See ",[20,1502,1504],{"href":1503},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Fguides\u002Ferror-handling#turn-validation-off-at-runtime","Turn validation off at runtime",[20,1506,1508],{"href":1507},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Fguides\u002Fserialization#parameter-validation","Parameter validation",[362,1510,165],{"id":165},[11,1512,1513,1514,1516],{},"Sets how generated functions take the ",[15,1515,165],{}," option.",[31,1518,1519,1527],{},[34,1520,1521],{},[37,1522,1523,1525],{},[40,1524],{},[40,1526],{},[50,1528,1529,1538],{},[37,1530,1531,1533],{},[55,1532,388],{},[55,1534,1535],{},[15,1536,1537],{},"{ mode?: 'optional' | 'required' }",[37,1539,1540,1542],{},[55,1541,398],{},[55,1543,1544],{},[15,1545,155],{},[1269,1547,1548,1559],{},[1272,1549,1551,1552,1554,1555,1558],{"name":1550},"mode: 'optional'","Default value. Every generated function takes ",[15,1553,165],{}," as an optional option. Use it when ",[15,1556,1557],{},"client.setConfig({ auth })"," supplies the token, and with the query plugins, which pass a partial config to the function.",[1272,1560,1562,1563,1565,1566,1569,1570,1573,1574,1576],{"name":1561},"mode: 'required'","A generated function whose operation needs a security scheme takes ",[15,1564,165],{}," as a required option, so a missing token fails at compile time. An operation without ",[15,1567,1568],{},"security",", or one that allows ",[15,1571,1572],{},"{}"," (anonymous access), keeps ",[15,1575,165],{}," optional.",[11,1578,1579,1580,1582],{},"SDK classes take ",[15,1581,165],{}," in their constructor and ignore this option.",[411,1584,1587],{"language":1585,"code":1586,"class":415},"ts","\u002F\u002F with pluginAxios({ auth: { mode: 'required' } })\nawait addPet({ body, auth: () => getToken() })\nawait addPet({ body }) \u002F\u002F Type error: `auth` is missing",[15,1588,1590,541,1595,541,1624],{"class":1589},"language-ts",[420,1591,1592],{"class":422,"style":423},[420,1593,1594],{"style":529},"\u002F\u002F with pluginAxios({ auth: { mode: 'required' } })",[420,1596,1597,1599,1602,1604,1607,1609,1611,1613,1616,1618,1621],{"class":422,"style":423},[420,1598,1128],{"style":436},[420,1600,1601],{"style":426},"addPet",[420,1603,431],{"style":430},[420,1605,1606],{"style":592},"body",[420,1608,621],{"style":436},[420,1610,165],{"style":430},[420,1612,437],{"style":436},[420,1614,1615],{"style":430},"() ",[420,1617,802],{"style":436},[420,1619,1620],{"style":426},"getToken",[420,1622,1623],{"style":430},"() })",[420,1625,1626,1628,1630,1632,1635,1637],{"class":422,"style":423},[420,1627,1128],{"style":436},[420,1629,1601],{"style":426},[420,1631,431],{"style":430},[420,1633,1634],{"style":592},"body ",[420,1636,526],{"style":430},[420,1638,1639],{"style":529},"\u002F\u002F Type error: `auth` is missing",[362,1641,202],{"id":1642},"returntype",[11,1644,1645,1646,1649],{},"What a generated function or SDK method resolves to. The query plugins and ",[15,1647,1648],{},"@kubb\u002Fplugin-mcp"," read it too.",[31,1651,1652,1660],{},[34,1653,1654],{},[37,1655,1656,1658],{},[40,1657],{},[40,1659],{},[50,1661,1662,1671,1679],{},[37,1663,1664,1666],{},[55,1665,388],{},[55,1667,1668],{},[15,1669,1670],{},"'full' | 'data'",[37,1672,1673,1675],{},[55,1674,398],{},[55,1676,1677],{},[15,1678,155],{},[37,1680,1681,1683],{},[55,1682,48],{},[55,1684,1685],{},[15,1686,210],{},[1269,1688,1689,1695],{},[1272,1690,1691,1692,24],{"name":210},"Default value. The full result: ",[15,1693,1694],{},"{ status, data, error, contentType, headers, request, response }",[1272,1696,1698,1699,1702],{"name":1697},"'data'","The success body. With ",[15,1700,1701],{},"throwOnError: false",", the full result, so the caller can tell an error from a success.",[411,1704,1706],{"language":413,"code":1705,"class":415},"pluginAxios({ returnType: 'data' })\n\nconst pet = await getPetById({ path: { petId: 1 } }) \u002F\u002F Pet, not { status, data, ... }",[15,1707,1708,541,1723,541,1725],{"class":418},[420,1709,1710,1712,1714,1716,1718,1721],{"class":422,"style":423},[420,1711,427],{"style":426},[420,1713,431],{"style":430},[420,1715,202],{"style":430},[420,1717,437],{"style":436},[420,1719,1720],{"style":440},"'data' ",[420,1722,444],{"style":430},[420,1724],{"class":422,"style":423},[420,1726,1727,1729,1732,1734,1736,1738,1740,1742,1744,1746,1748,1750,1752,1755],{"class":422,"style":423},[420,1728,753],{"style":436},[420,1730,1731],{"style":592},"pet ",[420,1733,678],{"style":436},[420,1735,1128],{"style":436},[420,1737,1131],{"style":426},[420,1739,431],{"style":430},[420,1741,1136],{"style":430},[420,1743,437],{"style":436},[420,1745,589],{"style":430},[420,1747,1143],{"style":430},[420,1749,437],{"style":436},[420,1751,1148],{"style":430},[420,1753,1754],{"style":430},"} }) ",[420,1756,1757],{"style":529},"\u002F\u002F Pet, not { status, data, ... }",[11,1759,1500,1760,24],{},[20,1761,1763,1764],{"href":1762},"https:\u002F\u002Fkubb.dev\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Fguides\u002Ferror-handling#read-headers-with-returntype-data","Read headers with ",[15,1765,1766],{},"returnType: 'data'",[362,1768,220],{"id":220},[11,1770,1771],{},"Generates classes instead of standalone functions. Each instance builds its own client from its config, so two environments are two instances.",[31,1773,1774,1782],{},[34,1775,1776],{},[37,1777,1778,1780],{},[40,1779],{},[40,1781],{},[50,1783,1784,1793],{},[37,1785,1786,1788],{},[55,1787,388],{},[55,1789,1790],{},[15,1791,1792],{},"{ mode?: 'tag' | 'flat'; name?: string }",[37,1794,1795,1797],{},[55,1796,398],{},[55,1798,1799],{},[15,1800,155],{},[1269,1802,1803,1826],{},[1272,1804,1806,1807,1810,1811,1814,1815,1818,1819,1825],{"name":1805},"mode: 'tag'","Default value. One class per tag, such as ",[15,1808,1809],{},"PetClient",". With ",[15,1812,1813],{},"name",", a root class also shares one client with every tag: ",[15,1816,1817],{},"new PetStore(config).pet.getPetById(...)",". Throws ",[20,1820,1822],{"href":1821},"https:\u002F\u002Fkubb.dev\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics#kubb-invalid-plugin-options",[15,1823,1824],{},"KUBB_INVALID_PLUGIN_OPTIONS"," with single-file output.",[1272,1827,1828,1829,1831,1832,1834,1835,1838,1839,1842],{"name":264},"One class named by ",[15,1830,1813],{},", with every operation as a method. Without ",[15,1833,1813],{},", the class is ",[15,1836,1837],{},"Sdk"," in ",[15,1840,1841],{},"sdk.ts",". Works with single-file output.",[11,1844,1845,1846,1848],{},"Methods take the same options and return the same result as the standalone functions. Interceptors on the root class's ",[15,1847,474],{}," reach every tag:",[411,1850,1852],{"language":413,"code":1851,"class":415},"const api = new PetStore({ baseURL: 'https:\u002F\u002Fpetstore.swagger.io\u002Fv2' })\napi.client.interceptors.request.use((request) => request)\nawait api.pet.getPetById({ path: { petId: 1 } })\n\nconst pets = new PetClient(api.client) \u002F\u002F a tag class also accepts an existing client",[15,1853,1854,541,1879,541,1912,541,1943,541,1945],{"class":418},[420,1855,1856,1858,1861,1863,1865,1868,1870,1872,1874,1877],{"class":422,"style":423},[420,1857,753],{"style":436},[420,1859,1860],{"style":592},"api ",[420,1862,678],{"style":436},[420,1864,805],{"style":436},[420,1866,1867],{"style":426},"PetStore",[420,1869,431],{"style":430},[420,1871,96],{"style":430},[420,1873,437],{"style":436},[420,1875,1876],{"style":440},"'https:\u002F\u002Fpetstore.swagger.io\u002Fv2' ",[420,1878,444],{"style":430},[420,1880,1881,1884,1886,1888,1890,1892,1894,1896,1898,1900,1902,1904,1906,1908,1910],{"class":422,"style":423},[420,1882,1883],{"style":592},"api",[420,1885,24],{"style":436},[420,1887,474],{"style":430},[420,1889,24],{"style":436},[420,1891,781],{"style":430},[420,1893,24],{"style":436},[420,1895,1297],{"style":430},[420,1897,24],{"style":436},[420,1899,791],{"style":426},[420,1901,794],{"style":430},[420,1903,1297],{"style":592},[420,1905,799],{"style":430},[420,1907,802],{"style":436},[420,1909,1297],{"style":592},[420,1911,734],{"style":430},[420,1913,1914,1916,1918,1920,1923,1925,1927,1929,1931,1933,1935,1937,1939,1941],{"class":422,"style":423},[420,1915,1128],{"style":436},[420,1917,1883],{"style":592},[420,1919,24],{"style":436},[420,1921,1922],{"style":430},"pet",[420,1924,24],{"style":436},[420,1926,1131],{"style":426},[420,1928,431],{"style":430},[420,1930,1136],{"style":430},[420,1932,437],{"style":436},[420,1934,589],{"style":430},[420,1936,1143],{"style":430},[420,1938,437],{"style":436},[420,1940,1148],{"style":430},[420,1942,1151],{"style":430},[420,1944],{"class":422,"style":423},[420,1946,1947,1949,1952,1954,1956,1958,1960,1962,1964,1966,1968],{"class":422,"style":423},[420,1948,753],{"style":436},[420,1950,1951],{"style":592},"pets ",[420,1953,678],{"style":436},[420,1955,805],{"style":436},[420,1957,1809],{"style":426},[420,1959,704],{"style":430},[420,1961,1883],{"style":592},[420,1963,24],{"style":436},[420,1965,474],{"style":430},[420,1967,799],{"style":430},[420,1969,1970],{"style":529},"\u002F\u002F a tag class also accepts an existing client",[446,1972,1974,1975,1977,1978,1980],{"as":1973},"warning","The query plugins and ",[15,1976,1648],{}," call the standalone functions, so leave ",[15,1979,220],{}," unset for them.",[362,1982,326],{"id":326},[11,1984,1985,1986,1990,1991,1993,1994,1996],{},"Adds three members to the shared ",[20,1987,1988],{"href":323},[15,1989,326],{},". Members you leave out keep ",[15,1992,338],{},". Pass an array to merge several patches over ",[15,1995,338],{},", left to right.",[31,1998,1999,2007],{},[34,2000,2001],{},[37,2002,2003,2005],{},[40,2004],{},[40,2006],{},[50,2008,2009,2018],{},[37,2010,2011,2013],{},[55,2012,388],{},[55,2014,2015],{},[15,2016,2017],{},"ResolverInput\u003CResolverClient>",[37,2019,2020,2022],{},[55,2021,398],{},[55,2023,2024],{},[15,2025,155],{},[31,2027,2028,2041],{},[34,2029,2030],{},[37,2031,2032,2035,2038],{},[40,2033,2034],{},"Member",[40,2036,2037],{},"Names",[40,2039,2040],{},"Example",[50,2042,2043,2061,2078],{},[37,2044,2045,2050,2053],{},[55,2046,2047],{},[15,2048,2049],{},"className(name)",[55,2051,2052],{},"The root class, the flat class, and the class of untagged operations.",[55,2054,2055,2058,2059],{},[15,2056,2057],{},"className('petStore')"," → ",[15,2060,1867],{},[37,2062,2063,2068,2071],{},[55,2064,2065],{},[15,2066,2067],{},"groupName(name)",[55,2069,2070],{},"A tag class.",[55,2072,2073,2058,2076],{},[15,2074,2075],{},"groupName('pet')",[15,2077,1809],{},[37,2079,2080,2085,2088],{},[55,2081,2082],{},[15,2083,2084],{},"propertyName(name)",[55,2086,2087],{},"The field a tag class has on the root class.",[55,2089,2090,2058,2093],{},[15,2091,2092],{},"propertyName('pet')",[15,2094,1922],{},{"title":2096,"searchDepth":2097,"depth":2097,"links":2098},"",5,[2099,2101],{"id":28,"depth":2100,"text":29},2,{"id":359,"depth":2100,"text":360,"children":2102},[2103,2105,2106,2107,2108,2109,2110,2111],{"id":364,"depth":2104,"text":96},3,{"id":460,"depth":2104,"text":111},{"id":1053,"depth":2104,"text":129},{"id":147,"depth":2104,"text":147},{"id":165,"depth":2104,"text":165},{"id":1642,"depth":2104,"text":202},{"id":220,"depth":2104,"text":220},{"id":326,"depth":2104,"text":326},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios\u002Foptions",1795727679985,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]