[{"data":1,"prerenderedAt":3374},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval":3},{"id":4,"title":5,"body":6,"description":3356,"extension":3357,"frontmatter":3358,"heading":5,"meta":3365,"navigation":3367,"order":3361,"path":3368,"seo":3369,"sitemap":3370,"source":3371,"stem":3372,"__hash__":3373},"docs\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval.md","Move from orval to Kubb",{"type":7,"value":8,"toc":3339},"minimark",[9,13,36,41,44,729,733,738,902,906,1035],[10,11,12],"p",{},"Start with the types, then replace one orval output at a time: the client, the query hooks, the Zod schemas, and the mocks. You can stop after any step.",[10,14,15,16,20,21,20,24,27,28,31,32,35],{},"The examples move an orval config with ",[17,18,19],"code",{},"client: 'react-query'",", ",[17,22,23],{},"httpClient: 'fetch'",[17,25,26],{},"mock: true",", and a second ",[17,29,30],{},"client: 'zod'"," output, all written to ",[17,33,34],{},"src\u002Fapi",".",[37,38,40],"h2",{"id":39},"the-config-before-and-after","The config, before and after",[10,42,43],{},"The Kubb config is the result of every step below. Each step adds one plugin to it.",[45,46,47,350],"code-group",{},[48,49,54],"pre",{"language":50,"filename":51,"code":52,"class":53},"typescript","orval.config.ts","import { defineConfig } from 'orval'\n\nexport default defineConfig({\n  petstore: {\n    input: '.\u002Fopenapi.yaml',\n    output: {\n      mode: 'tags-split',\n      target: '.\u002Fsrc\u002Fapi',\n      schemas: '.\u002Fsrc\u002Fapi\u002Fmodel',\n      client: 'react-query',\n      httpClient: 'fetch',\n      mock: true,\n    },\n  },\n  petstoreZod: {\n    input: '.\u002Fopenapi.yaml',\n    output: {\n      mode: 'tags-split',\n      target: '.\u002Fsrc\u002Fapi',\n      client: 'zod',\n      fileExtension: '.zod.ts',\n    },\n  },\n})","highlights",[17,55,57,84,85,84,87,84,102,84,116,84,132,84,143,84,158,84,172,84,186,84,200,84,214,84,228,84,237,84,245,84,256,84,268,84,278,84,290,84,302,84,315,84,329,84,337,84,345],{"class":56},"language-typescript",[58,59,62,66,70,74,77,80],"span",{"class":60,"style":61},"line","display: inline",[58,63,65],{"style":64},"color:#d73a49;--hls-dark:#f97583","import ",[58,67,69],{"style":68},"color:#005cc5;--hls-dark:#79b8ff","{ ",[58,71,73],{"style":72},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[58,75,76],{"style":68},"} ",[58,78,79],{"style":64},"from ",[58,81,83],{"style":82},"color:#032f62;--hls-dark:#9ecbff","'orval'","\n",[58,86],{"class":60,"style":61},[58,88,89,92,95,99],{"class":60,"style":61},[58,90,91],{"style":64},"export ",[58,93,94],{"style":64},"default ",[58,96,98],{"style":97},"color:#6f42c1;--hls-dark:#b392f0","defineConfig",[58,100,101],{"style":68},"({",[58,103,104,107,110,113],{"class":60,"style":61},[58,105,106],{"style":68},"  ",[58,108,109],{"style":68},"petstore",[58,111,112],{"style":64},": ",[58,114,115],{"style":68},"{",[58,117,118,121,124,126,129],{"class":60,"style":61},[58,119,120],{"style":68},"    ",[58,122,123],{"style":68},"input",[58,125,112],{"style":64},[58,127,128],{"style":82},"'.\u002Fopenapi.yaml'",[58,130,131],{"style":64},",",[58,133,134,136,139,141],{"class":60,"style":61},[58,135,120],{"style":64},[58,137,138],{"style":68},"output",[58,140,112],{"style":64},[58,142,115],{"style":68},[58,144,145,148,151,153,156],{"class":60,"style":61},[58,146,147],{"style":68},"      ",[58,149,150],{"style":68},"mode",[58,152,112],{"style":64},[58,154,155],{"style":82},"'tags-split'",[58,157,131],{"style":64},[58,159,160,162,165,167,170],{"class":60,"style":61},[58,161,147],{"style":64},[58,163,164],{"style":68},"target",[58,166,112],{"style":64},[58,168,169],{"style":82},"'.\u002Fsrc\u002Fapi'",[58,171,131],{"style":64},[58,173,174,176,179,181,184],{"class":60,"style":61},[58,175,147],{"style":64},[58,177,178],{"style":68},"schemas",[58,180,112],{"style":64},[58,182,183],{"style":82},"'.\u002Fsrc\u002Fapi\u002Fmodel'",[58,185,131],{"style":64},[58,187,188,190,193,195,198],{"class":60,"style":61},[58,189,147],{"style":64},[58,191,192],{"style":68},"client",[58,194,112],{"style":64},[58,196,197],{"style":82},"'react-query'",[58,199,131],{"style":64},[58,201,202,204,207,209,212],{"class":60,"style":61},[58,203,147],{"style":64},[58,205,206],{"style":68},"httpClient",[58,208,112],{"style":64},[58,210,211],{"style":82},"'fetch'",[58,213,131],{"style":64},[58,215,216,218,221,223,226],{"class":60,"style":61},[58,217,147],{"style":64},[58,219,220],{"style":68},"mock",[58,222,112],{"style":64},[58,224,225],{"style":68},"true",[58,227,131],{"style":64},[58,229,230,232,235],{"class":60,"style":61},[58,231,120],{"style":64},[58,233,234],{"style":68},"}",[58,236,131],{"style":64},[58,238,239,241,243],{"class":60,"style":61},[58,240,106],{"style":64},[58,242,234],{"style":68},[58,244,131],{"style":64},[58,246,247,249,252,254],{"class":60,"style":61},[58,248,106],{"style":64},[58,250,251],{"style":68},"petstoreZod",[58,253,112],{"style":64},[58,255,115],{"style":68},[58,257,258,260,262,264,266],{"class":60,"style":61},[58,259,120],{"style":68},[58,261,123],{"style":68},[58,263,112],{"style":64},[58,265,128],{"style":82},[58,267,131],{"style":64},[58,269,270,272,274,276],{"class":60,"style":61},[58,271,120],{"style":64},[58,273,138],{"style":68},[58,275,112],{"style":64},[58,277,115],{"style":68},[58,279,280,282,284,286,288],{"class":60,"style":61},[58,281,147],{"style":68},[58,283,150],{"style":68},[58,285,112],{"style":64},[58,287,155],{"style":82},[58,289,131],{"style":64},[58,291,292,294,296,298,300],{"class":60,"style":61},[58,293,147],{"style":64},[58,295,164],{"style":68},[58,297,112],{"style":64},[58,299,169],{"style":82},[58,301,131],{"style":64},[58,303,304,306,308,310,313],{"class":60,"style":61},[58,305,147],{"style":64},[58,307,192],{"style":68},[58,309,112],{"style":64},[58,311,312],{"style":82},"'zod'",[58,314,131],{"style":64},[58,316,317,319,322,324,327],{"class":60,"style":61},[58,318,147],{"style":64},[58,320,321],{"style":68},"fileExtension",[58,323,112],{"style":64},[58,325,326],{"style":82},"'.zod.ts'",[58,328,131],{"style":64},[58,330,331,333,335],{"class":60,"style":61},[58,332,120],{"style":64},[58,334,234],{"style":68},[58,336,131],{"style":64},[58,338,339,341,343],{"class":60,"style":61},[58,340,106],{"style":64},[58,342,234],{"style":68},[58,344,131],{"style":64},[58,346,347],{"class":60,"style":61},[58,348,349],{"style":68},"})",[48,351,354],{"language":50,"filename":352,"code":353,"class":53},"kubb.config.ts","import { defineConfig } from 'kubb\u002Fconfig'\nimport { adapterOas } from '@kubb\u002Fadapter-oas'\nimport { pluginFaker } from '@kubb\u002Fplugin-faker'\nimport { pluginFetch } from '@kubb\u002Fplugin-fetch'\nimport { pluginMsw } from '@kubb\u002Fplugin-msw'\nimport { pluginReactQuery } from '@kubb\u002Fplugin-react-query'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\n\nexport default defineConfig({\n  input: '.\u002Fopenapi.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  adapter: adapterOas({ integerType: 'number' }),\n  plugins: [\n    pluginTs({ output: { path: 'types.ts' } }),\n    \u002F\u002F The Petstore URL is an example. Use your API's URL.\n    pluginFetch({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', throwOnErrorDefault: false }),\n    pluginReactQuery({ hooks: true }),\n    pluginZod(),\n    pluginFaker(),\n    pluginMsw({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', parser: 'faker', handlers: true }),\n  ],\n})",[17,355,356,84,371,84,387,84,403,84,419,84,435,84,451,84,467,84,483,84,485,84,495,84,507,84,529,84,556,84,568,84,595,84,603,84,634,84,655,84,667,84,678,84,716,84,725],{"class":56},[58,357,358,360,362,364,366,368],{"class":60,"style":61},[58,359,65],{"style":64},[58,361,69],{"style":68},[58,363,73],{"style":72},[58,365,76],{"style":68},[58,367,79],{"style":64},[58,369,370],{"style":82},"'kubb\u002Fconfig'",[58,372,373,375,377,380,382,384],{"class":60,"style":61},[58,374,65],{"style":64},[58,376,69],{"style":68},[58,378,379],{"style":72},"adapterOas ",[58,381,76],{"style":68},[58,383,79],{"style":64},[58,385,386],{"style":82},"'@kubb\u002Fadapter-oas'",[58,388,389,391,393,396,398,400],{"class":60,"style":61},[58,390,65],{"style":64},[58,392,69],{"style":68},[58,394,395],{"style":72},"pluginFaker ",[58,397,76],{"style":68},[58,399,79],{"style":64},[58,401,402],{"style":82},"'@kubb\u002Fplugin-faker'",[58,404,405,407,409,412,414,416],{"class":60,"style":61},[58,406,65],{"style":64},[58,408,69],{"style":68},[58,410,411],{"style":72},"pluginFetch ",[58,413,76],{"style":68},[58,415,79],{"style":64},[58,417,418],{"style":82},"'@kubb\u002Fplugin-fetch'",[58,420,421,423,425,428,430,432],{"class":60,"style":61},[58,422,65],{"style":64},[58,424,69],{"style":68},[58,426,427],{"style":72},"pluginMsw ",[58,429,76],{"style":68},[58,431,79],{"style":64},[58,433,434],{"style":82},"'@kubb\u002Fplugin-msw'",[58,436,437,439,441,444,446,448],{"class":60,"style":61},[58,438,65],{"style":64},[58,440,69],{"style":68},[58,442,443],{"style":72},"pluginReactQuery ",[58,445,76],{"style":68},[58,447,79],{"style":64},[58,449,450],{"style":82},"'@kubb\u002Fplugin-react-query'",[58,452,453,455,457,460,462,464],{"class":60,"style":61},[58,454,65],{"style":64},[58,456,69],{"style":68},[58,458,459],{"style":72},"pluginTs ",[58,461,76],{"style":68},[58,463,79],{"style":64},[58,465,466],{"style":82},"'@kubb\u002Fplugin-ts'",[58,468,469,471,473,476,478,480],{"class":60,"style":61},[58,470,65],{"style":64},[58,472,69],{"style":68},[58,474,475],{"style":72},"pluginZod ",[58,477,76],{"style":68},[58,479,79],{"style":64},[58,481,482],{"style":82},"'@kubb\u002Fplugin-zod'",[58,484],{"class":60,"style":61},[58,486,487,489,491,493],{"class":60,"style":61},[58,488,91],{"style":64},[58,490,94],{"style":64},[58,492,98],{"style":97},[58,494,101],{"style":68},[58,496,497,499,501,503,505],{"class":60,"style":61},[58,498,106],{"style":68},[58,500,123],{"style":68},[58,502,112],{"style":64},[58,504,128],{"style":82},[58,506,131],{"style":64},[58,508,509,511,513,515,517,520,522,525,527],{"class":60,"style":61},[58,510,106],{"style":64},[58,512,138],{"style":68},[58,514,112],{"style":64},[58,516,69],{"style":68},[58,518,519],{"style":68},"path",[58,521,112],{"style":64},[58,523,524],{"style":82},"'.\u002Fsrc\u002Fgen' ",[58,526,234],{"style":68},[58,528,131],{"style":64},[58,530,531,533,536,538,541,544,547,549,552,554],{"class":60,"style":61},[58,532,106],{"style":64},[58,534,535],{"style":68},"adapter",[58,537,112],{"style":64},[58,539,540],{"style":97},"adapterOas",[58,542,543],{"style":68},"({ ",[58,545,546],{"style":68},"integerType",[58,548,112],{"style":64},[58,550,551],{"style":82},"'number' ",[58,553,349],{"style":68},[58,555,131],{"style":64},[58,557,558,560,563,565],{"class":60,"style":61},[58,559,106],{"style":64},[58,561,562],{"style":68},"plugins",[58,564,112],{"style":64},[58,566,567],{"style":68},"[",[58,569,570,572,575,577,579,581,583,585,587,590,593],{"class":60,"style":61},[58,571,120],{"style":68},[58,573,574],{"style":97},"pluginTs",[58,576,543],{"style":68},[58,578,138],{"style":68},[58,580,112],{"style":64},[58,582,69],{"style":68},[58,584,519],{"style":68},[58,586,112],{"style":64},[58,588,589],{"style":82},"'types.ts' ",[58,591,592],{"style":68},"} })",[58,594,131],{"style":64},[58,596,597,599],{"class":60,"style":61},[58,598,120],{"style":64},[58,600,602],{"style":601},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F The Petstore URL is an example. Use your API's URL.",[58,604,605,607,610,612,615,617,620,622,625,627,630,632],{"class":60,"style":61},[58,606,120],{"style":601},[58,608,609],{"style":97},"pluginFetch",[58,611,543],{"style":68},[58,613,614],{"style":68},"baseURL",[58,616,112],{"style":64},[58,618,619],{"style":82},"'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3'",[58,621,20],{"style":64},[58,623,624],{"style":68},"throwOnErrorDefault",[58,626,112],{"style":64},[58,628,629],{"style":68},"false ",[58,631,349],{"style":68},[58,633,131],{"style":64},[58,635,636,638,641,643,646,648,651,653],{"class":60,"style":61},[58,637,120],{"style":64},[58,639,640],{"style":97},"pluginReactQuery",[58,642,543],{"style":68},[58,644,645],{"style":68},"hooks",[58,647,112],{"style":64},[58,649,650],{"style":68},"true ",[58,652,349],{"style":68},[58,654,131],{"style":64},[58,656,657,659,662,665],{"class":60,"style":61},[58,658,120],{"style":64},[58,660,661],{"style":97},"pluginZod",[58,663,664],{"style":68},"()",[58,666,131],{"style":64},[58,668,669,671,674,676],{"class":60,"style":61},[58,670,120],{"style":64},[58,672,673],{"style":97},"pluginFaker",[58,675,664],{"style":68},[58,677,131],{"style":64},[58,679,680,682,685,687,689,691,693,695,698,700,703,705,708,710,712,714],{"class":60,"style":61},[58,681,120],{"style":64},[58,683,684],{"style":97},"pluginMsw",[58,686,543],{"style":68},[58,688,614],{"style":68},[58,690,112],{"style":64},[58,692,619],{"style":82},[58,694,20],{"style":64},[58,696,697],{"style":68},"parser",[58,699,112],{"style":64},[58,701,702],{"style":82},"'faker'",[58,704,20],{"style":64},[58,706,707],{"style":68},"handlers",[58,709,112],{"style":64},[58,711,650],{"style":68},[58,713,349],{"style":68},[58,715,131],{"style":64},[58,717,718,720,723],{"class":60,"style":61},[58,719,106],{"style":64},[58,721,722],{"style":68},"]",[58,724,131],{"style":64},[58,726,727],{"class":60,"style":61},[58,728,349],{"style":68},[37,730,732],{"id":731},"what-maps-to-what","What maps to what",[734,735,737],"h3",{"id":736},"config-options","Config options",[739,740,741,754],"table",{},[742,743,744],"thead",{},[745,746,747,751],"tr",{},[748,749,750],"th",{},"orval",[748,752,753],{},"Kubb",[755,756,757,773,786,801,818,840,857,871,884],"tbody",{},[745,758,759,765],{},[760,761,762],"td",{},[17,763,764],{},"output.schemas",[760,766,767],{},[768,769,771],"a",{"href":770},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-ts",[17,772,574],{},[745,774,775,779],{},[760,776,777],{},[17,778,23],{},[760,780,781],{},[768,782,784],{"href":783},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch",[17,785,609],{},[745,787,788,793],{},[760,789,790],{},[17,791,792],{},"httpClient: 'axios'",[760,794,795],{},[768,796,798],{"href":797},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-axios",[17,799,800],{},"pluginAxios",[745,802,803,808],{},[760,804,805],{},[17,806,807],{},"output.baseUrl",[760,809,810,815,816],{},[768,811,813],{"href":812},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch\u002Foptions#baseurl",[17,814,614],{}," on ",[17,817,609],{},[745,819,820,825],{},[760,821,822],{},[17,823,824],{},"mode: 'tags-split'",[760,826,827,833,834,836,837,839],{},[768,828,830],{"href":829},"\u002Fdocs\u002F5.x\u002Freference\u002Fplugin-options#group",[17,831,832],{},"group: { type: 'tag' }"," on each plugin. It needs directory output, so remove the ",[17,835,138],{}," option from ",[17,838,574],{}," first",[745,841,842,848],{},[760,843,844,845],{},"A custom ",[17,846,847],{},"mutator",[760,849,850,853,854],{},[17,851,852],{},"client.setConfig()"," and ",[17,855,856],{},"client.interceptors",[745,858,859,863],{},[760,860,861],{},[17,862,19],{},[760,864,865],{},[768,866,868],{"href":867},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query\u002Foptions#hooks",[17,869,870],{},"pluginReactQuery({ hooks: true })",[745,872,873,877],{},[760,874,875],{},[17,876,30],{},[760,878,879],{},[768,880,882],{"href":881},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-zod",[17,883,661],{},[745,885,886,890],{},[760,887,888],{},[17,889,26],{},[760,891,892,853,897],{},[768,893,895],{"href":894},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw",[17,896,684],{},[768,898,900],{"href":899},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-faker",[17,901,673],{},[734,903,905],{"id":904},"generated-code","Generated code",[739,907,908,916],{},[742,909,910],{},[745,911,912,914],{},[748,913,750],{},[748,915,753],{},[755,917,918,936,951,963,975,987,1000,1012,1023],{},[745,919,920,929],{},[760,921,922,925,926],{},[17,923,924],{},"Pet"," from ",[17,927,928],{},".\u002Fapi\u002Fmodel",[760,930,931,925,933],{},[17,932,924],{},[17,934,935],{},".\u002Fgen\u002Ftypes",[745,937,938,943],{},[760,939,940],{},[17,941,942],{},"PetStatus",[760,944,945,853,948],{},[17,946,947],{},"petStatusEnum",[17,949,950],{},"PetStatusEnumKey",[745,952,953,958],{},[760,954,955],{},[17,956,957],{},"getPetById(1)",[760,959,960],{},[17,961,962],{},"getPetById({ path: { petId: 1 } })",[745,964,965,970],{},[760,966,967],{},[17,968,969],{},"useGetPetById(1)",[760,971,972],{},[17,973,974],{},"useGetPetById({ path: { petId: 1 } })",[745,976,977,982],{},[760,978,979],{},[17,980,981],{},"mutate({ data: pet })",[760,983,984],{},[17,985,986],{},"mutate({ body: pet })",[745,988,989,995],{},[760,990,991,994],{},[17,992,993],{},"GetPetByIdResponse"," (Zod)",[760,996,997],{},[17,998,999],{},"petSchema",[745,1001,1002,1007],{},[760,1003,1004],{},[17,1005,1006],{},"getGetPetByIdMockHandler()",[760,1008,1009],{},[17,1010,1011],{},"getPetByIdHandler()",[745,1013,1014,1019],{},[760,1015,1016],{},[17,1017,1018],{},"getPetMock()",[760,1020,1021],{},[17,1022,707],{},[745,1024,1025,1030],{},[760,1026,1027],{},[17,1028,1029],{},"getGetPetByIdResponseMock()",[760,1031,1032],{},[17,1033,1034],{},"createPet()",[1036,1037,1039,1043,1065,1213,1220,1343,1361,1449,1458,1585,1588,1592,1599,1677,1692,1782,1802,2056,2070,2126,2133,2137,2160,2235,2249,2270,2276,2311,2544,2548,2569,2644,2653,2806,2810,2827,2926,2939,3042,3047,3312,3322,3326],"steps",{"level":1038},"2",[37,1040,1042],{"id":1041},"generate-the-types","Generate the types",[10,1044,1045,1046,1049,1050,1053,1054,1057,1058,1061,1062,35],{},"Create this config. It writes every type into ",[17,1047,1048],{},"src\u002Fgen\u002Ftypes.ts",". ",[17,1051,1052],{},"integerType: 'number'"," keeps ",[17,1055,1056],{},"int64"," as ",[17,1059,1060],{},"number",", as orval does. Kubb's default is ",[17,1063,1064],{},"bigint",[48,1066,1068],{"language":50,"filename":352,"code":1067,"class":53},"import { defineConfig } from 'kubb\u002Fconfig'\nimport { adapterOas } from '@kubb\u002Fadapter-oas'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\n\nexport default defineConfig({\n  input: '.\u002Fopenapi.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen' },\n  adapter: adapterOas({ integerType: 'number' }),\n  plugins: [pluginTs({ output: { path: 'types.ts' } })],\n})",[17,1069,1070,84,1084,84,1098,84,1112,84,1114,84,1124,84,1136,84,1156,84,1178,84,1209],{"class":56},[58,1071,1072,1074,1076,1078,1080,1082],{"class":60,"style":61},[58,1073,65],{"style":64},[58,1075,69],{"style":68},[58,1077,73],{"style":72},[58,1079,76],{"style":68},[58,1081,79],{"style":64},[58,1083,370],{"style":82},[58,1085,1086,1088,1090,1092,1094,1096],{"class":60,"style":61},[58,1087,65],{"style":64},[58,1089,69],{"style":68},[58,1091,379],{"style":72},[58,1093,76],{"style":68},[58,1095,79],{"style":64},[58,1097,386],{"style":82},[58,1099,1100,1102,1104,1106,1108,1110],{"class":60,"style":61},[58,1101,65],{"style":64},[58,1103,69],{"style":68},[58,1105,459],{"style":72},[58,1107,76],{"style":68},[58,1109,79],{"style":64},[58,1111,466],{"style":82},[58,1113],{"class":60,"style":61},[58,1115,1116,1118,1120,1122],{"class":60,"style":61},[58,1117,91],{"style":64},[58,1119,94],{"style":64},[58,1121,98],{"style":97},[58,1123,101],{"style":68},[58,1125,1126,1128,1130,1132,1134],{"class":60,"style":61},[58,1127,106],{"style":68},[58,1129,123],{"style":68},[58,1131,112],{"style":64},[58,1133,128],{"style":82},[58,1135,131],{"style":64},[58,1137,1138,1140,1142,1144,1146,1148,1150,1152,1154],{"class":60,"style":61},[58,1139,106],{"style":64},[58,1141,138],{"style":68},[58,1143,112],{"style":64},[58,1145,69],{"style":68},[58,1147,519],{"style":68},[58,1149,112],{"style":64},[58,1151,524],{"style":82},[58,1153,234],{"style":68},[58,1155,131],{"style":64},[58,1157,1158,1160,1162,1164,1166,1168,1170,1172,1174,1176],{"class":60,"style":61},[58,1159,106],{"style":64},[58,1161,535],{"style":68},[58,1163,112],{"style":64},[58,1165,540],{"style":97},[58,1167,543],{"style":68},[58,1169,546],{"style":68},[58,1171,112],{"style":64},[58,1173,551],{"style":82},[58,1175,349],{"style":68},[58,1177,131],{"style":64},[58,1179,1180,1182,1184,1186,1188,1190,1192,1194,1196,1198,1200,1202,1204,1207],{"class":60,"style":61},[58,1181,106],{"style":64},[58,1183,562],{"style":68},[58,1185,112],{"style":64},[58,1187,567],{"style":68},[58,1189,574],{"style":97},[58,1191,543],{"style":68},[58,1193,138],{"style":68},[58,1195,112],{"style":64},[58,1197,69],{"style":68},[58,1199,519],{"style":68},[58,1201,112],{"style":64},[58,1203,589],{"style":82},[58,1205,1206],{"style":68},"} })]",[58,1208,131],{"style":64},[58,1210,1211],{"class":60,"style":61},[58,1212,349],{"style":68},[10,1214,1215,1216,1219],{},"Install the packages it imports. ",[17,1217,1218],{},"kubb add"," needs the config to exist, and leaves a plugin that is already in it unchanged:",[45,1221,1223,1254,1279,1300,1321],{"sync":1222},"package-manager",[48,1224,1228],{"language":1225,"filename":1226,"code":1227,"class":53},"shell","kubb","npm install -D kubb\nkubb add adapter-oas\nkubb add plugin-ts",[17,1229,1231,84,1239,84,1247],{"class":1230},"language-shell",[58,1232,1233,1236],{"class":60,"style":61},[58,1234,1235],{"style":97},"npm ",[58,1237,1238],{"style":72},"install -D kubb",[58,1240,1241,1244],{"class":60,"style":61},[58,1242,1243],{"style":97},"kubb ",[58,1245,1246],{"style":72},"add adapter-oas",[58,1248,1249,1251],{"class":60,"style":61},[58,1250,1243],{"style":97},[58,1252,1253],{"style":72},"add plugin-ts",[48,1255,1258],{"language":1225,"filename":1256,"code":1257,"class":53},"pnpm","pnpm add -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[17,1259,1260],{"class":1230},[58,1261,1262,1265,1268,1271,1274,1276],{"class":60,"style":61},[58,1263,1264],{"style":97},"pnpm ",[58,1266,1267],{"style":72},"add -D kubb ",[58,1269,1270],{"style":72},"@",[58,1272,1273],{"style":72},"kubb\u002Fadapter-oas ",[58,1275,1270],{"style":72},[58,1277,1278],{"style":72},"kubb\u002Fplugin-ts",[48,1280,1283],{"language":1225,"filename":1281,"code":1282,"class":53},"npm","npm install -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[17,1284,1285],{"class":1230},[58,1286,1287,1289,1292,1294,1296,1298],{"class":60,"style":61},[58,1288,1235],{"style":97},[58,1290,1291],{"style":72},"install -D kubb ",[58,1293,1270],{"style":72},[58,1295,1273],{"style":72},[58,1297,1270],{"style":72},[58,1299,1278],{"style":72},[48,1301,1304],{"language":1225,"filename":1302,"code":1303,"class":53},"yarn","yarn add -D kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[17,1305,1306],{"class":1230},[58,1307,1308,1311,1313,1315,1317,1319],{"class":60,"style":61},[58,1309,1310],{"style":97},"yarn ",[58,1312,1267],{"style":72},[58,1314,1270],{"style":72},[58,1316,1273],{"style":72},[58,1318,1270],{"style":72},[58,1320,1278],{"style":72},[48,1322,1325],{"language":1225,"filename":1323,"code":1324,"class":53},"bun","bun add -d kubb @kubb\u002Fadapter-oas @kubb\u002Fplugin-ts",[17,1326,1327],{"class":1230},[58,1328,1329,1332,1335,1337,1339,1341],{"class":60,"style":61},[58,1330,1331],{"style":97},"bun ",[58,1333,1334],{"style":72},"add -d kubb ",[58,1336,1270],{"style":72},[58,1338,1273],{"style":72},[58,1340,1270],{"style":72},[58,1342,1278],{"style":72},[10,1344,1345,1346,1349,1350,1353,1354,1356,1357,1360],{},"Change your ",[17,1347,1348],{},"generate"," script to ",[17,1351,1352],{},"kubb generate"," and run it. Leave ",[17,1355,34],{}," in place until the last step, because the rest of the app still imports it. Those files stop following the spec once orval no longer runs. If you pause before the last step, use ",[17,1358,1359],{},"orval && kubb generate"," as the script:",[45,1362,1363,1408],{},[48,1364,1368],{"language":1365,"filename":1366,"code":1367,"class":53},"json","Before","{\n  \"scripts\": {\n    \"generate\": \"orval\"\n  }\n}",[17,1369,1371,84,1375,84,1386,84,1398,84,1404],{"class":1370},"language-json",[58,1372,1373],{"class":60,"style":61},[58,1374,115],{"style":68},[58,1376,1377,1379,1382,1384],{"class":60,"style":61},[58,1378,106],{"style":68},[58,1380,1381],{"style":68},"\"scripts\"",[58,1383,112],{"style":64},[58,1385,115],{"style":68},[58,1387,1388,1390,1393,1395],{"class":60,"style":61},[58,1389,120],{"style":68},[58,1391,1392],{"style":68},"\"generate\"",[58,1394,112],{"style":64},[58,1396,1397],{"style":82},"\"orval\"",[58,1399,1400,1402],{"class":60,"style":61},[58,1401,106],{"style":82},[58,1403,234],{"style":68},[58,1405,1406],{"class":60,"style":61},[58,1407,234],{"style":68},[48,1409,1412],{"language":1365,"filename":1410,"code":1411,"class":53},"After","{\n  \"scripts\": {\n    \"generate\": \"kubb generate\"\n  }\n}",[17,1413,1414,84,1418,84,1428,84,1439,84,1445],{"class":1370},[58,1415,1416],{"class":60,"style":61},[58,1417,115],{"style":68},[58,1419,1420,1422,1424,1426],{"class":60,"style":61},[58,1421,106],{"style":68},[58,1423,1381],{"style":68},[58,1425,112],{"style":64},[58,1427,115],{"style":68},[58,1429,1430,1432,1434,1436],{"class":60,"style":61},[58,1431,120],{"style":68},[58,1433,1392],{"style":68},[58,1435,112],{"style":64},[58,1437,1438],{"style":82},"\"kubb generate\"",[58,1440,1441,1443],{"class":60,"style":61},[58,1442,106],{"style":82},[58,1444,234],{"style":68},[58,1446,1447],{"class":60,"style":61},[58,1448,234],{"style":68},[10,1450,1451,1452,1454,1455,1457],{},"Then replace the model imports. Kubb names an enum's values ",[17,1453,947],{}," and its type ",[17,1456,950],{},":",[45,1459,1460,1523],{},[48,1461,1463],{"language":50,"filename":750,"code":1462,"class":53},"import type { Pet } from '.\u002Fapi\u002Fmodel'\nimport { PetStatus } from '.\u002Fapi\u002Fmodel'\n\nconst status: PetStatus = PetStatus.available",[17,1464,1465,84,1484,84,1499,84,1501],{"class":56},[58,1466,1467,1469,1472,1474,1477,1479,1481],{"class":60,"style":61},[58,1468,65],{"style":64},[58,1470,1471],{"style":72},"type ",[58,1473,69],{"style":68},[58,1475,1476],{"style":97},"Pet ",[58,1478,76],{"style":68},[58,1480,79],{"style":64},[58,1482,1483],{"style":82},"'.\u002Fapi\u002Fmodel'",[58,1485,1486,1488,1490,1493,1495,1497],{"class":60,"style":61},[58,1487,65],{"style":64},[58,1489,69],{"style":68},[58,1491,1492],{"style":97},"PetStatus ",[58,1494,76],{"style":68},[58,1496,79],{"style":64},[58,1498,1483],{"style":82},[58,1500],{"class":60,"style":61},[58,1502,1503,1506,1509,1511,1513,1516,1518,1520],{"class":60,"style":61},[58,1504,1505],{"style":64},"const ",[58,1507,1508],{"style":72},"status",[58,1510,112],{"style":72},[58,1512,1492],{"style":97},[58,1514,1515],{"style":64},"= ",[58,1517,942],{"style":97},[58,1519,35],{"style":64},[58,1521,1522],{"style":68},"available",[48,1524,1526],{"language":50,"filename":753,"code":1525,"class":53},"import type { Pet, PetStatusEnumKey } from '.\u002Fgen\u002Ftypes'\nimport { petStatusEnum } from '.\u002Fgen\u002Ftypes'\n\nconst status: PetStatusEnumKey = petStatusEnum.available",[17,1527,1528,84,1550,84,1565,84,1567],{"class":56},[58,1529,1530,1532,1534,1536,1538,1540,1543,1545,1547],{"class":60,"style":61},[58,1531,65],{"style":64},[58,1533,1471],{"style":72},[58,1535,69],{"style":68},[58,1537,924],{"style":97},[58,1539,20],{"style":64},[58,1541,1542],{"style":97},"PetStatusEnumKey ",[58,1544,76],{"style":68},[58,1546,79],{"style":64},[58,1548,1549],{"style":82},"'.\u002Fgen\u002Ftypes'",[58,1551,1552,1554,1556,1559,1561,1563],{"class":60,"style":61},[58,1553,65],{"style":64},[58,1555,69],{"style":68},[58,1557,1558],{"style":72},"petStatusEnum ",[58,1560,76],{"style":68},[58,1562,79],{"style":64},[58,1564,1549],{"style":82},[58,1566],{"class":60,"style":61},[58,1568,1569,1571,1573,1575,1577,1579,1581,1583],{"class":60,"style":61},[58,1570,1505],{"style":64},[58,1572,1508],{"style":72},[58,1574,112],{"style":72},[58,1576,1542],{"style":97},[58,1578,1515],{"style":64},[58,1580,947],{"style":72},[58,1582,35],{"style":64},[58,1584,1522],{"style":68},[10,1586,1587],{},"Run your type check and fix the imports it reports.",[37,1589,1591],{"id":1590},"replace-the-client","Replace the client",[10,1593,1594,1595,1598],{},"Add ",[17,1596,1597],{},"@kubb\u002Fplugin-fetch",". It writes one function per operation, and the app needs no client package:",[45,1600,1601,1613,1630,1646,1661],{"sync":1222},[48,1602,1604],{"language":1225,"filename":1226,"code":1603,"class":53},"kubb add plugin-fetch",[17,1605,1606],{"class":1230},[58,1607,1608,1610],{"class":60,"style":61},[58,1609,1243],{"style":97},[58,1611,1612],{"style":72},"add plugin-fetch",[48,1614,1616],{"language":1225,"filename":1256,"code":1615,"class":53},"pnpm add -D @kubb\u002Fplugin-fetch",[17,1617,1618],{"class":1230},[58,1619,1620,1622,1625,1627],{"class":60,"style":61},[58,1621,1264],{"style":97},[58,1623,1624],{"style":72},"add -D ",[58,1626,1270],{"style":72},[58,1628,1629],{"style":72},"kubb\u002Fplugin-fetch",[48,1631,1633],{"language":1225,"filename":1281,"code":1632,"class":53},"npm install -D @kubb\u002Fplugin-fetch",[17,1634,1635],{"class":1230},[58,1636,1637,1639,1642,1644],{"class":60,"style":61},[58,1638,1235],{"style":97},[58,1640,1641],{"style":72},"install -D ",[58,1643,1270],{"style":72},[58,1645,1629],{"style":72},[48,1647,1649],{"language":1225,"filename":1302,"code":1648,"class":53},"yarn add -D @kubb\u002Fplugin-fetch",[17,1650,1651],{"class":1230},[58,1652,1653,1655,1657,1659],{"class":60,"style":61},[58,1654,1310],{"style":97},[58,1656,1624],{"style":72},[58,1658,1270],{"style":72},[58,1660,1629],{"style":72},[48,1662,1664],{"language":1225,"filename":1323,"code":1663,"class":53},"bun add -d @kubb\u002Fplugin-fetch",[17,1665,1666],{"class":1230},[58,1667,1668,1670,1673,1675],{"class":60,"style":61},[58,1669,1331],{"style":97},[58,1671,1672],{"style":72},"add -d ",[58,1674,1270],{"style":72},[58,1676,1629],{"style":72},[10,1678,1679,1681,1682,1685,1686,1688,1689,1691],{},[17,1680,1218],{}," adds ",[17,1683,1684],{},"pluginFetch()"," to ",[17,1687,562],{},". With a package manager, add the import and the plugin yourself. Then set its options, with your API's URL as ",[17,1690,614],{},". The Petstore URL is an example:",[48,1693,1695],{"language":50,"filename":352,"code":1694,"class":53},"import { pluginFetch } from '@kubb\u002Fplugin-fetch'\n\n\u002F\u002F ...\nplugins: [\n  pluginTs({ output: { path: 'types.ts' } }),\n  pluginFetch({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', throwOnErrorDefault: false }),\n],",[17,1696,1697,84,1711,84,1713,84,1718,84,1726,84,1750,84,1776],{"class":56},[58,1698,1699,1701,1703,1705,1707,1709],{"class":60,"style":61},[58,1700,65],{"style":64},[58,1702,69],{"style":68},[58,1704,411],{"style":72},[58,1706,76],{"style":68},[58,1708,79],{"style":64},[58,1710,418],{"style":82},[58,1712],{"class":60,"style":61},[58,1714,1715],{"class":60,"style":61},[58,1716,1717],{"style":601},"\u002F\u002F ...",[58,1719,1720,1722,1724],{"class":60,"style":61},[58,1721,562],{"style":72},[58,1723,112],{"style":64},[58,1725,567],{"style":68},[58,1727,1728,1730,1732,1734,1736,1738,1740,1742,1744,1746,1748],{"class":60,"style":61},[58,1729,106],{"style":68},[58,1731,574],{"style":97},[58,1733,543],{"style":68},[58,1735,138],{"style":68},[58,1737,112],{"style":64},[58,1739,69],{"style":68},[58,1741,519],{"style":68},[58,1743,112],{"style":64},[58,1745,589],{"style":82},[58,1747,592],{"style":68},[58,1749,131],{"style":64},[58,1751,1752,1754,1756,1758,1760,1762,1764,1766,1768,1770,1772,1774],{"class":60,"style":61},[58,1753,106],{"style":64},[58,1755,609],{"style":97},[58,1757,543],{"style":68},[58,1759,614],{"style":68},[58,1761,112],{"style":64},[58,1763,619],{"style":82},[58,1765,20],{"style":64},[58,1767,624],{"style":68},[58,1769,112],{"style":64},[58,1771,629],{"style":68},[58,1773,349],{"style":68},[58,1775,131],{"style":64},[58,1777,1778,1780],{"class":60,"style":61},[58,1779,722],{"style":68},[58,1781,131],{"style":64},[10,1783,1784,1787,1788,1791,1792,1795,1796,1798,1799,1801],{},[17,1785,1786],{},"throwOnErrorDefault: false"," keeps the behavior of orval's fetch client: an error status resolves instead of throwing. orval puts the error body in ",[17,1789,1790],{},"data",". Kubb puts it in ",[17,1793,1794],{},"error"," and leaves ",[17,1797,1790],{}," undefined. Run ",[17,1800,1352],{},", then replace each call:",[45,1803,1804,1898],{},[48,1805,1807],{"language":50,"filename":750,"code":1806,"class":53},"import { getPetById } from '.\u002Fapi\u002Fpet\u002Fpet'\n\nconst { data, status } = await getPetById(1, {\n  headers: { Authorization: `Bearer ${token}` },\n})",[17,1808,1809,84,1825,84,1827,84,1860,84,1894],{"class":56},[58,1810,1811,1813,1815,1818,1820,1822],{"class":60,"style":61},[58,1812,65],{"style":64},[58,1814,69],{"style":68},[58,1816,1817],{"style":72},"getPetById ",[58,1819,76],{"style":68},[58,1821,79],{"style":64},[58,1823,1824],{"style":82},"'.\u002Fapi\u002Fpet\u002Fpet'",[58,1826],{"class":60,"style":61},[58,1828,1829,1831,1833,1835,1837,1840,1842,1844,1847,1850,1853,1856,1858],{"class":60,"style":61},[58,1830,1505],{"style":64},[58,1832,69],{"style":68},[58,1834,1790],{"style":72},[58,1836,20],{"style":64},[58,1838,1839],{"style":72},"status ",[58,1841,76],{"style":68},[58,1843,1515],{"style":64},[58,1845,1846],{"style":64},"await ",[58,1848,1849],{"style":97},"getPetById",[58,1851,1852],{"style":68},"(",[58,1854,1855],{"style":68},"1",[58,1857,20],{"style":64},[58,1859,115],{"style":68},[58,1861,1862,1864,1867,1869,1871,1874,1876,1879,1882,1885,1887,1890,1892],{"class":60,"style":61},[58,1863,106],{"style":68},[58,1865,1866],{"style":68},"headers",[58,1868,112],{"style":64},[58,1870,69],{"style":68},[58,1872,1873],{"style":68},"Authorization",[58,1875,112],{"style":64},[58,1877,1878],{"style":82},"`Bearer ",[58,1880,1881],{"style":72},"${",[58,1883,1884],{"style":72},"token",[58,1886,234],{"style":72},[58,1888,1889],{"style":82},"` ",[58,1891,234],{"style":68},[58,1893,131],{"style":64},[58,1895,1896],{"class":60,"style":61},[58,1897,349],{"style":68},[48,1899,1901],{"language":50,"filename":753,"code":1900,"class":53},"import { client } from '.\u002Fgen\u002F.kubb\u002Fclient'\nimport { getPetById } from '.\u002Fgen\u002Fclients\u002FgetPetById'\n\nclient.interceptors.request.use((request) => {\n  request.headers['Authorization'] = `Bearer ${token}`\n  return request\n})\n\nconst { data, error, status } = await getPetById({ path: { petId: 1 } })",[17,1902,1903,84,1919,84,1934,84,1936,84,1968,84,1999,84,2008,84,2012,84,2014],{"class":56},[58,1904,1905,1907,1909,1912,1914,1916],{"class":60,"style":61},[58,1906,65],{"style":64},[58,1908,69],{"style":68},[58,1910,1911],{"style":72},"client ",[58,1913,76],{"style":68},[58,1915,79],{"style":64},[58,1917,1918],{"style":82},"'.\u002Fgen\u002F.kubb\u002Fclient'",[58,1920,1921,1923,1925,1927,1929,1931],{"class":60,"style":61},[58,1922,65],{"style":64},[58,1924,69],{"style":68},[58,1926,1817],{"style":72},[58,1928,76],{"style":68},[58,1930,79],{"style":64},[58,1932,1933],{"style":82},"'.\u002Fgen\u002Fclients\u002FgetPetById'",[58,1935],{"class":60,"style":61},[58,1937,1938,1940,1942,1945,1947,1950,1952,1955,1958,1960,1963,1966],{"class":60,"style":61},[58,1939,192],{"style":72},[58,1941,35],{"style":64},[58,1943,1944],{"style":68},"interceptors",[58,1946,35],{"style":64},[58,1948,1949],{"style":68},"request",[58,1951,35],{"style":64},[58,1953,1954],{"style":97},"use",[58,1956,1957],{"style":68},"((",[58,1959,1949],{"style":72},[58,1961,1962],{"style":68},") ",[58,1964,1965],{"style":64},"=> ",[58,1967,115],{"style":68},[58,1969,1970,1972,1974,1976,1978,1980,1983,1986,1988,1990,1992,1994,1996],{"class":60,"style":61},[58,1971,106],{"style":68},[58,1973,1949],{"style":72},[58,1975,35],{"style":64},[58,1977,1866],{"style":68},[58,1979,567],{"style":68},[58,1981,1982],{"style":82},"'Authorization'",[58,1984,1985],{"style":68},"] ",[58,1987,1515],{"style":64},[58,1989,1878],{"style":82},[58,1991,1881],{"style":72},[58,1993,1884],{"style":72},[58,1995,234],{"style":72},[58,1997,1998],{"style":82},"`",[58,2000,2001,2003,2006],{"class":60,"style":61},[58,2002,106],{"style":82},[58,2004,2005],{"style":64},"return ",[58,2007,1949],{"style":72},[58,2009,2010],{"class":60,"style":61},[58,2011,349],{"style":68},[58,2013],{"class":60,"style":61},[58,2015,2016,2018,2020,2022,2024,2026,2028,2030,2032,2034,2036,2038,2040,2042,2044,2046,2049,2051,2054],{"class":60,"style":61},[58,2017,1505],{"style":64},[58,2019,69],{"style":68},[58,2021,1790],{"style":72},[58,2023,20],{"style":64},[58,2025,1794],{"style":72},[58,2027,20],{"style":64},[58,2029,1839],{"style":72},[58,2031,76],{"style":68},[58,2033,1515],{"style":64},[58,2035,1846],{"style":64},[58,2037,1849],{"style":97},[58,2039,543],{"style":68},[58,2041,519],{"style":68},[58,2043,112],{"style":64},[58,2045,69],{"style":68},[58,2047,2048],{"style":68},"petId",[58,2050,112],{"style":64},[58,2052,2053],{"style":68},"1 ",[58,2055,592],{"style":68},[10,2057,2058,2059,2061,2062,2065,2066,2069],{},"The interceptor sends the header on every request, like a custom ",[17,2060,847],{}," that sets it. To send a credential only to operations that declare a security scheme, set ",[17,2063,2064],{},"auth"," instead. It gets each scheme, and its return value goes where that scheme says, such as the ",[17,2067,2068],{},"api_key"," header:",[48,2071,2073],{"language":50,"code":2072,"class":53},"client.setConfig({ auth: (scheme) => (scheme.type === 'apiKey' ? apiKey : token) })",[17,2074,2075],{"class":56},[58,2076,2077,2079,2081,2084,2086,2088,2090,2092,2095,2097,2099,2101,2103,2105,2107,2110,2113,2116,2119,2121,2123],{"class":60,"style":61},[58,2078,192],{"style":72},[58,2080,35],{"style":64},[58,2082,2083],{"style":97},"setConfig",[58,2085,543],{"style":68},[58,2087,2064],{"style":68},[58,2089,112],{"style":64},[58,2091,1852],{"style":68},[58,2093,2094],{"style":72},"scheme",[58,2096,1962],{"style":68},[58,2098,1965],{"style":64},[58,2100,1852],{"style":68},[58,2102,2094],{"style":72},[58,2104,35],{"style":64},[58,2106,1471],{"style":68},[58,2108,2109],{"style":64},"=== ",[58,2111,2112],{"style":82},"'apiKey' ",[58,2114,2115],{"style":64},"? ",[58,2117,2118],{"style":72},"apiKey ",[58,2120,112],{"style":64},[58,2122,1884],{"style":72},[58,2124,2125],{"style":68},") })",[10,2127,2128,2132],{},[768,2129,2131],{"href":2130},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-fetch\u002Fguides\u002Fconfigure-requests","Configure requests"," covers both.",[37,2134,2136],{"id":2135},"replace-the-query-hooks","Replace the query hooks",[10,2138,1594,2139,2145,2146,925,2148,2150,2151,2154,2155,2157,2158,1457],{},[768,2140,2142],{"href":2141},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-react-query",[17,2143,2144],{},"@kubb\u002Fplugin-react-query",". With a package manager, also import ",[17,2147,640],{},[17,2149,2144],{}," and add ",[17,2152,2153],{},"pluginReactQuery()"," after ",[17,2156,609],{}," in ",[17,2159,562],{},[45,2161,2162,2174,2190,2205,2220],{"sync":1222},[48,2163,2165],{"language":1225,"filename":1226,"code":2164,"class":53},"kubb add plugin-react-query",[17,2166,2167],{"class":1230},[58,2168,2169,2171],{"class":60,"style":61},[58,2170,1243],{"style":97},[58,2172,2173],{"style":72},"add plugin-react-query",[48,2175,2177],{"language":1225,"filename":1256,"code":2176,"class":53},"pnpm add -D @kubb\u002Fplugin-react-query",[17,2178,2179],{"class":1230},[58,2180,2181,2183,2185,2187],{"class":60,"style":61},[58,2182,1264],{"style":97},[58,2184,1624],{"style":72},[58,2186,1270],{"style":72},[58,2188,2189],{"style":72},"kubb\u002Fplugin-react-query",[48,2191,2193],{"language":1225,"filename":1281,"code":2192,"class":53},"npm install -D @kubb\u002Fplugin-react-query",[17,2194,2195],{"class":1230},[58,2196,2197,2199,2201,2203],{"class":60,"style":61},[58,2198,1235],{"style":97},[58,2200,1641],{"style":72},[58,2202,1270],{"style":72},[58,2204,2189],{"style":72},[48,2206,2208],{"language":1225,"filename":1302,"code":2207,"class":53},"yarn add -D @kubb\u002Fplugin-react-query",[17,2209,2210],{"class":1230},[58,2211,2212,2214,2216,2218],{"class":60,"style":61},[58,2213,1310],{"style":97},[58,2215,1624],{"style":72},[58,2217,1270],{"style":72},[58,2219,2189],{"style":72},[48,2221,2223],{"language":1225,"filename":1323,"code":2222,"class":53},"bun add -d @kubb\u002Fplugin-react-query",[17,2224,2225],{"class":1230},[58,2226,2227,2229,2231,2233],{"class":60,"style":61},[58,2228,1331],{"style":97},[58,2230,1672],{"style":72},[58,2232,1270],{"style":72},[58,2234,2189],{"style":72},[10,2236,2237,2238,2241,2242,853,2245,2248],{},"Set ",[17,2239,2240],{},"hooks: true"," to get ",[17,2243,2244],{},"useGetPetById",[17,2246,2247],{},"useAddPet",", as orval writes them. Without it, the plugin writes only the query and mutation options:",[48,2250,2252],{"language":50,"filename":352,"code":2251,"class":53},"pluginReactQuery({ hooks: true }),",[17,2253,2254],{"class":56},[58,2255,2256,2258,2260,2262,2264,2266,2268],{"class":60,"style":61},[58,2257,640],{"style":97},[58,2259,543],{"style":68},[58,2261,645],{"style":68},[58,2263,112],{"style":64},[58,2265,650],{"style":68},[58,2267,349],{"style":68},[58,2269,131],{"style":64},[10,2271,2272,2273,2275],{},"Run ",[17,2274,1352],{},", then replace each hook. Two things differ from hooks on orval's fetch client:",[2277,2278,2279,2289],"ul",{},[2280,2281,2282,2283,2285,2286,35],"li",{},"A hook's ",[17,2284,1790],{}," holds the response body, not ",[17,2287,2288],{},"{ data, status, headers }",[2280,2290,2291,2292,2294,2295,2298,2299,2301,2302,2304,2305,2307,2308,2310],{},"An error status goes to the hook's ",[17,2293,1794],{}," and to ",[17,2296,2297],{},"onError",", whatever ",[17,2300,624],{}," says. With orval it resolves as ",[17,2303,1790],{},", so move any ",[17,2306,1508],{}," check on ",[17,2309,1790],{}," there.",[45,2312,2313,2427],{},[48,2314,2316],{"language":50,"filename":750,"code":2315,"class":53},"import { useAddPet, useGetPetById } from '.\u002Fapi\u002Fpet\u002Fpet'\n\nconst { data } = useGetPetById(1)\nconst pet = data?.data\n\nconst { mutate } = useAddPet()\nmutate({ data: { name: 'Rex', photoUrls: [] } })",[17,2317,2318,84,2337,84,2339,84,2361,84,2377,84,2379,84,2396],{"class":56},[58,2319,2320,2322,2324,2326,2328,2331,2333,2335],{"class":60,"style":61},[58,2321,65],{"style":64},[58,2323,69],{"style":68},[58,2325,2247],{"style":72},[58,2327,20],{"style":64},[58,2329,2330],{"style":72},"useGetPetById ",[58,2332,76],{"style":68},[58,2334,79],{"style":64},[58,2336,1824],{"style":82},[58,2338],{"class":60,"style":61},[58,2340,2341,2343,2345,2348,2350,2352,2354,2356,2358],{"class":60,"style":61},[58,2342,1505],{"style":64},[58,2344,69],{"style":68},[58,2346,2347],{"style":72},"data ",[58,2349,76],{"style":68},[58,2351,1515],{"style":64},[58,2353,2244],{"style":97},[58,2355,1852],{"style":68},[58,2357,1855],{"style":68},[58,2359,2360],{"style":68},")",[58,2362,2363,2365,2368,2370,2372,2375],{"class":60,"style":61},[58,2364,1505],{"style":64},[58,2366,2367],{"style":72},"pet ",[58,2369,1515],{"style":64},[58,2371,1790],{"style":72},[58,2373,2374],{"style":64},"?.",[58,2376,1790],{"style":68},[58,2378],{"class":60,"style":61},[58,2380,2381,2383,2385,2388,2390,2392,2394],{"class":60,"style":61},[58,2382,1505],{"style":64},[58,2384,69],{"style":68},[58,2386,2387],{"style":72},"mutate ",[58,2389,76],{"style":68},[58,2391,1515],{"style":64},[58,2393,2247],{"style":97},[58,2395,664],{"style":68},[58,2397,2398,2401,2403,2405,2407,2409,2412,2414,2417,2419,2422,2424],{"class":60,"style":61},[58,2399,2400],{"style":97},"mutate",[58,2402,543],{"style":68},[58,2404,1790],{"style":68},[58,2406,112],{"style":64},[58,2408,69],{"style":68},[58,2410,2411],{"style":68},"name",[58,2413,112],{"style":64},[58,2415,2416],{"style":82},"'Rex'",[58,2418,20],{"style":64},[58,2420,2421],{"style":68},"photoUrls",[58,2423,112],{"style":64},[58,2425,2426],{"style":68},"[] } })",[48,2428,2430],{"language":50,"filename":753,"code":2429,"class":53},"import { useAddPet } from '.\u002Fgen\u002Fhooks\u002FuseAddPet'\nimport { useGetPetById } from '.\u002Fgen\u002Fhooks\u002FuseGetPetById'\n\nconst { data: pet } = useGetPetById({ path: { petId: 1 } })\n\nconst { mutate } = useAddPet()\nmutate({ body: { name: 'Rex', photoUrls: [] } })",[17,2431,2432,84,2448,84,2463,84,2465,84,2499,84,2501,84,2517],{"class":56},[58,2433,2434,2436,2438,2441,2443,2445],{"class":60,"style":61},[58,2435,65],{"style":64},[58,2437,69],{"style":68},[58,2439,2440],{"style":72},"useAddPet ",[58,2442,76],{"style":68},[58,2444,79],{"style":64},[58,2446,2447],{"style":82},"'.\u002Fgen\u002Fhooks\u002FuseAddPet'",[58,2449,2450,2452,2454,2456,2458,2460],{"class":60,"style":61},[58,2451,65],{"style":64},[58,2453,69],{"style":68},[58,2455,2330],{"style":72},[58,2457,76],{"style":68},[58,2459,79],{"style":64},[58,2461,2462],{"style":82},"'.\u002Fgen\u002Fhooks\u002FuseGetPetById'",[58,2464],{"class":60,"style":61},[58,2466,2467,2469,2471,2473,2475,2477,2479,2481,2483,2485,2487,2489,2491,2493,2495,2497],{"class":60,"style":61},[58,2468,1505],{"style":64},[58,2470,69],{"style":68},[58,2472,1790],{"style":68},[58,2474,112],{"style":64},[58,2476,2367],{"style":72},[58,2478,76],{"style":68},[58,2480,1515],{"style":64},[58,2482,2244],{"style":97},[58,2484,543],{"style":68},[58,2486,519],{"style":68},[58,2488,112],{"style":64},[58,2490,69],{"style":68},[58,2492,2048],{"style":68},[58,2494,112],{"style":64},[58,2496,2053],{"style":68},[58,2498,592],{"style":68},[58,2500],{"class":60,"style":61},[58,2502,2503,2505,2507,2509,2511,2513,2515],{"class":60,"style":61},[58,2504,1505],{"style":64},[58,2506,69],{"style":68},[58,2508,2387],{"style":72},[58,2510,76],{"style":68},[58,2512,1515],{"style":64},[58,2514,2247],{"style":97},[58,2516,664],{"style":68},[58,2518,2519,2521,2523,2526,2528,2530,2532,2534,2536,2538,2540,2542],{"class":60,"style":61},[58,2520,2400],{"style":97},[58,2522,543],{"style":68},[58,2524,2525],{"style":68},"body",[58,2527,112],{"style":64},[58,2529,69],{"style":68},[58,2531,2411],{"style":68},[58,2533,112],{"style":64},[58,2535,2416],{"style":82},[58,2537,20],{"style":64},[58,2539,2421],{"style":68},[58,2541,112],{"style":64},[58,2543,2426],{"style":68},[37,2545,2547],{"id":2546},"replace-the-zod-schemas","Replace the Zod schemas",[10,2549,1594,2550,2145,2555,925,2557,2150,2559,1685,2562,2564,2565,2568],{},[768,2551,2552],{"href":881},[17,2553,2554],{},"@kubb\u002Fplugin-zod",[17,2556,661],{},[17,2558,2554],{},[17,2560,2561],{},"pluginZod()",[17,2563,562],{},". The schemas need Zod 4, so upgrade ",[17,2566,2567],{},"zod"," first if the app is on Zod 3:",[45,2570,2571,2583,2599,2614,2629],{"sync":1222},[48,2572,2574],{"language":1225,"filename":1226,"code":2573,"class":53},"kubb add plugin-zod",[17,2575,2576],{"class":1230},[58,2577,2578,2580],{"class":60,"style":61},[58,2579,1243],{"style":97},[58,2581,2582],{"style":72},"add plugin-zod",[48,2584,2586],{"language":1225,"filename":1256,"code":2585,"class":53},"pnpm add -D @kubb\u002Fplugin-zod",[17,2587,2588],{"class":1230},[58,2589,2590,2592,2594,2596],{"class":60,"style":61},[58,2591,1264],{"style":97},[58,2593,1624],{"style":72},[58,2595,1270],{"style":72},[58,2597,2598],{"style":72},"kubb\u002Fplugin-zod",[48,2600,2602],{"language":1225,"filename":1281,"code":2601,"class":53},"npm install -D @kubb\u002Fplugin-zod",[17,2603,2604],{"class":1230},[58,2605,2606,2608,2610,2612],{"class":60,"style":61},[58,2607,1235],{"style":97},[58,2609,1641],{"style":72},[58,2611,1270],{"style":72},[58,2613,2598],{"style":72},[48,2615,2617],{"language":1225,"filename":1302,"code":2616,"class":53},"yarn add -D @kubb\u002Fplugin-zod",[17,2618,2619],{"class":1230},[58,2620,2621,2623,2625,2627],{"class":60,"style":61},[58,2622,1310],{"style":97},[58,2624,1624],{"style":72},[58,2626,1270],{"style":72},[58,2628,2598],{"style":72},[48,2630,2632],{"language":1225,"filename":1323,"code":2631,"class":53},"bun add -d @kubb\u002Fplugin-zod",[17,2633,2634],{"class":1230},[58,2635,2636,2638,2640,2642],{"class":60,"style":61},[58,2637,1331],{"style":97},[58,2639,1672],{"style":72},[58,2641,1270],{"style":72},[58,2643,2598],{"style":72},[10,2645,2646,2647,2649,2650,2652],{},"orval writes one schema per operation and inlines the model in each. Kubb writes one schema per model, such as ",[17,2648,999],{},", and the operation schemas refer to it. Run ",[17,2651,1352],{},", then replace each import:",[45,2654,2655,2726],{},[48,2656,2658],{"language":50,"filename":750,"code":2657,"class":53},"import { GetPetByIdParams, GetPetByIdResponse } from '.\u002Fapi\u002Fpet\u002Fpet.zod'\n\nconst pet = GetPetByIdResponse.parse(json)\nconst path = GetPetByIdParams.parse(params)",[17,2659,2660,84,2681,84,2683,84,2704],{"class":56},[58,2661,2662,2664,2666,2669,2671,2674,2676,2678],{"class":60,"style":61},[58,2663,65],{"style":64},[58,2665,69],{"style":68},[58,2667,2668],{"style":97},"GetPetByIdParams",[58,2670,20],{"style":64},[58,2672,2673],{"style":97},"GetPetByIdResponse ",[58,2675,76],{"style":68},[58,2677,79],{"style":64},[58,2679,2680],{"style":82},"'.\u002Fapi\u002Fpet\u002Fpet.zod'",[58,2682],{"class":60,"style":61},[58,2684,2685,2687,2689,2691,2693,2695,2698,2700,2702],{"class":60,"style":61},[58,2686,1505],{"style":64},[58,2688,2367],{"style":72},[58,2690,1515],{"style":64},[58,2692,993],{"style":97},[58,2694,35],{"style":64},[58,2696,2697],{"style":97},"parse",[58,2699,1852],{"style":68},[58,2701,1365],{"style":72},[58,2703,2360],{"style":68},[58,2705,2706,2708,2711,2713,2715,2717,2719,2721,2724],{"class":60,"style":61},[58,2707,1505],{"style":64},[58,2709,2710],{"style":72},"path ",[58,2712,1515],{"style":64},[58,2714,2668],{"style":97},[58,2716,35],{"style":64},[58,2718,2697],{"style":97},[58,2720,1852],{"style":68},[58,2722,2723],{"style":72},"params",[58,2725,2360],{"style":68},[48,2727,2729],{"language":50,"filename":753,"code":2728,"class":53},"import { getPetByIdPathSchema } from '.\u002Fgen\u002Fzod\u002FgetPetByIdSchema'\nimport { petSchema } from '.\u002Fgen\u002Fzod\u002FpetSchema'\n\nconst pet = petSchema.parse(json)\nconst path = getPetByIdPathSchema.parse(params)",[17,2730,2731,84,2747,84,2763,84,2765,84,2785],{"class":56},[58,2732,2733,2735,2737,2740,2742,2744],{"class":60,"style":61},[58,2734,65],{"style":64},[58,2736,69],{"style":68},[58,2738,2739],{"style":72},"getPetByIdPathSchema ",[58,2741,76],{"style":68},[58,2743,79],{"style":64},[58,2745,2746],{"style":82},"'.\u002Fgen\u002Fzod\u002FgetPetByIdSchema'",[58,2748,2749,2751,2753,2756,2758,2760],{"class":60,"style":61},[58,2750,65],{"style":64},[58,2752,69],{"style":68},[58,2754,2755],{"style":72},"petSchema ",[58,2757,76],{"style":68},[58,2759,79],{"style":64},[58,2761,2762],{"style":82},"'.\u002Fgen\u002Fzod\u002FpetSchema'",[58,2764],{"class":60,"style":61},[58,2766,2767,2769,2771,2773,2775,2777,2779,2781,2783],{"class":60,"style":61},[58,2768,1505],{"style":64},[58,2770,2367],{"style":72},[58,2772,1515],{"style":64},[58,2774,999],{"style":72},[58,2776,35],{"style":64},[58,2778,2697],{"style":97},[58,2780,1852],{"style":68},[58,2782,1365],{"style":72},[58,2784,2360],{"style":68},[58,2786,2787,2789,2791,2793,2796,2798,2800,2802,2804],{"class":60,"style":61},[58,2788,1505],{"style":64},[58,2790,2710],{"style":72},[58,2792,1515],{"style":64},[58,2794,2795],{"style":72},"getPetByIdPathSchema",[58,2797,35],{"style":64},[58,2799,2697],{"style":97},[58,2801,1852],{"style":68},[58,2803,2723],{"style":72},[58,2805,2360],{"style":68},[37,2807,2809],{"id":2808},"replace-the-mocks","Replace the mocks",[10,2811,1594,2812,853,2817,2822,2823,2826],{},[768,2813,2814],{"href":899},[17,2815,2816],{},"@kubb\u002Fplugin-faker",[768,2818,2819],{"href":894},[17,2820,2821],{},"@kubb\u002Fplugin-msw",". The generated code needs MSW 3 and ",[17,2824,2825],{},"@faker-js\u002Ffaker"," 10, so upgrade them first if the app is on older versions:",[45,2828,2829,2848,2869,2888,2907],{"sync":1222},[48,2830,2832],{"language":1225,"filename":1226,"code":2831,"class":53},"kubb add plugin-faker\nkubb add plugin-msw",[17,2833,2834,84,2841],{"class":1230},[58,2835,2836,2838],{"class":60,"style":61},[58,2837,1243],{"style":97},[58,2839,2840],{"style":72},"add plugin-faker",[58,2842,2843,2845],{"class":60,"style":61},[58,2844,1243],{"style":97},[58,2846,2847],{"style":72},"add plugin-msw",[48,2849,2851],{"language":1225,"filename":1256,"code":2850,"class":53},"pnpm add -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[17,2852,2853],{"class":1230},[58,2854,2855,2857,2859,2861,2864,2866],{"class":60,"style":61},[58,2856,1264],{"style":97},[58,2858,1624],{"style":72},[58,2860,1270],{"style":72},[58,2862,2863],{"style":72},"kubb\u002Fplugin-faker ",[58,2865,1270],{"style":72},[58,2867,2868],{"style":72},"kubb\u002Fplugin-msw",[48,2870,2872],{"language":1225,"filename":1281,"code":2871,"class":53},"npm install -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[17,2873,2874],{"class":1230},[58,2875,2876,2878,2880,2882,2884,2886],{"class":60,"style":61},[58,2877,1235],{"style":97},[58,2879,1641],{"style":72},[58,2881,1270],{"style":72},[58,2883,2863],{"style":72},[58,2885,1270],{"style":72},[58,2887,2868],{"style":72},[48,2889,2891],{"language":1225,"filename":1302,"code":2890,"class":53},"yarn add -D @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[17,2892,2893],{"class":1230},[58,2894,2895,2897,2899,2901,2903,2905],{"class":60,"style":61},[58,2896,1310],{"style":97},[58,2898,1624],{"style":72},[58,2900,1270],{"style":72},[58,2902,2863],{"style":72},[58,2904,1270],{"style":72},[58,2906,2868],{"style":72},[48,2908,2910],{"language":1225,"filename":1323,"code":2909,"class":53},"bun add -d @kubb\u002Fplugin-faker @kubb\u002Fplugin-msw",[17,2911,2912],{"class":1230},[58,2913,2914,2916,2918,2920,2922,2924],{"class":60,"style":61},[58,2915,1331],{"style":97},[58,2917,1672],{"style":72},[58,2919,1270],{"style":72},[58,2921,2863],{"style":72},[58,2923,1270],{"style":72},[58,2925,2868],{"style":72},[10,2927,2928,2929,1049,2931,2934,2935,2938],{},"Set the options on ",[17,2930,684],{},[17,2932,2933],{},"parser: 'faker'"," makes a handler return generated data, like orval's mocks, and ",[17,2936,2937],{},"handlers: true"," exports every handler as one list:",[48,2940,2942],{"language":50,"filename":352,"code":2941,"class":53},"import { pluginFaker } from '@kubb\u002Fplugin-faker'\nimport { pluginMsw } from '@kubb\u002Fplugin-msw'\n\n\u002F\u002F ...\nplugins: [\n  \u002F\u002F ...\n  pluginFaker(),\n  pluginMsw({ baseURL: 'https:\u002F\u002Fpetstore3.swagger.io\u002Fapi\u002Fv3', parser: 'faker', handlers: true }),\n],",[17,2943,2944,84,2958,84,2972,84,2974,84,2978,84,2986,84,2992,84,3002,84,3036],{"class":56},[58,2945,2946,2948,2950,2952,2954,2956],{"class":60,"style":61},[58,2947,65],{"style":64},[58,2949,69],{"style":68},[58,2951,395],{"style":72},[58,2953,76],{"style":68},[58,2955,79],{"style":64},[58,2957,402],{"style":82},[58,2959,2960,2962,2964,2966,2968,2970],{"class":60,"style":61},[58,2961,65],{"style":64},[58,2963,69],{"style":68},[58,2965,427],{"style":72},[58,2967,76],{"style":68},[58,2969,79],{"style":64},[58,2971,434],{"style":82},[58,2973],{"class":60,"style":61},[58,2975,2976],{"class":60,"style":61},[58,2977,1717],{"style":601},[58,2979,2980,2982,2984],{"class":60,"style":61},[58,2981,562],{"style":72},[58,2983,112],{"style":64},[58,2985,567],{"style":68},[58,2987,2988,2990],{"class":60,"style":61},[58,2989,106],{"style":68},[58,2991,1717],{"style":601},[58,2993,2994,2996,2998,3000],{"class":60,"style":61},[58,2995,106],{"style":601},[58,2997,673],{"style":97},[58,2999,664],{"style":68},[58,3001,131],{"style":64},[58,3003,3004,3006,3008,3010,3012,3014,3016,3018,3020,3022,3024,3026,3028,3030,3032,3034],{"class":60,"style":61},[58,3005,106],{"style":64},[58,3007,684],{"style":97},[58,3009,543],{"style":68},[58,3011,614],{"style":68},[58,3013,112],{"style":64},[58,3015,619],{"style":82},[58,3017,20],{"style":64},[58,3019,697],{"style":68},[58,3021,112],{"style":64},[58,3023,702],{"style":82},[58,3025,20],{"style":64},[58,3027,707],{"style":68},[58,3029,112],{"style":64},[58,3031,650],{"style":68},[58,3033,349],{"style":68},[58,3035,131],{"style":64},[58,3037,3038,3040],{"class":60,"style":61},[58,3039,722],{"style":68},[58,3041,131],{"style":64},[10,3043,2272,3044,3046],{},[17,3045,1352],{},", then replace the handlers and the mock data:",[45,3048,3049,3179],{},[48,3050,3052],{"language":50,"filename":750,"code":3051,"class":53},"import { setupServer } from 'msw\u002Fnode'\nimport { getGetPetByIdResponseMock } from '.\u002Fapi\u002Fpet\u002Fpet.faker'\nimport { getGetPetByIdMockHandler, getPetMock } from '.\u002Fapi\u002Fpet\u002Fpet.msw'\n\nexport const server = setupServer(getGetPetByIdMockHandler({ name: 'Rex', photoUrls: [] }), ...getPetMock())\n\nconst pet = getGetPetByIdResponseMock({ name: 'Rex' })",[17,3053,3054,84,3070,84,3086,84,3107,84,3109,84,3155,84,3157],{"class":56},[58,3055,3056,3058,3060,3063,3065,3067],{"class":60,"style":61},[58,3057,65],{"style":64},[58,3059,69],{"style":68},[58,3061,3062],{"style":72},"setupServer ",[58,3064,76],{"style":68},[58,3066,79],{"style":64},[58,3068,3069],{"style":82},"'msw\u002Fnode'",[58,3071,3072,3074,3076,3079,3081,3083],{"class":60,"style":61},[58,3073,65],{"style":64},[58,3075,69],{"style":68},[58,3077,3078],{"style":72},"getGetPetByIdResponseMock ",[58,3080,76],{"style":68},[58,3082,79],{"style":64},[58,3084,3085],{"style":82},"'.\u002Fapi\u002Fpet\u002Fpet.faker'",[58,3087,3088,3090,3092,3095,3097,3100,3102,3104],{"class":60,"style":61},[58,3089,65],{"style":64},[58,3091,69],{"style":68},[58,3093,3094],{"style":72},"getGetPetByIdMockHandler",[58,3096,20],{"style":64},[58,3098,3099],{"style":72},"getPetMock ",[58,3101,76],{"style":68},[58,3103,79],{"style":64},[58,3105,3106],{"style":82},"'.\u002Fapi\u002Fpet\u002Fpet.msw'",[58,3108],{"class":60,"style":61},[58,3110,3111,3113,3115,3118,3120,3123,3125,3127,3129,3131,3133,3135,3137,3139,3141,3144,3146,3149,3152],{"class":60,"style":61},[58,3112,91],{"style":64},[58,3114,1505],{"style":64},[58,3116,3117],{"style":72},"server ",[58,3119,1515],{"style":64},[58,3121,3122],{"style":97},"setupServer",[58,3124,1852],{"style":68},[58,3126,3094],{"style":97},[58,3128,543],{"style":68},[58,3130,2411],{"style":68},[58,3132,112],{"style":64},[58,3134,2416],{"style":82},[58,3136,20],{"style":64},[58,3138,2421],{"style":68},[58,3140,112],{"style":64},[58,3142,3143],{"style":68},"[] })",[58,3145,20],{"style":64},[58,3147,3148],{"style":64},"...",[58,3150,3151],{"style":97},"getPetMock",[58,3153,3154],{"style":68},"())",[58,3156],{"class":60,"style":61},[58,3158,3159,3161,3163,3165,3168,3170,3172,3174,3177],{"class":60,"style":61},[58,3160,1505],{"style":64},[58,3162,2367],{"style":72},[58,3164,1515],{"style":64},[58,3166,3167],{"style":97},"getGetPetByIdResponseMock",[58,3169,543],{"style":68},[58,3171,2411],{"style":68},[58,3173,112],{"style":64},[58,3175,3176],{"style":82},"'Rex' ",[58,3178,349],{"style":68},[48,3180,3182],{"language":50,"filename":753,"code":3181,"class":53},"import { setupServer } from 'msw\u002Fnode'\nimport { getPetByIdHandler } from '.\u002Fgen\u002Fhandlers\u002FgetPetByIdHandler'\nimport { handlers } from '.\u002Fgen\u002Fhandlers\u002Fhandlers'\nimport { createPet } from '.\u002Fgen\u002Fmocks\u002FcreatePet'\n\nexport const server = setupServer(getPetByIdHandler({ name: 'Rex', photoUrls: [] }), ...handlers)\n\nconst pet = createPet({ name: 'Rex' })",[17,3183,3184,84,3198,84,3214,84,3230,84,3246,84,3248,84,3289,84,3291],{"class":56},[58,3185,3186,3188,3190,3192,3194,3196],{"class":60,"style":61},[58,3187,65],{"style":64},[58,3189,69],{"style":68},[58,3191,3062],{"style":72},[58,3193,76],{"style":68},[58,3195,79],{"style":64},[58,3197,3069],{"style":82},[58,3199,3200,3202,3204,3207,3209,3211],{"class":60,"style":61},[58,3201,65],{"style":64},[58,3203,69],{"style":68},[58,3205,3206],{"style":72},"getPetByIdHandler ",[58,3208,76],{"style":68},[58,3210,79],{"style":64},[58,3212,3213],{"style":82},"'.\u002Fgen\u002Fhandlers\u002FgetPetByIdHandler'",[58,3215,3216,3218,3220,3223,3225,3227],{"class":60,"style":61},[58,3217,65],{"style":64},[58,3219,69],{"style":68},[58,3221,3222],{"style":72},"handlers ",[58,3224,76],{"style":68},[58,3226,79],{"style":64},[58,3228,3229],{"style":82},"'.\u002Fgen\u002Fhandlers\u002Fhandlers'",[58,3231,3232,3234,3236,3239,3241,3243],{"class":60,"style":61},[58,3233,65],{"style":64},[58,3235,69],{"style":68},[58,3237,3238],{"style":72},"createPet ",[58,3240,76],{"style":68},[58,3242,79],{"style":64},[58,3244,3245],{"style":82},"'.\u002Fgen\u002Fmocks\u002FcreatePet'",[58,3247],{"class":60,"style":61},[58,3249,3250,3252,3254,3256,3258,3260,3262,3265,3267,3269,3271,3273,3275,3277,3279,3281,3283,3285,3287],{"class":60,"style":61},[58,3251,91],{"style":64},[58,3253,1505],{"style":64},[58,3255,3117],{"style":72},[58,3257,1515],{"style":64},[58,3259,3122],{"style":97},[58,3261,1852],{"style":68},[58,3263,3264],{"style":97},"getPetByIdHandler",[58,3266,543],{"style":68},[58,3268,2411],{"style":68},[58,3270,112],{"style":64},[58,3272,2416],{"style":82},[58,3274,20],{"style":64},[58,3276,2421],{"style":68},[58,3278,112],{"style":64},[58,3280,3143],{"style":68},[58,3282,20],{"style":64},[58,3284,3148],{"style":64},[58,3286,707],{"style":72},[58,3288,2360],{"style":68},[58,3290],{"class":60,"style":61},[58,3292,3293,3295,3297,3299,3302,3304,3306,3308,3310],{"class":60,"style":61},[58,3294,1505],{"style":64},[58,3296,2367],{"style":72},[58,3298,1515],{"style":64},[58,3300,3301],{"style":97},"createPet",[58,3303,543],{"style":68},[58,3305,2411],{"style":68},[58,3307,112],{"style":64},[58,3309,3176],{"style":82},[58,3311,349],{"style":68},[10,3313,3314,3316,3317,3321],{},[17,3315,707],{}," holds every operation, where orval has one list per tag. ",[768,3318,3320],{"href":3319},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-msw\u002Fguides\u002Fmock-api","Mock API responses"," has more.",[37,3323,3325],{"id":3324},"remove-orval","Remove orval",[10,3327,3328,3329,3331,3332,853,3334,3336,3337,35],{},"Once nothing imports from ",[17,3330,34],{},", delete ",[17,3333,34],{},[17,3335,51],{},", and uninstall ",[17,3338,750],{},{"title":3340,"searchDepth":3341,"depth":3341,"links":3342},"",5,[3343,3345,3350,3351,3352,3353,3354,3355],{"id":39,"depth":3344,"text":40},2,{"id":731,"depth":3344,"text":732,"children":3346},[3347,3349],{"id":736,"depth":3348,"text":737},3,{"id":904,"depth":3348,"text":905},{"id":1041,"depth":3344,"text":1042},{"id":1590,"depth":3344,"text":1591},{"id":2135,"depth":3344,"text":2136},{"id":2546,"depth":3344,"text":2547},{"id":2808,"depth":3344,"text":2809},{"id":3324,"depth":3344,"text":3325},"Replace orval with Kubb. Generate the same types, then swap the client, query hooks, Zod schemas, and MSW mocks one step at a time.","md",{"layout":3359,"title":5,"description":3356,"outline":3360,"order":3361,"navigation":3362},"doc",[3344,3348],1,{"title":3363,"icon":3364},"Move from orval","i-iconoir-git-fork",{"layout":3359,"outline":3366},[3344,3348],{"title":3363,"icon":3364},"\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval",{"title":5,"description":3356},{"loc":3368},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fmigrate\u002Ffrom-orval.md","docs\u002F5.x\u002Fmigrate\u002Ffrom-orval","1Gmby72dEoQXaDLVE1-U7S1cJq9C-GBHQR2baio4CLE",1795021320610]